adding skeleton
This commit is contained in:
commit
59b4a95231
.github/workflows
.gitignore.gitmodulesREADME.mdarchetypes
build-prod.pybuild.pycontent
hugo.yamllayouts/_default/_markup
themes
86
.github/workflows/pages.yml
vendored
Normal file
86
.github/workflows/pages.yml
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
# Sample workflow for building and deploying a Hugo site to GitHub Pages
|
||||
name: Deploy Hugo site (Pages)
|
||||
|
||||
on:
|
||||
# Runs on pushes targeting the default branch
|
||||
push:
|
||||
branches: ["master"]
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
# Allow one concurrent deployment
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: true
|
||||
|
||||
# Default to bash
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
# Build job
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
name: Build Pages
|
||||
steps:
|
||||
- name: Install Hugo CLI
|
||||
run: sudo apt install hugo
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Checkout content
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: Sarsoo/notes
|
||||
path: _notes
|
||||
|
||||
- name: Install obsidian-to-hugo
|
||||
run: python -m pip install obsidian-to-hugo
|
||||
|
||||
- name: Build Content
|
||||
run: python ./build-prod.py
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.13'
|
||||
|
||||
- name: Setup Pages
|
||||
id: pages
|
||||
uses: actions/configure-pages@v1
|
||||
|
||||
- name: Build with Hugo
|
||||
run: |
|
||||
hugo \
|
||||
--minify \
|
||||
--baseURL ${{ steps.pages.outputs.base_url }}
|
||||
|
||||
- name: Write CNAME
|
||||
run: echo wiki.sarsoo.xyz > ./public/CNAME
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v1
|
||||
with:
|
||||
path: ./public
|
||||
|
||||
# Deployment job
|
||||
deploy:
|
||||
name: Deploy Staging
|
||||
environment:
|
||||
name: staging
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v1
|
14
.gitignore
vendored
Normal file
14
.gitignore
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
# Generated files by hugo
|
||||
/public/
|
||||
/resources/_gen/
|
||||
/assets/jsconfig.json
|
||||
hugo_stats.json
|
||||
/content/wiki
|
||||
|
||||
# Executable may be added to repository
|
||||
hugo.exe
|
||||
hugo.darwin
|
||||
hugo.linux
|
||||
|
||||
# Temporary lock file while building
|
||||
/.hugo_build.lock
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "themes/hextra"]
|
||||
path = themes/hextra
|
||||
url = https://github.com/imfing/hextra.git
|
6
README.md
Normal file
6
README.md
Normal file
@ -0,0 +1,6 @@
|
||||
[sarwiki](https://wiki.sarsoo.xyz)
|
||||
===============
|
||||
|
||||

|
||||
|
||||
Hugo static site for [wiki.sarsoo.xyz](https://wiki.sarsoo.xyz).
|
6
archetypes/default.md
Normal file
6
archetypes/default.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
title: "{{ replace .Name "-" " " | title }}"
|
||||
date: {{ .Date }}
|
||||
draft: true
|
||||
---
|
||||
|
22
build-prod.py
Executable file
22
build-prod.py
Executable file
@ -0,0 +1,22 @@
|
||||
#! ./.venv/bin/python
|
||||
|
||||
# https://github.com/devidw/obsidian-to-hugo
|
||||
import os
|
||||
from obsidian_to_hugo import ObsidianToHugo
|
||||
|
||||
def filter_regex(file_contents: str, file_path: str) -> bool:
|
||||
return not 'Regex' in file_path
|
||||
|
||||
def filter_readmes(file_contents: str, file_path: str) -> bool:
|
||||
return not 'README.md' in file_path
|
||||
|
||||
if not os.path.exists('./content/wiki'):
|
||||
os.makedirs('./content/wiki')
|
||||
|
||||
obsidian_to_hugo = ObsidianToHugo(
|
||||
obsidian_vault_dir=os.path.expanduser("./_notes"),
|
||||
hugo_content_dir=os.path.normpath("./content/wiki"),
|
||||
filters=[filter_regex, filter_readmes],
|
||||
)
|
||||
|
||||
obsidian_to_hugo.run()
|
22
build.py
Executable file
22
build.py
Executable file
@ -0,0 +1,22 @@
|
||||
#! ./.venv/bin/python
|
||||
|
||||
# https://github.com/devidw/obsidian-to-hugo
|
||||
import os
|
||||
from obsidian_to_hugo import ObsidianToHugo
|
||||
|
||||
def filter_regex(file_contents: str, file_path: str) -> bool:
|
||||
return not 'Regex' in file_path
|
||||
|
||||
def filter_readmes(file_contents: str, file_path: str) -> bool:
|
||||
return not 'README.md' in file_path
|
||||
|
||||
if not os.path.exists('./content/wiki'):
|
||||
os.makedirs('./content/wiki')
|
||||
|
||||
obsidian_to_hugo = ObsidianToHugo(
|
||||
obsidian_vault_dir=os.path.expanduser("~/dev/html/stem"),
|
||||
hugo_content_dir=os.path.normpath("./content/wiki"),
|
||||
filters=[filter_regex, filter_readmes],
|
||||
)
|
||||
|
||||
obsidian_to_hugo.run()
|
4
content/_index.md
Normal file
4
content/_index.md
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Sarsoo Wiki'
|
||||
toc: false
|
||||
---
|
112
hugo.yaml
Normal file
112
hugo.yaml
Normal file
@ -0,0 +1,112 @@
|
||||
baseURL: 'https://wiki.sarsoo.xyz/'
|
||||
languageCode: 'en-gb'
|
||||
title: 'sarwiki'
|
||||
theme: 'hextra'
|
||||
|
||||
# Parse Git commit
|
||||
# enableGitInfo: true
|
||||
|
||||
outputs:
|
||||
home: [HTML]
|
||||
page: [HTML]
|
||||
section: [HTML, RSS]
|
||||
|
||||
markup:
|
||||
highlight:
|
||||
noClasses: false
|
||||
goldmark:
|
||||
renderer:
|
||||
unsafe: true
|
||||
extensions:
|
||||
passthrough:
|
||||
delimiters:
|
||||
block: [['\[', '\]'], ['$$', '$$']]
|
||||
inline: [['\(', '\)'], ['$', '$']]
|
||||
enable: true
|
||||
|
||||
enableInlineShortcodes: true
|
||||
|
||||
menu:
|
||||
main:
|
||||
- identifier: wiki
|
||||
name: Wiki
|
||||
pageRef: /wiki
|
||||
weight: 1
|
||||
- identifier: blog
|
||||
name: Blog
|
||||
url: "https://sarsoo.xyz"
|
||||
weight: 2
|
||||
- identifier: about
|
||||
name: About
|
||||
pageRef: /about
|
||||
weight: 3
|
||||
- name: Search
|
||||
weight: 4
|
||||
params:
|
||||
type: search
|
||||
- name: GitHub
|
||||
weight: 5
|
||||
url: "https://github.com/Sarsoo/noteswiki"
|
||||
params:
|
||||
icon: github
|
||||
|
||||
sidebar:
|
||||
- identifier: more
|
||||
name: More
|
||||
params:
|
||||
type: separator
|
||||
weight: 1
|
||||
- identifier: about
|
||||
name: "About"
|
||||
pageRef: "/about"
|
||||
weight: 2
|
||||
|
||||
params:
|
||||
description: STEM notes
|
||||
|
||||
navbar:
|
||||
displayTitle: true
|
||||
displayLogo: false
|
||||
logo:
|
||||
path: images/logo.svg
|
||||
dark: images/logo-dark.svg
|
||||
# width: 40
|
||||
# height: 20
|
||||
# link: /
|
||||
width: wide
|
||||
|
||||
page:
|
||||
# full (100%), wide (90rem), normal (1280px)
|
||||
width: normal
|
||||
|
||||
theme:
|
||||
# light | dark | system
|
||||
default: system
|
||||
# displayToggle: true
|
||||
|
||||
footer:
|
||||
enable: false
|
||||
displayCopyright: true
|
||||
displayPoweredBy: false
|
||||
width: normal
|
||||
|
||||
# Display the last modification date
|
||||
displayUpdatedDate: true
|
||||
|
||||
# Search
|
||||
search:
|
||||
enable: true
|
||||
type: flexsearch
|
||||
|
||||
flexsearch:
|
||||
# index page by: content | summary | heading | title
|
||||
index: content
|
||||
# full | forward | reverse | strict
|
||||
# https://github.com/nextapps-de/flexsearch/#tokenizer-prefix-search
|
||||
tokenize: full
|
||||
|
||||
highlight:
|
||||
copy:
|
||||
enable: true
|
||||
# hover | always
|
||||
display: hover
|
18
layouts/_default/_markup/render-link.html
Normal file
18
layouts/_default/_markup/render-link.html
Normal file
@ -0,0 +1,18 @@
|
||||
{{- $url := urls.Parse .Destination -}}
|
||||
{{- $scheme := $url.Scheme -}}
|
||||
|
||||
<a href="
|
||||
{{- if eq $scheme "" -}}
|
||||
{{- if strings.HasSuffix $url.Path ".md" -}}
|
||||
{{- relref .Page .Destination | safeURL -}}
|
||||
{{- else -}}
|
||||
{{- .Destination | safeURL -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- .Destination | safeURL -}}
|
||||
{{- end -}}"
|
||||
{{- with .Title }} title="{{ . | safeHTML }}"{{- end -}}>
|
||||
{{- .Text | safeHTML -}}
|
||||
</a>
|
||||
|
||||
{{- /* whitespace stripped here to avoid trailing newline in rendered result caused by file EOL */ -}}
|
1
themes/hextra
Submodule
1
themes/hextra
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 83fda0109f55a16476bd404cf00b75784095d1da
|
Loading…
x
Reference in New Issue
Block a user