├── images ├── tn.jpg └── screenshot.png ├── layouts ├── _default │ ├── _markup │ │ ├── render-codeblock-mermaid.html │ │ └── render-codeblock.html │ ├── baseof.html │ ├── section.html │ ├── term.html │ ├── taxonomy.html │ ├── home.html │ └── single.html └── partials │ ├── sidebar.html │ ├── module │ ├── sidebar_btn.html │ ├── page_translated.html │ ├── term_icon.html │ ├── breadcrumb.html │ ├── show_math.html │ └── section_tree.html │ ├── header.html │ ├── html_footer.html │ ├── footer.html │ └── html_head.html ├── .prettierignore ├── .gitignore ├── .prettierrc.json ├── assets └── _theme │ ├── js │ ├── dir_toggle.js │ ├── codeblock_copy.js │ └── sidebar.js │ └── css │ ├── 01_layout.css │ ├── 04_responsive.css │ ├── 03_home.css │ ├── 05_markdown.css │ └── 02_style.css ├── archetypes └── default.md ├── theme.toml ├── i18n └── en.toml ├── .eslintrc.json ├── package.json ├── .github └── workflows │ └── hugo.yml ├── hugo.toml ├── LICENSE ├── hugo.multilang.toml └── README.md /images/tn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JingWangTW/dark-theme-editor/HEAD/images/tn.jpg -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JingWangTW/dark-theme-editor/HEAD/images/screenshot.png -------------------------------------------------------------------------------- /layouts/_default/_markup/render-codeblock-mermaid.html: -------------------------------------------------------------------------------- 1 |
2 |     {{- .Inner | safeHTML }}
3 | 
4 | 5 | {{ .Page.Store.Set "hasMermaid" true }} 6 | -------------------------------------------------------------------------------- /layouts/partials/sidebar.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /layouts/partials/module/sidebar_btn.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # node modules and config files are ignored 2 | /node_modules 3 | 4 | # node dependency version is not required to this project 5 | package-lock.json 6 | 7 | # ignore hugo generated 8 | /public/** 9 | /resources/** 10 | .hugo_build.lock 11 | 12 | # ignore vscode configuration 13 | /.vscode -------------------------------------------------------------------------------- /layouts/partials/module/page_translated.html: -------------------------------------------------------------------------------- 1 | 2 | {{ $.Site.Language.LanguageName }} 3 | 4 | 5 | {{ range $index, $element := .Translations }} 6 | / 7 | 8 | 9 | {{ .Language.LanguageName }} 10 | 11 | {{ end }} 12 | -------------------------------------------------------------------------------- /layouts/partials/module/term_icon.html: -------------------------------------------------------------------------------- 1 | {{ if eq .Data.Singular "tag" }} 2 | 3 | {{ else if eq .Data.Singular "category" }} 4 | 5 | {{ else if eq .Data.Singular "autor" }} 6 | 7 | {{ else }} 8 | 9 | {{ end }} 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # node modules and config files are ignored 2 | /node_modules 3 | 4 | # node dependency version is not required to this project 5 | package-lock.json 6 | 7 | # ignore hugo generated 8 | /public/** 9 | /resources/** 10 | .hugo_build.lock 11 | 12 | # ignore vscode configuration 13 | /.vscode 14 | 15 | # this is a theme, we don't need these files 16 | /content 17 | /themes 18 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 4, 3 | "useTabs": false, 4 | "singleQuote": false, 5 | "quoteProps": "as-needed", 6 | "bracketSpacing": true, 7 | "bracketSameLine": true, 8 | "overrides": [ 9 | { 10 | "files": ["*.html"], 11 | "options": { 12 | "parser": "go-template" 13 | } 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /assets/_theme/js/dir_toggle.js: -------------------------------------------------------------------------------- 1 | window.addEventListener("load", function () { 2 | // sub dir toggle 3 | document.querySelectorAll("li.dir > span.dir-text").forEach((element) => { 4 | element.addEventListener("click", function () { 5 | this.parentNode.classList.toggle("opened-dir"); 6 | this.parentNode.classList.toggle("closed-dir"); 7 | }); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /layouts/_default/baseof.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ partial "html_head.html" . }} 4 | 5 | 6 | 7 | {{ partial "header.html" . }} 8 | 9 | 10 |
11 | {{ partial "sidebar.html" . }} 12 | 13 | {{ block "main_article" . }} 14 | {{ end }} 15 |
16 | 17 | {{ partial "footer.html" . }} 18 | 19 | 20 | {{ partial "html_footer.html" . }} 21 | 22 | -------------------------------------------------------------------------------- /archetypes/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | author: {{ .Site.Params.globalFrontmatter.author }} 5 | tags: ["put", "some", "tags", "here"] 6 | categories: ["catgorized", "the", "page"] 7 | description: "Description of this page." 8 | keywords: "keywords,used,for,SEO" 9 | draft: false 10 | includeToc: true 11 | localCss: [] 12 | externalCss: [] 13 | externalCssDownload: [] 14 | localJs: [] 15 | externalJs: [] 16 | externalJsDownload: [] 17 | useMath: false 18 | --- 19 | 20 | 21 | -------------------------------------------------------------------------------- /layouts/_default/section.html: -------------------------------------------------------------------------------- 1 | {{ define "main_article" }} 2 |
3 | {{ partial "module/sidebar_btn" . }} 4 | 5 | 6 |
7 |

{{ .Title }}

8 |
9 | 10 |
11 |
12 | 13 | {{ partial "module/breadcrumb" . }} 14 |
15 |
16 | 17 |
18 | 19 |
20 | {{ partial "module/section_tree" ( dict "context" . "currentPage" . ) }} 21 |
22 |
23 | {{ end }} 24 | -------------------------------------------------------------------------------- /theme.toml: -------------------------------------------------------------------------------- 1 | name = "Dark Theme Editor" 2 | license = "Apache-2.0" 3 | licenselink = "https://github.com/JingWangTW/dark-theme-editor/blob/main/LICENSE" 4 | demosite = "https://jingwangtw.github.io/dark-theme-editor/" 5 | description = "A simple, editor-like theme for Hugo." 6 | homepage = "https://github.com/JingWangTW/dark-theme-editor" 7 | tags = ["multilingual", "dark", "responsive", "technical", "editor", "Docs"] 8 | features = ["multilingual", "syntax highlighting", "responsive"] 9 | 10 | [author] 11 | name = "Jing Wang" 12 | homepage = "https://github.com/JingWangTW" 13 | 14 | [origin] 15 | name = "edidor" 16 | homepage = "https://github.com/sfengyuan/edidor" 17 | repo = "https://github.com/sfengyuan/edidor" -------------------------------------------------------------------------------- /layouts/_default/_markup/render-codeblock.html: -------------------------------------------------------------------------------- 1 | {{/* https://discourse.gohugo.io/t/documentation-for-code-block-render-hooks/37610/3 */}} 2 | 3 | {{ $class := .Attributes.class | default "" }} 4 | {{ $lang := .Attributes.lang | default .Type }} 5 | {{ $opts := .Options | default dict }} 6 | 7 | 8 |
9 | {{ with $.Page.Site.Params.page.codeBlockCopible }} 10 |
11 | 14 |
15 | {{ end }} 16 | 17 | {{ if transform.CanHighlight $lang }} 18 | {{ highlight .Inner $lang $opts }} 19 | {{ else }} 20 |
{{ .Inner }}
21 | {{ end }} 22 |
23 | -------------------------------------------------------------------------------- /layouts/partials/module/breadcrumb.html: -------------------------------------------------------------------------------- 1 | {{ if .Parent }} 2 | {{ partial "module/breadcrumb" .Parent }} 3 | {{ else if not .IsHome }} 4 | {{ partial "module/breadcrumb" .Site.Home }} 5 | {{ end }} 6 | 7 | {{ if not .IsHome }} 8 | / 9 | {{ end }} 10 | 11 | 12 | 13 | {{ if .IsHome }} 14 | 15 | {{ else if eq .Kind "taxonomy" }} 16 | {{ partial "module/term_icon" . }} 17 | {{ end }} 18 | 19 | {{ if .IsHome }} 20 | {{ i18n "breadcrumb_home" | title }} 21 | {{ else if .IsPage }} 22 | {{ if $.Site.Params.preference.showFileName }} 23 | {{ .File.TranslationBaseName }}.{{ .File.Ext }} 24 | {{ else }} 25 | {{ .Title }} 26 | {{ end }} 27 | 28 | {{ else }} 29 | {{ .Title }} 30 | {{ end }} 31 | 32 | -------------------------------------------------------------------------------- /i18n/en.toml: -------------------------------------------------------------------------------- 1 | 2 | # The "recent posts" show in home page 3 | recent_posts = 'recent posts' 4 | 5 | # The "Walkthroughs" show in home page 6 | walkthroughs = 'walkthroughs' 7 | 8 | # Hint text of page meta data related icons 9 | author = 'author' 10 | date = 'date' 11 | time_to_read = 'time to read' 12 | 13 | # Hint text to indicate an empty page 14 | empty_page = 'no content on this page.' 15 | 16 | # Title of a terms page 17 | all_about = 'all about' 18 | 19 | # Hint text to show for language menu icon 20 | language = 'language' 21 | 22 | # The "Home" shown in breadcrumb root 23 | breadcrumb_home = 'home' 24 | 25 | # Hint text of related icons of a content 26 | [category] 27 | one = 'category' 28 | other = 'categories' 29 | 30 | [tag] 31 | one = 'Tag' 32 | other = 'Tags' 33 | 34 | # Time of minutes to read a page 35 | [min_to_read] 36 | one = '{{ . }} min to read' 37 | other = '{{ . }} mins to read' -------------------------------------------------------------------------------- /assets/_theme/css/01_layout.css: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * This file contains the stlying used for layout. 3 | *******************************************************************************************/ 4 | 5 | @charset "UTF-8"; 6 | 7 | :root { 8 | /* 9 | 3pt: expand bar 10 | 4%:
padding 11 | 1px: dummpy 12 | */ 13 | --artile_main_width: calc(85% - 3pt - 4% - 1px); 14 | } 15 | 16 | body { 17 | height: 100vh; 18 | max-height: 100vh; 19 | } 20 | 21 | header { 22 | height: 3%; 23 | } 24 | 25 | main { 26 | /* 27 | 2pt: border in headr and footer 28 | */ 29 | height: calc(94% - 2pt); 30 | display: flex; 31 | } 32 | 33 | aside.sidebar { 34 | width: 15%; 35 | } 36 | 37 | article { 38 | width: var(--artile_main_width); 39 | } 40 | 41 | footer { 42 | height: 3%; 43 | } 44 | -------------------------------------------------------------------------------- /layouts/partials/header.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ with $.Site.Params.header.logo.imgUrl }} 4 | {{ if $.Site.Params.header.logo.logoLink }} 5 | 6 | 8 | 9 | {{ else }} 10 | 11 | 13 | 14 | {{ end }} 15 | 16 | {{ end }} 17 |
18 | 19 |
20 | {{ if .IsHome }} 21 | {{ $.Site.Params.header.title }} 22 | {{ else }} 23 | {{ $.Page.Title }} - 24 | {{ $.Site.Params.header.title }} 25 | {{ end }} 26 |
27 |
28 | -------------------------------------------------------------------------------- /assets/_theme/js/codeblock_copy.js: -------------------------------------------------------------------------------- 1 | window.addEventListener("load", function () { 2 | document.querySelectorAll("button.copy-button").forEach((element) => { 3 | element.addEventListener("click", (event) => { 4 | let button = event.currentTarget; 5 | let iconElement = button.querySelector("i"); 6 | 7 | if (button.getAttribute("state") === "copy") { 8 | navigator.clipboard.writeText( 9 | decodeURI(button.getAttribute("data")) 10 | ); 11 | 12 | button.setAttribute("state", "copied"); 13 | iconElement.classList.remove("bi-copy"); 14 | iconElement.classList.add("bi-check2-all"); 15 | 16 | window.setTimeout(() => { 17 | button.setAttribute("state", "copy"); 18 | iconElement.classList.remove("bi-check2-all"); 19 | iconElement.classList.add("bi-copy"); 20 | }, 2 * 1000); 21 | } 22 | }); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "commonjs": true, 5 | "es2021": true 6 | }, 7 | "extends": ["eslint:recommended", "plugin:json/recommended"], 8 | "parserOptions": { 9 | "ecmaVersion": "latest" 10 | }, 11 | 12 | "ignorePatterns": ["node_modules/", "public/", "resources/"], 13 | "rules": { 14 | "no-trailing-spaces": "error", 15 | "comma-dangle": [ 16 | "error", 17 | { 18 | "arrays": "always-multiline", 19 | "objects": "always-multiline", 20 | "imports": "always-multiline", 21 | "exports": "always-multiline", 22 | "functions": "never" 23 | } 24 | ], 25 | "function-paren-newline": "off", 26 | "global-require": "error", 27 | "import/no-dynamic-require": "off", 28 | "no-inner-declarations": "off", 29 | "class-methods-use-this": "off", 30 | "import/extensions": "off", 31 | "import/prefer-default-export": "off", 32 | "no-multiple-empty-lines": ["error"] 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /layouts/_default/term.html: -------------------------------------------------------------------------------- 1 | {{ define "main_article" }} 2 |
3 | {{ partial "module/sidebar_btn" . }} 4 | 5 | 6 |
7 |

8 | {{ partial "module/term_icon" . }} 9 | 10 | {{ i18n "all_about" | title }} 11 | 12 | {{ .Title | singularize }} 13 | 14 |

15 |
16 | 17 | 23 | 24 |
25 | 26 |
27 | 36 |
37 |
38 | {{ end }} 39 | -------------------------------------------------------------------------------- /layouts/_default/taxonomy.html: -------------------------------------------------------------------------------- 1 | {{ define "main_article" }} 2 |
3 | {{ partial "module/sidebar_btn" . }} 4 | 5 | 6 |
7 |

8 | {{ if eq .Data.Singular "tag" }} 9 | 10 | {{ else if eq .Data.Singular "category" }} 11 | 12 | {{ else if eq .Data.Singular "autor" }} 13 | 14 | {{ else }} 15 | 16 | {{ end }} 17 | 18 | {{ i18n ( lower .Title | singularize) 1 }} 19 |

20 |
21 | 22 | 28 | 29 |
30 | 31 |
32 | 42 |
43 |
44 | {{ end }} 45 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dark-theme-editor", 3 | "version": "3.2.4", 4 | "description": "[![Example Site](https://github.com/JingWangTW/dark-theme-editor/actions/workflows/hugo.yml/badge.svg)](https://github.com/JingWangTW/dark-theme-editor/actions/workflows/hugo.yml)", 5 | "main": "index.js", 6 | "scripts": { 7 | "format:check": "prettier --check .", 8 | "format:write": "prettier --write .", 9 | "lint": "eslint . --ext .js,.json --quiet", 10 | "lint:fix": "eslint . --ext .js,.json --fix", 11 | "precommit": "lint-staged", 12 | "commit": "git-cz" 13 | }, 14 | "author": "Jing Wang", 15 | "license": "Apache 2.0", 16 | "devDependencies": { 17 | "commitlint": "^17.5.0", 18 | "eslint": "^8.36.0", 19 | "eslint-config-google": "^0.14.0", 20 | "eslint-plugin-json": "^3.1.0", 21 | "git-cz": "^4.9.0", 22 | "husky": "^8.0.3", 23 | "lint-staged": "^13.2.0", 24 | "prettier": "^2.8.5", 25 | "prettier-plugin-go-template": "^0.0.13" 26 | }, 27 | "husky": { 28 | "hooks": { 29 | "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", 30 | "pre-commit": "lint-staged" 31 | } 32 | }, 33 | "lint-staged": { 34 | "*.{js,json}": [ 35 | "prettier --write", 36 | "eslint --fix", 37 | "eslint" 38 | ], 39 | "*.{css,html}": [ 40 | "prettier --write" 41 | ] 42 | }, 43 | "commitlint": { 44 | "extends": [ 45 | "@commitlint/config-conventional" 46 | ] 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /layouts/partials/module/show_math.html: -------------------------------------------------------------------------------- 1 | 5 | 6 | {{ $trustedMath := false }} 7 | {{ if isset $.Params "trustedmath" }} 8 | 9 | {{ if $.Params.trustedmath }} 10 | {{ $trustedMath = . }} 11 | {{ end }} 12 | 13 | {{ else if isset $.Site.Params.page "trustedmath" }} 14 | 15 | {{ if $.Site.Params.page.trustedmath }} 16 | {{ $trustedMath = . }} 17 | {{ end }} 18 | 19 | {{ end }} 20 | 21 | 22 | 27 | 28 | 29 | 34 | 35 | 36 | 46 | 47 | 67 | -------------------------------------------------------------------------------- /.github/workflows/hugo.yml: -------------------------------------------------------------------------------- 1 | # Sample workflow for building and deploying a Hugo site to GitHub Pages 2 | name: Deploy example site to GitHub Pages 3 | 4 | on: 5 | # Triggers the workflow on push to any tags 6 | push: 7 | tags: 8 | - "*" 9 | 10 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 11 | permissions: 12 | contents: read 13 | pages: write 14 | id-token: write 15 | 16 | # Allow one concurrent deployment 17 | concurrency: 18 | group: "pages" 19 | cancel-in-progress: true 20 | 21 | # Default to bash 22 | defaults: 23 | run: 24 | shell: bash 25 | 26 | jobs: 27 | # Build job 28 | build: 29 | runs-on: ubuntu-latest 30 | env: 31 | HUGO_VERSION: 0.124.0 32 | steps: 33 | - name: Install Hugo CLI 34 | run: | 35 | wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ 36 | && sudo dpkg -i ${{ runner.temp }}/hugo.deb 37 | - name: Install Dart Sass Embedded 38 | run: sudo snap install dart-sass-embedded 39 | - name: Checkout 40 | uses: actions/checkout@v3 41 | with: 42 | submodules: recursive 43 | fetch-depth: 0 44 | ref: "example-site" 45 | - name: Setup Pages 46 | id: pages 47 | uses: actions/configure-pages@v3 48 | - name: Install Theme 49 | run: mkdir themes && cd themes && git clone https://github.com/JingWangTW/dark-theme-editor.git 50 | - name: Build with Hugo 51 | env: 52 | # For maximum backward compatibility with Hugo modules 53 | HUGO_ENVIRONMENT: production 54 | HUGO_ENV: production 55 | run: | 56 | hugo \ 57 | --minify \ 58 | --enableGitInfo \ 59 | --baseURL "${{ steps.pages.outputs.base_url }}/" 60 | - name: Upload static files as artifact 61 | id: deployment 62 | uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action 63 | with: 64 | path: ./public 65 | 66 | # Deployment job 67 | deploy: 68 | environment: 69 | name: github-pages 70 | url: ${{ steps.deployment.outputs.page_url }} 71 | runs-on: ubuntu-latest 72 | needs: build 73 | steps: 74 | - name: Deploy to GitHub Pages 75 | id: deployment 76 | uses: actions/deploy-pages@v4 77 | -------------------------------------------------------------------------------- /layouts/partials/module/section_tree.html: -------------------------------------------------------------------------------- 1 | {{ $context := .context }} 2 | {{ $currentPage := .currentPage }} 3 | 4 | {{ with $context }} 5 | {{ $page_children := where ( union .Sections .Pages ) "Kind" "page" }} 6 | {{ $section_children := where ( union .Sections .Pages ) "Kind" "!=" "page" }} 7 | 8 | {{ $sortBy := or .Site.Params.preference.sortBy "title" }} 9 | 10 | {{ $sortInAsc := true }} 11 | {{ if isset .Site.Params.preference "sortInAsc" }} 12 | {{ $sortInAsc = .Site.Params.preference.sortInAsc }} 13 | {{ end }} 14 | 15 | {{ if eq $sortBy "lastmod" }} 16 | {{ $page_children = $page_children.ByLastmod }} 17 | {{ $section_children = $section_children.ByLastmod }} 18 | {{ else if eq $sortBy "weight" }} 19 | {{ $page_children = $page_children.ByWeight }} 20 | {{ $section_children = $section_children.ByWeight }} 21 | {{ else if eq $sortBy "pubdate" }} 22 | {{ $page_children = $page_children.ByPublishDate }} 23 | {{ $section_children = $section_children.ByPublishDate }} 24 | {{ else if eq $sortBy "date" }} 25 | {{ $page_children = $page_children.ByDate }} 26 | {{ $section_children = $section_children.ByDate }} 27 | {{ else }} 28 | {{ $page_children = $page_children.ByTitle }} 29 | {{ $section_children = $section_children.ByTitle }} 30 | {{ end }} 31 | 32 | {{ if not $sortInAsc }} 33 | {{ $page_children = $page_children.Reverse }} 34 | {{ $section_children = $section_children.Reverse }} 35 | {{ end }} 36 | 37 | {{/* show page child first than section child */}} 38 | {{ $children := $section_children | append $page_children }} 39 | 40 | 41 | 67 | {{ end }} 68 | -------------------------------------------------------------------------------- /layouts/_default/home.html: -------------------------------------------------------------------------------- 1 | {{ define "main_article" }} 2 |
3 | {{ partial "module/sidebar_btn" . }} 4 | 5 | 6 |
7 |
8 | {{ with $.Site.Params.header.logo.imgUrl }} 9 | 10 | {{ end }} 11 | 12 | {{ with $.Site.Params.header.title }} 13 |

{{ . }}

14 | {{ end }} 15 | 16 | {{ with $.Site.Params.header.subtitle }} 17 |

18 | {{ . }} 19 |

20 | {{ end }} 21 |
22 |
23 |
24 |
25 | {{ with $.Site.Params.homePage.siteLongDescription }} 26 |

27 | {{ $.Site.Params.homePage.siteLongDescriptionTitle | default "Start" }} 28 |

29 |

30 | {{ . }} 31 |

32 | {{ end }} 33 |
34 |
35 | {{ with $.Site.Params.homePage.showRecentPostsBlock }} 36 |

37 | {{ i18n "recent_posts" | title }} 38 |

39 |
    40 | {{ range ( $.Site.RegularPages | first ($.Site.Params.homePage.numOfRecentPosts | default 5) ) }} 41 | {{ $page := . }} 42 |
  • 43 | {{ $page.Title }} 48 | {{ with $.Site.Params.homePage.recentPostShowUrl }} 49 | 52 | . 53 | {{ $page.RelPermalink }} 54 | 55 | {{ end }} 56 |
  • 57 | {{ end }} 58 |
59 | {{ end }} 60 |
61 |
62 | {{ if not $.Site.Params.homePage.disableWalkthroughs }} 63 |
64 |

65 | {{ i18n "walkthroughs" | title }} 66 |

67 | {{ partial "module/section_tree" ( dict "context" . "currentPage" . ) }} 68 |
69 | {{ end }} 70 |
71 |
72 |
73 | {{ end }} 74 | -------------------------------------------------------------------------------- /layouts/partials/html_footer.html: -------------------------------------------------------------------------------- 1 | 2 | {{ $script := slice }} 3 | 4 | {{/* Record all the JS file names, except the general files. */}} 5 | {{ $script_files_list := slice }} 6 | 7 | 8 | 9 | {{ $script = $script | append ( resources.Match "_theme/js/*.js" ) }} 10 | 11 | 12 | 13 | {{ with $.Site.Params.globalFrontmatter.externalJs }} 14 | {{ range $js_src := $.Site.Params.globalFrontmatter.externalJs }} 15 | {{ $script = $script | append (resources.GetRemote $js_src ) }} 16 | {{ $script_files_list = $script_files_list | append $js_src }} 17 | {{ end }} 18 | {{ end }} 19 | 20 | {{ with $.Site.Params.globalFrontmatter.localJs }} 21 | {{ range $js_src := $.Site.Params.globalFrontmatter.localJs }} 22 | {{ $script = $script | append (resources.Match $js_src ) }} 23 | {{ $script_files_list = $script_files_list | append $js_src }} 24 | {{ end }} 25 | {{ end }} 26 | 27 | 28 | 29 | {{ if isset $.Params "externaljs" }} 30 | {{ range $js_src := $.Params.externaljs }} 31 | {{ $script = $script | append (resources.GetRemote $js_src ) }} 32 | {{ $script_files_list = $script_files_list | append $js_src }} 33 | {{ end }} 34 | {{ end }} 35 | 36 | {{ if isset $.Params "localjs" }} 37 | {{ range $js_src := $.Params.localjs }} 38 | {{ $script = $script | append (resources.Match $js_src ) }} 39 | {{ $script_files_list = $script_files_list | append $js_src }} 40 | {{ end }} 41 | {{ end }} 42 | 43 | {{ if hugo.IsProduction }} 44 | 45 | {{/* Create a hash based on the file list, to determince different style file */}} 46 | {{ $hash:= substr (jsonify $script_files_list | md5) 0 7 }} 47 | 48 | 49 | 50 | {{ $script = $script | resources.Concat ( printf "js/index_%s.js" $hash ) | minify | resources.Fingerprint "sha512" }} 51 | 52 | 53 | 57 | {{ else }} 58 | {{ range $script }} 59 | {{ $currentScript := . | resources.Fingerprint "sha512" }} 60 | 64 | {{ end }} 65 | 66 | {{ end }} 67 | 68 | 69 | 70 | {{ $js_seprated := slice }} 71 | 72 | {{ if isset $.Params "externaljs" }} 73 | {{ range $js_src := $.Params.externaljs }} 74 | {{ $js_seprated = $js_seprated | append ($js_src ) }} 75 | {{ end }} 76 | {{ end }} 77 | 78 | {{ with $.Site.Params.globalFrontmatter.externalJs }} 79 | {{ range $js_src := $.Site.Params.globalFrontmatter.externalJs }} 80 | {{ $js_seprated = $js_seprated | append ( $js_src ) }} 81 | {{ end }} 82 | {{ end }} 83 | 84 | {{ range $js_seprated }} 85 | 86 | {{ end }} 87 | 88 | 89 | 90 | 93 | 94 | {{/* Include the mermaid script if needed */}} 95 | {{ if .Page.Store.Get "hasMermaid" }} 96 | 103 | {{ end }} 104 | -------------------------------------------------------------------------------- /layouts/partials/footer.html: -------------------------------------------------------------------------------- 1 | 118 | -------------------------------------------------------------------------------- /assets/_theme/js/sidebar.js: -------------------------------------------------------------------------------- 1 | let isSidebarExpand = false; 2 | let isSidebarShow = false; 3 | 4 | function isSidebarExpandStart() { 5 | isSidebarExpand = true; 6 | } 7 | 8 | function isSidebarExpandEnd() { 9 | isSidebarExpand = false; 10 | } 11 | 12 | function isSidebarExpanding(e) { 13 | if (!isSidebarExpand) return; 14 | 15 | const sidebarPercentage = (e.pageX / window.innerWidth) * 100; 16 | 17 | // limitation of sidebar width 18 | if (sidebarPercentage > 10 && sidebarPercentage < 50) { 19 | const articlePercentage = 100 - sidebarPercentage; 20 | 21 | document.querySelector( 22 | "aside.sidebar" 23 | ).style.width = `${sidebarPercentage}%`; 24 | 25 | const originWidth = getComputedStyle( 26 | document.querySelector("article.main") 27 | ).getPropertyValue("--artile_main_width"); 28 | 29 | const newWidth = originWidth.replace(/[\d.]+/, articlePercentage); 30 | 31 | document 32 | .querySelector("article.main") 33 | .style.setProperty("--artile_main_width", newWidth); 34 | } 35 | } 36 | 37 | function showSidebar() { 38 | document.querySelector("aside.sidebar").style.display = "block"; 39 | 40 | isSidebarShow = true; 41 | document 42 | .querySelector("button.sidebar-toggle-btn") 43 | .setAttribute("aria-expanded", "true"); 44 | } 45 | 46 | function hideSidebar() { 47 | if (isSidebarShow) { 48 | // remove the attribute instead, if set to "hudden", it would overwrite the rule in css. 49 | document.querySelector("aside.sidebar").style.display = ""; 50 | 51 | isSidebarShow = false; 52 | document 53 | .querySelector("button.sidebar-toggle-btn") 54 | .setAttribute("aria-expanded", "false"); 55 | } 56 | } 57 | 58 | window.addEventListener("load", function () { 59 | // sidebar expanble 60 | document 61 | .querySelector("aside.exapandable") 62 | .addEventListener("mousedown", isSidebarExpandStart); 63 | document 64 | .querySelector("aside.exapandable") 65 | .addEventListener("touchstart", isSidebarExpandStart); 66 | window.addEventListener("mousemove", isSidebarExpanding); 67 | window.addEventListener("touchmove", isSidebarExpanding); 68 | window.addEventListener("mouseup", isSidebarExpandEnd); 69 | window.addEventListener("touchend", isSidebarExpandEnd); 70 | 71 | // responsive sidebar 72 | document 73 | .querySelector("button.sidebar-toggle-btn") 74 | .addEventListener("click", (event) => { 75 | event.stopPropagation(); 76 | event.preventDefault(); 77 | 78 | if (event.currentTarget.getAttribute("aria-expanded") === "true") { 79 | hideSidebar(); 80 | } else { 81 | showSidebar(); 82 | } 83 | }); 84 | 85 | // hides sidebar when not focus 86 | this.document 87 | .querySelector("article.main") 88 | .addEventListener("click", hideSidebar); 89 | this.document 90 | .querySelector("article.main") 91 | .addEventListener("touchstart", hideSidebar); 92 | this.document 93 | .querySelector("article.main") 94 | .addEventListener("mousedown", hideSidebar); 95 | 96 | // remove generated element style when windows enlarge 97 | this.window.addEventListener("resize", () => { 98 | if (window.innerWidth > 900) { 99 | isSidebarShow = false; 100 | 101 | document.querySelector("aside.sidebar").style.display = ""; 102 | document 103 | .querySelector("button.sidebar-toggle-btn") 104 | .setAttribute("aria-expanded", "false"); 105 | } 106 | }); 107 | 108 | // re-calculate the width when resizing the window 109 | this.window.addEventListener("resize", () => { 110 | let artileElement = document.querySelector("article.main"); 111 | 112 | // get the currently configured width 113 | const widthProperty = artileElement.style.getPropertyValue( 114 | "--artile_main_width" 115 | ); 116 | 117 | if (widthProperty) { 118 | // find the width set currently 119 | const sidebarPercentage = widthProperty.match(/[\d.]+/)[0]; 120 | 121 | // reset the width 122 | artileElement.style.setProperty("--artile_main_width", ""); 123 | 124 | // to find out the width set by the stylesheet 125 | const appliedSWidthStyle = getComputedStyle(artileElement) 126 | .getPropertyValue("--artile_main_width") 127 | .replace(/[\d.]+/, sidebarPercentage); 128 | 129 | // add the width setting set by the user 130 | artileElement.style.setProperty( 131 | "--artile_main_width", 132 | appliedSWidthStyle 133 | ); 134 | } 135 | }); 136 | }); 137 | -------------------------------------------------------------------------------- /assets/_theme/css/04_responsive.css: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * This file add the support of the style.css 3 | *******************************************************************************************/ 4 | @charset "UTF-8"; 5 | 6 | @media only screen and (max-width: 900px) { 7 | :root { 8 | /* 9 | 8vw:
padding 10 | 1px: dummpy 11 | */ 12 | 13 | --artile_main_width: calc(100% - 8vw - 1px); 14 | } 15 | 16 | /* release the static layout*/ 17 | body { 18 | height: 100%; 19 | max-height: 100%; 20 | overflow-y: auto; 21 | } 22 | 23 | /* sticky header */ 24 | header { 25 | height: 6vh; 26 | position: sticky; 27 | top: 0px; 28 | width: 100%; 29 | font-size: 10pt; 30 | background-color: #282c34; 31 | text-overflow: ellipsis; 32 | overflow: hidden; 33 | } 34 | 35 | header > div { 36 | line-height: 6vh; 37 | } 38 | 39 | /* remove the sidebar */ 40 | aside:where(.exapandable, .sidebar) { 41 | display: none; 42 | } 43 | 44 | /* Slide sidebar */ 45 | main:has(article.main > button.sidebar-toggle-btn[aria-expanded="true"]) { 46 | width: 130%; 47 | 48 | animation: slide-in 0.5s forwards; 49 | transform: translateX(calc(-20%)); 50 | } 51 | 52 | aside.sidebar { 53 | width: 30%; 54 | border-right: 3pt solid rgb(59, 59, 59); 55 | } 56 | 57 | /* Add some padding */ 58 | article.main { 59 | padding: 4vw; 60 | 61 | /* 62 | 6vh: header 63 | 6vh: footer 64 | 8vw:
padding 65 | 2pt: border of header and footer 66 | 12px: padding in footer 67 | */ 68 | min-height: calc(100vh - 6vh - 6vh - 8vw - 2pt - 12px); 69 | } 70 | 71 | /* show the navbar button */ 72 | article.main > button.sidebar-toggle-btn { 73 | background-color: #282c34; 74 | border: 1px solid grey; 75 | border-radius: 20%; 76 | padding: 0.2em; 77 | color: #c6c6c7; 78 | font-size: 22pt; 79 | line-height: 0.6em; 80 | display: block; 81 | position: fixed; 82 | top: 20px; 83 | right: 10px; 84 | cursor: pointer; 85 | } 86 | 87 | article.main > button.sidebar-toggle-btn:where(:hover, :active, :focus) { 88 | color: white; 89 | border-color: white; 90 | border-width: 2px; 91 | } 92 | 93 | /* move the position of article information */ 94 | article.main > div.title { 95 | flex-direction: column; 96 | } 97 | 98 | article.main > div.title > div.author-date-readtime { 99 | flex-direction: row; 100 | } 101 | 102 | article.main > div.title > div.author-date-readtime > div { 103 | padding-top: 0; 104 | padding-right: 2em; 105 | } 106 | 107 | article.main > div.article-meta { 108 | margin-top: 0.2em; 109 | } 110 | 111 | /* re-layout the footer */ 112 | footer { 113 | height: 6vh; 114 | font-size: 14pt; 115 | padding-top: 6px; 116 | padding-bottom: 6px; 117 | } 118 | 119 | footer > div > ul { 120 | flex-wrap: wrap; 121 | } 122 | 123 | footer > div.footer-left { 124 | min-width: 60%; 125 | max-width: 100%; 126 | } 127 | 128 | footer > div.footer-right { 129 | display: none; 130 | } 131 | } 132 | 133 | @media only screen and (max-width: 700px) { 134 | /* Slide sidebar */ 135 | main:has(article.main > button.sidebar-toggle-btn[aria-expanded="true"]) { 136 | width: 150%; 137 | } 138 | 139 | aside.sidebar { 140 | width: 50%; 141 | } 142 | } 143 | 144 | @media only screen and (max-width: 440px) { 145 | :root { 146 | /* 147 | 12vw:
padding 148 | 1px: dummpy 149 | */ 150 | 151 | --artile_main_width: calc(100% - 12vw - 1px); 152 | } 153 | 154 | /* Slide sidebar */ 155 | main:has(article.main > button.sidebar-toggle-btn[aria-expanded="true"]) { 156 | width: 180%; 157 | } 158 | 159 | aside.sidebar { 160 | width: 80%; 161 | } 162 | 163 | /* Add some padding */ 164 | article.main { 165 | padding: 6vw; 166 | 167 | /* 168 | 6vh: header 169 | 6vh: footer 170 | 12vw:
padding 171 | 2pt: border of header and footer 172 | 12px: padding in footer 173 | */ 174 | min-height: calc(100vh - 6vh - 6vh - 12vw - 2pt - 12px); 175 | } 176 | 177 | /* move the position of article information */ 178 | article.main > div.title > div.author-date-readtime { 179 | align-items: flex-start; 180 | flex-direction: column; 181 | } 182 | 183 | article.main > div.title > div.author-date-readtime > div { 184 | padding-top: 1em; 185 | } 186 | 187 | /* re-layout the footer */ 188 | footer { 189 | font-size: 12pt; 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{ define "main_article" }} 2 |
3 | {{ partial "module/sidebar_btn" . }} 4 | 5 | 6 |
7 |

8 | {{ .Title }} 9 |

10 | 11 | 59 |
60 | 61 | 108 | 109 | {{ if isset $.Params "includetoc" }} 110 | {{ if $.Params.includetoc }} 111 | {{ .TableOfContents }} 112 | {{ end }} 113 | 114 | {{ else if $.Site.Params.page.includeToc }} 115 | {{ .TableOfContents }} 116 | {{ end }} 117 | 118 | 119 |
120 | {{ if .Content }} 121 | {{ .Content }} 122 | {{ else }} 123 |

124 | {{ i18n "empty_page" | strings.FirstUpper }} 125 |

126 | {{ end }} 127 |
128 |
129 | {{ end }} 130 | -------------------------------------------------------------------------------- /assets/_theme/css/03_home.css: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * This files contain the stlying used in the > 3 | * In other words, this file is used to style the content on the homepage only. 4 | *******************************************************************************************/ 5 | 6 | /******************* 7 | * Layout 8 | *******************/ 9 | article.main:has(> div.home) { 10 | padding: 8vh 20vw; 11 | 12 | /* 13 | 3%: header 14 | 3%: footer 15 | 16vh:
padding 16 | 2pt: border of header and footer 17 | */ 18 | min-height: calc(100vh - 3% - 3% - 16vh - 2pt); 19 | 20 | /* 21 | 3pt: expand bar 22 | 40vw:
padding 23 | 1px: dummpy 24 | */ 25 | --artile_main_width: calc(85% - 3pt - 40vw - 1px); 26 | } 27 | 28 | article.main > div.home { 29 | height: 100%; 30 | } 31 | 32 | article.main > div.home > div.recommend { 33 | display: flex; 34 | margin-top: 18pt; 35 | } 36 | 37 | article.main > div.home > div.recommend > div:where(.left, .right) { 38 | flex: 1 1 100%; 39 | width: 50%; 40 | } 41 | 42 | @media only screen and (max-width: 1400px) { 43 | article.main:has(> div.home) { 44 | padding: 8vh 10vw; 45 | 46 | /* 47 | 3pt: expand bar 48 | 20vw:
padding 49 | 1px: dummpy 50 | */ 51 | --artile_main_width: calc(85% - 3pt - 20vw - 1px); 52 | } 53 | } 54 | 55 | @media only screen and (max-width: 900px) { 56 | article.main:has(> div.home) { 57 | padding: 8vh 5vw; 58 | 59 | /* 60 | 6vh: header 61 | 6vh: footer 62 | 12px: padding in footer 63 | 16vh:
padding 64 | 2pt: border of header and footer 65 | */ 66 | min-height: calc(100vh - 6vh - 6vh - 12px - 16vh - 2pt); 67 | 68 | /* 69 | 3pt: expand bar 70 | 10vw:
padding 71 | 1px: dummpy 72 | */ 73 | --artile_main_width: calc(85% - 3pt - 10vw - 1px); 74 | } 75 | } 76 | 77 | @media only screen and (max-width: 700px) { 78 | article.main:has(> div.home) { 79 | padding: 5vh 5vw; 80 | 81 | /* 82 | 6vh: header 83 | 6vh: footer 84 | 12px: padding in footer 85 | 10vh:
padding 86 | 2pt: border of header and footer 87 | */ 88 | min-height: calc(100vh - 6vh - 6vh - 12px - 10vh - 2pt); 89 | } 90 | } 91 | 92 | /******************* 93 | * Styling 94 | *******************/ 95 | 96 | /* Title */ 97 | article.main > div.home > div.title > h1.title-caption { 98 | font-weight: 400; 99 | font-size: 2.2em; 100 | white-space: nowrap; 101 | margin-bottom: 16pt; 102 | color: floralwhite; 103 | } 104 | 105 | article.main > div.home > div.title > h2.subtitle { 106 | font-size: 1.6em; 107 | line-height: 1.4em; 108 | white-space: nowrap; 109 | } 110 | 111 | /* Recommend */ 112 | article.main 113 | > div.home 114 | > div.recommend 115 | > div:where(.left, .right) 116 | h3.recommend-title { 117 | font-size: 1.4em; 118 | line-height: 1.4em; 119 | white-space: nowrap; 120 | margin-top: 8pt; 121 | margin-bottom: 8pt; 122 | color: floralwhite; 123 | } 124 | 125 | article.main > div.home > div.recommend > div.left { 126 | padding-right: 25pt; 127 | } 128 | 129 | article.main > div.home > div.recommend > div.right { 130 | padding-left: 25pt; 131 | } 132 | 133 | /* Start */ 134 | article.main > div.home > div.recommend > div.left > div.start { 135 | margin-bottom: 16pt; 136 | } 137 | 138 | article.main 139 | > div.home 140 | > div.recommend 141 | > div.left 142 | > div.start 143 | > p.long-description { 144 | line-height: 1.6em; 145 | font-size: 90%; 146 | text-align: justify; 147 | } 148 | 149 | /* Recent Posts */ 150 | article.main 151 | > div.home 152 | > div.recommend 153 | > div.left 154 | > div.recent 155 | > ul.recent-posts-list 156 | > li { 157 | line-height: 1.6em; 158 | font-size: 95%; 159 | color: #80cbc4; 160 | } 161 | 162 | article.main 163 | > div.home 164 | > div.recommend 165 | > div.left 166 | > div.recent 167 | > ul.recent-posts-list 168 | > li:hover { 169 | line-height: 1.6em; 170 | font-size: 95%; 171 | color: #eeffff; 172 | } 173 | 174 | article.main 175 | > div.home 176 | > div.recommend 177 | > div.left 178 | > div.recent 179 | > ul.recent-posts-list 180 | > li 181 | > span.recent-posts-items-path { 182 | font-size: 90%; 183 | color: #eeffff; 184 | padding-left: 1em; 185 | } 186 | 187 | /* Section Tree in Walkthorughs */ 188 | article.main > div.home > div.recommend > div.right > ul.section-tree > li { 189 | padding-left: 0; 190 | } 191 | 192 | article.main 193 | > div.home 194 | > div.recommend 195 | > div.right 196 | > ul.section-tree 197 | > li:first-child { 198 | padding-top: 0; 199 | } 200 | article.main > div.home > div.recommend > div.right ul.section-tree > li.file { 201 | margin-top: 6pt; 202 | } 203 | 204 | article.main > div.home > div.recommend > div.right ul.section-tree > li > a { 205 | padding: 2pt 4pt; 206 | border-radius: 5pt; 207 | } 208 | 209 | article.main 210 | > div.home 211 | > div.recommend 212 | > div.right 213 | ul.section-tree 214 | > li 215 | > a:hover { 216 | background-color: #3a3939; 217 | color: #c9c9c9 !important; 218 | } 219 | 220 | /******************* 221 | * Responsive Styling 222 | *******************/ 223 | @media only screen and (max-width: 640px) { 224 | article.main > div.home > div.recommend { 225 | flex-wrap: wrap; 226 | } 227 | 228 | article.main > div.home > div.recommend > div.left, 229 | article.main > div.home > div.recommend > div.right { 230 | width: 100%; 231 | padding-right: 0; 232 | padding-left: 0; 233 | } 234 | 235 | article.main > div.home > div.recommend > div:where(.left, .right) > div { 236 | margin-bottom: 16pt; 237 | } 238 | } 239 | -------------------------------------------------------------------------------- /layouts/partials/html_head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{ hugo.Generator }} 7 | 8 | {{ with $.Site.Params.site.googleVerification }} 9 | 10 | {{ end }} 11 | 12 | {{ with $.Site.Params.site.bingVerifivation }} 13 | 14 | {{ end }} 15 | 16 | {{ if $.IsPage }} 17 | {{ if isset $.Params "description" }} 18 | 19 | {{ else if isset $.Site.Params.globalFrontmatter "description" }} 20 | 23 | {{ end }} 24 | 25 | {{ if isset $.Params "keywords" }} 26 | 27 | {{ else if isset $.Site.Params.globalFrontmatter "keywords" }} 28 | 31 | {{ end }} 32 | 33 | {{ if isset $.Params "author" }} 34 | 35 | {{ else if isset $.Site.Params.globalFrontmatter "author" }} 36 | 39 | {{ end }} 40 | 41 | {{ else }} 42 | {{ with $.Site.Params.globalFrontmatter.description }} 43 | 44 | {{ end }} 45 | 46 | {{ with $.Site.Params.globalFrontmatter.author }} 47 | 48 | {{ end }} 49 | 50 | {{ end }} 51 | 52 | 53 | 54 | {{ if .IsHome }} 55 | {{ $.Site.Params.header.title }} 56 | {{ else }} 57 | {{ $.Page.Title }} | 58 | {{ $.Site.Params.header.title }} 59 | {{ end }} 60 | 61 | 62 | {{ with $.Site.Params.site.faviconUrl }} 63 | 64 | {{ end }} 65 | 66 | 67 | 68 | {{ $style := slice }} 69 | 70 | {{/* Record all the css file names, except the general files. */}} 71 | {{ $style_files_list := slice }} 72 | 73 | 74 | 75 | {{ $style = $style | append ( resources.GetRemote "https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css" ) }} 76 | 77 | 78 | 79 | {{ $style = $style | append ( resources.Match "_theme/css/*.css" ) }} 80 | 81 | 82 | 83 | {{ if isset $.Params "localcss" }} 84 | {{ range $css_src := $.Params.localcss }} 85 | {{ $style = $style | append ( resources.Match $css_src ) }} 86 | {{ $style_files_list = $style_files_list | append $css_src }} 87 | {{ end }} 88 | {{ end }} 89 | 90 | {{ if isset $.Params "externalcssdownload" }} 91 | {{ range $css_src := $.Params.externalcssdownload }} 92 | {{ $style = $style | append ( resources.GetRemote $css_src ) }} 93 | {{ $style_files_list = $style_files_list | append $css_src }} 94 | {{ end }} 95 | {{ end }} 96 | 97 | 98 | 99 | {{ with $.Site.Params.globalFrontmatter.localCss }} 100 | {{ range $css_src := $.Site.Params.globalFrontmatter.localCss }} 101 | {{ $style = $style | append ( resources.Match $css_src ) }} 102 | {{ $style_files_list = $style_files_list | append $css_src }} 103 | {{ end }} 104 | {{ end }} 105 | 106 | {{ with $.Site.Params.globalFrontmatter.externalCssDownload }} 107 | {{ range $css_src := $.Site.Params.globalFrontmatter.externalCssDownload }} 108 | {{ $style = $style | append ( resources.GetRemote $css_src ) }} 109 | {{ $style_files_list = $style_files_list | append $css_src }} 110 | {{ end }} 111 | {{ end }} 112 | 113 | {{ if hugo.IsProduction }} 114 | 115 | {{/* Create a hash based on the file list, to determince different style file */}} 116 | {{ $hash:= substr (jsonify $style_files_list | md5) 0 7 }} 117 | 118 | 119 | 120 | {{ $style = $style | resources.Concat ( printf "css/index_%s.css" $hash ) | minify | resources.Fingerprint "sha512" }} 121 | 122 | 123 | 127 | {{ else }} 128 | 129 | {{ range $style }} 130 | {{ $currentStyle := . | resources.Fingerprint "sha512" }} 131 | 135 | {{ end }} 136 | 137 | {{ end }} 138 | 139 | 140 | 141 | {{ $style_seprated := slice }} 142 | 143 | {{ if isset $.Params "externalcss" }} 144 | {{ range $css_src := $.Params.externalcss }} 145 | {{ $style_seprated = $style_seprated | append ($css_src ) }} 146 | {{ end }} 147 | {{ end }} 148 | 149 | {{ with $.Site.Params.globalFrontmatter.externalCss }} 150 | {{ range $css_src := $.Site.Params.globalFrontmatter.externalCss }} 151 | {{ $style_seprated = $style_seprated | append ( $css_src ) }} 152 | {{ end }} 153 | {{ end }} 154 | 155 | {{ range $style_seprated }} 156 | 157 | {{ end }} 158 | 159 | {{ if isset $.Params "usemath" }} 160 | 161 | {{ if $.Params.usemath }} 162 | {{ partial "module/show_math" . }} 163 | {{ end }} 164 | 165 | {{ else if isset $.Site.Params.globalFrontmatter "useMath" }} 166 | 167 | {{ if $.Site.Params.globalFrontmatter.useMath }} 168 | {{ partial "module/show_math" . }} 169 | {{ end }} 170 | 171 | {{ end }} 172 | 173 | -------------------------------------------------------------------------------- /assets/_theme/css/05_markdown.css: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * This files contain the stlying used in the > 3 | * In other words, this file used to styling the content generated from markdown. 4 | *******************************************************************************************/ 5 | 6 | @charset "UTF-8"; 7 | 8 | /************** 9 | General 10 | ***************/ 11 | article.main > div.content * { 12 | line-height: 22pt; 13 | color: #e6edf3; 14 | } 15 | 16 | article.main > div.content > :first-child { 17 | margin-top: 24pt; 18 | } 19 | 20 | /************** 21 | Header 22 | ***************/ 23 | article.main > div.content :where(h1, h2, h3, h4, h5, h6) { 24 | margin-top: 24pt; 25 | margin-bottom: 16pt; 26 | font-weight: bold; 27 | } 28 | 29 | article.main > div.content :where(h1, h2) { 30 | padding-bottom: 15pt; 31 | border-bottom: 1px solid #5c5e60; 32 | } 33 | 34 | article.main > div.content h1 { 35 | font-size: 2em; 36 | } 37 | 38 | article.main > div.content h2 { 39 | font-size: 1.6rem; 40 | } 41 | 42 | article.main > div.content h3 { 43 | font-size: 1.4rem; 44 | } 45 | 46 | /************** 47 | Paragraph 48 | ***************/ 49 | article.main > div.content p { 50 | text-align: justify; 51 | margin-top: 0.5em; 52 | margin-bottom: 0.5em; 53 | } 54 | 55 | article.main > div.content p + p { 56 | margin-top: 1.4em; 57 | } 58 | 59 | /************** 60 | Anchor 61 | ***************/ 62 | article.main > div.content a { 63 | color: #4398e5; 64 | } 65 | 66 | article.main > div.content a:hover { 67 | color: #7fb8ee; 68 | text-decoration: underline; 69 | } 70 | 71 | /************** 72 | List 73 | ***************/ 74 | article.main > div.content ul { 75 | display: block; 76 | list-style-type: disc; 77 | padding-inline-start: 20px; 78 | padding-left: 2em; 79 | } 80 | 81 | article.main > div.content ul ul { 82 | list-style-type: circle; 83 | } 84 | 85 | article.main > div.content ul ul ul { 86 | list-style-type: square; 87 | } 88 | 89 | article.main > div.content ol { 90 | display: block; 91 | list-style-type: decimal; 92 | padding-inline-start: 20px; 93 | padding-left: 2em; 94 | } 95 | 96 | article.main > div.content li { 97 | margin: 6pt 0pt; 98 | } 99 | 100 | article.main > div.content li li { 101 | margin: 4pt 0pt; 102 | } 103 | 104 | article.main > div.content li li li { 105 | margin: 2pt 0pt; 106 | } 107 | 108 | /************** 109 | Image 110 | ***************/ 111 | article.main > div.content img { 112 | height: auto; 113 | width: 100%; 114 | } 115 | 116 | /************** 117 | Font 118 | ***************/ 119 | article.main > div.content em { 120 | font-style: italic; 121 | } 122 | 123 | article.main > div.content strong { 124 | font-weight: bold; 125 | font-size: 106%; 126 | color: white; 127 | } 128 | 129 | article.main > div.content del { 130 | text-decoration: line-through; 131 | } 132 | 133 | /************** 134 | Rule 135 | ***************/ 136 | article.main > div.content hr { 137 | height: 0.1em; 138 | background-color: #525252; 139 | margin: 12pt 0; 140 | padding: 0; 141 | border: 0; 142 | } 143 | 144 | /************** 145 | Table 146 | ***************/ 147 | article.main > div.content table { 148 | display: block; 149 | max-width: 100%; 150 | overflow: auto; 151 | margin: 16pt 0pt; 152 | } 153 | 154 | article.main > div.content :where(h1, h2, h3, h4, h5, h6) + table { 155 | margin-top: 0; 156 | } 157 | 158 | article.main > div.content table tr { 159 | border-bottom: 1px solid #726f6f; 160 | } 161 | 162 | article.main > div.content table th { 163 | font-weight: bold; 164 | font-size: 106%; 165 | } 166 | 167 | article.main > div.content table :where(th, td) { 168 | padding: 0.8em 1.4em; 169 | } 170 | 171 | article.main > div.content table > thead > tr:last-child { 172 | border-bottom-style: double; 173 | border-bottom-width: 4px; 174 | } 175 | 176 | article.main > div.content table > tbody > tr:last-child { 177 | border-bottom: none; 178 | } 179 | 180 | article.main > div.content table > tbody > tr:nth-child(2n) { 181 | background-color: #202020; 182 | } 183 | 184 | /************** 185 | Code Block 186 | ***************/ 187 | 188 | /*** small code span ***/ 189 | article.main > div.content :where(pre, code) { 190 | font-family: Menlo, Monaco, Consolas, "Courier New", monospace; 191 | } 192 | 193 | article.main > div.content code:not(div.highlight code) { 194 | padding: 0.2em 0.4em; 195 | font-size: 85%; 196 | background-color: rgb(92 92 92); 197 | border-radius: 5pt; 198 | margin-left: 0.2em; 199 | margin-right: 0.2em; 200 | } 201 | 202 | /*** Code block indented with four spaces ***/ 203 | article.main > div.content pre:not(div.highlight pre) { 204 | border-radius: 10px; 205 | padding: 1em; 206 | overflow: auto; 207 | background-color: #202020; 208 | } 209 | 210 | article.main > div.content pre:not(div.highlight pre) > code { 211 | border: none; 212 | padding: 0; 213 | font-size: 100%; 214 | background-color: transparent; 215 | } 216 | 217 | /*** Highlight Codeblock ***/ 218 | article.main > div.content div.codeblock { 219 | margin-top: -2em; 220 | } 221 | article.main > div.content div.codeblock > div.copy-button-box { 222 | display: inline-flex; 223 | position: relative; 224 | top: 2.6em; 225 | width: 100%; 226 | justify-content: flex-end; 227 | } 228 | 229 | article.main 230 | > div.content 231 | div.codeblock 232 | > div.copy-button-box 233 | > button.copy-button { 234 | height: 2.5em; 235 | color: rgba(238, 255, 255, 0.4); 236 | background-color: transparent; 237 | border: rgba(238, 255, 255, 0.4) solid 1pt; 238 | border-radius: 10%; 239 | margin-right: 0.5em; 240 | cursor: pointer; 241 | padding-left: 0.7em; 242 | padding-right: 0.7em; 243 | font-size: 14px; 244 | } 245 | 246 | article.main 247 | > div.content 248 | div.codeblock 249 | > div.copy-button-box 250 | > button.copy-button:hover { 251 | color: #eeffff; 252 | border-color: #eeffff; 253 | } 254 | 255 | article.main 256 | > div.content 257 | div.codeblock 258 | > div.copy-button-box 259 | > button.copy-button[state="copied"] { 260 | > i { 261 | color: green; 262 | } 263 | border-color: green; 264 | padding-top: 3px; 265 | } 266 | 267 | /* pre for cases where line numbers are not set to be displayed. */ 268 | article.main > div.content div.codeblock > div.highlight :where(pre, div) { 269 | border-radius: 10pt; 270 | padding-top: 0.5em; 271 | padding-bottom: 0.5em; 272 | } 273 | 274 | article.main > div.content div.codeblock > div.highlight pre { 275 | padding-left: 0.6em; 276 | } 277 | 278 | article.main > div.content div.codeblock > div.highlight code { 279 | background: none; 280 | border-radius: 0; 281 | } 282 | 283 | article.main > div.content div.codeblock > div.highlight table { 284 | padding: 5pt !important; 285 | overflow-y: hidden !important; 286 | } 287 | 288 | article.main > div.content div.codeblock > div.highlight table tr { 289 | border: none; 290 | } 291 | 292 | /************** 293 | Blockquote 294 | ***************/ 295 | article.main > div.content blockquote { 296 | padding: 0.6pt 1em; 297 | border-left: 3px solid #727272; 298 | border-radius: 10px; 299 | background-color: #454545; 300 | margin-top: 2em; 301 | margin-bottom: 2em; 302 | margin-left: 1em; 303 | font-size: 15px; 304 | } 305 | 306 | article.main > div.content blockquote blockquote { 307 | margin-top: 0; 308 | margin-bottom: 0; 309 | border-radius: 6px; 310 | margin-left: 12px; 311 | } 312 | 313 | article.main > div.content blockquote p { 314 | padding-top: 0.2em; 315 | padding-bottom: 0.2em; 316 | font-style: italic; 317 | } 318 | 319 | article.main > div.content blockquote p + p { 320 | margin-top: 0.5em; 321 | } 322 | 323 | article.main > div.content blockquote blockquote p { 324 | padding-top: 0.1em; 325 | margin-top: 0.5em; 326 | } 327 | 328 | /************** 329 | Description 330 | ***************/ 331 | article.main > div.content dt { 332 | font-weight: bold; 333 | font-size: 106%; 334 | color: #c8c8c8; 335 | } 336 | 337 | article.main > div.content dd { 338 | margin-bottom: 1em; 339 | margin-left: 0.5em; 340 | } 341 | 342 | /************** 343 | Super/sub script 344 | ***************/ 345 | article.main > div.content sup { 346 | vertical-align: super; 347 | font-size: 80%; 348 | } 349 | 350 | article.main > div.content sub { 351 | vertical-align: sub; 352 | font-size: 80%; 353 | } 354 | 355 | /************** 356 | Footnote 357 | ***************/ 358 | article.main > div.content div.footnotes :where(p, p + p) { 359 | margin: 0; 360 | } 361 | 362 | /************** 363 | Scrollbar 364 | ***************/ 365 | :where(article.main, article.main *)::-webkit-scrollbar { 366 | width: 8px; 367 | height: 8px; 368 | background-color: rgb(95, 94, 94); 369 | } 370 | 371 | :where(article.main, article.main *)::-webkit-scrollbar-thumb { 372 | background: rgb(139, 139, 139); 373 | border-radius: 10pt; 374 | } 375 | -------------------------------------------------------------------------------- /assets/_theme/css/02_style.css: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * This file contains all the styling for the site. 3 | *******************************************************************************************/ 4 | @charset "UTF-8"; 5 | 6 | /*** Element Styling ***/ 7 | a, 8 | a:link, 9 | a:visited, 10 | a:hover, 11 | a:active { 12 | text-decoration: none; 13 | color: inherit; 14 | } 15 | 16 | em { 17 | font-style: italic; 18 | } 19 | 20 | /*** HTML Body ***/ 21 | body { 22 | background-color: #282c34; 23 | font-size: 16px; 24 | font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", 25 | Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", 26 | "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; 27 | overflow: hidden; 28 | } 29 | 30 | /*** Header ***/ 31 | header { 32 | font-size: 8pt; 33 | color: white; 34 | border-bottom: 1pt solid rgb(59, 59, 59); 35 | } 36 | 37 | header > div { 38 | vertical-align: middle; 39 | text-align: center; 40 | line-height: 3vh; 41 | height: 100%; 42 | } 43 | 44 | header > div.header_left { 45 | float: left; 46 | position: relative; 47 | left: 5pt; 48 | top: 0pt; 49 | } 50 | 51 | header > div.header_left > img.logo { 52 | height: 100%; 53 | } 54 | 55 | /*** sidebar ***/ 56 | aside.exapandable { 57 | width: 3pt; 58 | background-color: rgb(59, 59, 59); 59 | cursor: col-resize; 60 | } 61 | 62 | aside.exapandable:hover { 63 | background-color: rgb(99, 99, 99); 64 | } 65 | 66 | /*** main content ***/ 67 | article.main { 68 | text-align: left; 69 | color: #eeffff; 70 | padding: 2%; 71 | overflow-y: auto; 72 | } 73 | 74 | article.main > button.sidebar-toggle-btn { 75 | display: none; 76 | } 77 | 78 | article.main > div.title { 79 | display: flex; 80 | justify-content: space-between; 81 | padding-bottom: 15pt; 82 | } 83 | 84 | article.main > div.title > h1.title-header { 85 | flex: 0 0 auto; 86 | color: #e0e5e5; 87 | font-size: 2rem; 88 | font-weight: bold; 89 | margin-bottom: 0.5rem; 90 | } 91 | 92 | article.main > div.title > div.author-date-readtime { 93 | flex: 0 0 auto; 94 | display: flex; 95 | flex-direction: column; 96 | align-items: flex-end; 97 | font-size: 0.9rem; 98 | color: #939bab; 99 | } 100 | 101 | article.main > div.title > div.author-date-readtime > div:not(:first-child) { 102 | padding-top: 1em; 103 | } 104 | 105 | article.main > div.title > div.author-date-readtime > div.author:hover { 106 | color: white; 107 | } 108 | 109 | article.main > div.article-meta { 110 | color: #939bab; 111 | font-size: 1rem; 112 | margin-top: -2em; 113 | } 114 | 115 | article.main > div.article-meta a { 116 | padding: 2pt 10pt; 117 | margin: 0pt 5pt; 118 | border-radius: 10px; 119 | color: #ffffff; 120 | } 121 | 122 | article.main > hr { 123 | border-color: #5c5e60; 124 | border-width: 1pt; 125 | margin-bottom: 25pt; 126 | } 127 | 128 | article.main > div.article-meta > div:only-child { 129 | padding-top: 20pt; 130 | } 131 | 132 | article.main > div.article-meta > div.categories > a.cat-btn { 133 | background: #2f5292; 134 | } 135 | 136 | article.main > div.article-meta > div.categories > a.cat-btn:hover { 137 | background: #5779b9; 138 | } 139 | 140 | article.main > div.article-meta > div.tags > a.tag-btn { 141 | background: #327e5e; 142 | } 143 | 144 | article.main > div.article-meta > div.tags > a.tag-btn:hover { 145 | background: #479775; 146 | } 147 | 148 | article.main > div.article-meta > div:where(.categories, .tags) > a { 149 | line-height: 2.8em; 150 | } 151 | 152 | article.main > div.article-meta > div:where(.breadcumb, .translation) > a { 153 | color: #99a1ff; 154 | padding-left: 5pt; 155 | padding-right: 5pt; 156 | line-height: 2.5em; 157 | } 158 | 159 | /* first of a will contain the current present language */ 160 | article.main > div.article-meta > div.translation > a:first-of-type { 161 | color: #c6c6c7; 162 | } 163 | 164 | article.main > nav#TableOfContents { 165 | margin-bottom: 20pt; 166 | } 167 | 168 | article.main > nav#TableOfContents ul { 169 | display: block; 170 | list-style-type: disc; 171 | padding-inline-start: 20px; 172 | } 173 | 174 | article.main > nav#TableOfContents ul ul { 175 | list-style-type: circle; 176 | } 177 | 178 | article.main > nav#TableOfContents ul ul ul { 179 | list-style-type: square; 180 | } 181 | 182 | article.main > nav#TableOfContents li { 183 | margin: 8pt 0pt; 184 | } 185 | 186 | article.main > nav#TableOfContents a { 187 | color: #4398e5; 188 | } 189 | 190 | article.main > nav#TableOfContents a:hover { 191 | color: #7fb8ee; 192 | text-decoration: underline; 193 | } 194 | 195 | article.main > div.list-files ul.section-tree { 196 | font-size: 14pt; 197 | } 198 | 199 | article.main > div.list-files ul.section-tree > li { 200 | line-height: 140%; 201 | padding-left: 5pt; 202 | } 203 | 204 | article.main > div.list-files ul.section-tree > li.file { 205 | font-size: 12pt; 206 | } 207 | 208 | article.main > div.list-files > ul.section-tree > li.file:hover { 209 | color: white; 210 | } 211 | 212 | article.main > div.list-terms > ul { 213 | display: flex; 214 | flex-wrap: wrap; 215 | } 216 | 217 | article.main > div.list-terms > ul > li { 218 | border: 1px solid #6c6d6e; 219 | border-radius: 30px; 220 | padding: 0.5em 1em; 221 | margin: 0.5em 1em; 222 | } 223 | 224 | article.main > div.list-terms > ul > li:hover { 225 | border-color: #969697; 226 | border-width: 2px; 227 | color: white; 228 | background-color: #727272; 229 | } 230 | 231 | /*** footer ***/ 232 | footer { 233 | font-size: 8pt; 234 | color: grey; 235 | border-top: 1pt solid rgb(59, 59, 59); 236 | padding: 0 3pt; 237 | display: flex; 238 | justify-content: space-between; 239 | } 240 | 241 | footer > div { 242 | display: inline; 243 | flex: 0 0 auto; 244 | /* overflow-x: hidden; */ 245 | } 246 | 247 | footer > div > ul { 248 | display: flex; 249 | height: 100%; 250 | align-items: stretch; 251 | white-space: nowrap; 252 | } 253 | 254 | footer > div > ul > li { 255 | flex: 0 0 auto; 256 | padding: 0 5pt; 257 | display: inline-flex; 258 | align-items: center; 259 | cursor: default; 260 | } 261 | 262 | footer > div ul > li:hover { 263 | background-color: rgb(65, 65, 65); 264 | color: rgb(150, 150, 150); 265 | } 266 | 267 | /* submenu */ 268 | footer > div ul > li ul { 269 | background-color: #282c34; 270 | 271 | display: none; 272 | align-self: flex-end; 273 | position: relative; 274 | bottom: 100%; 275 | } 276 | 277 | footer > div ul > li:hover ul, 278 | footer > div ul > li ul:hover { 279 | display: block; 280 | } 281 | 282 | footer > div ul > li:hover > ul > li, 283 | footer > div ul > li > ul:hover > li { 284 | padding: 8pt; 285 | } 286 | 287 | footer > div.footer-left { 288 | max-width: 40%; 289 | } 290 | 291 | footer > div.footer-left > ul { 292 | justify-content: flex-start; 293 | } 294 | 295 | footer > div.footer-right { 296 | min-width: 60%; 297 | } 298 | 299 | footer > div.footer-right > ul { 300 | justify-content: flex-end; 301 | } 302 | 303 | /* language navigator */ 304 | footer > div.footer-right > ul > li.language-selector { 305 | width: 1em; 306 | cursor: pointer; 307 | } 308 | 309 | footer 310 | > div.footer-right 311 | > ul 312 | > li.language-selector 313 | > ul.language-selector-menu { 314 | font-size: 10pt; 315 | left: -2em; 316 | } 317 | 318 | /*** Section Tree Listing ***/ 319 | ul.section-tree > li > a { 320 | cursor: pointer; 321 | line-height: 120%; 322 | } 323 | 324 | ul.section-tree > li > a:hover { 325 | color: white !important; 326 | } 327 | 328 | ul.section-tree > li.dir { 329 | padding-left: 10pt; 330 | padding-top: 10pt; 331 | color: grey; 332 | } 333 | 334 | ul.section-tree > li.dir > span.dir-text { 335 | cursor: pointer; 336 | margin-left: 5pt; 337 | } 338 | 339 | ul.section-tree > li.dir > span.dir-text:hover { 340 | color: white; 341 | } 342 | 343 | ul.section-tree > li.closed-dir::before { 344 | content: " "; 345 | border-color: white; 346 | border-width: 1pt 1pt 0 0; 347 | border-style: solid; 348 | padding: 3pt; 349 | transform: rotate(45deg); 350 | display: inline-block; 351 | position: relative; 352 | bottom: 1pt; 353 | } 354 | 355 | ul.section-tree > li.closed-dir > ul { 356 | display: none; 357 | } 358 | 359 | ul.section-tree > li.opened-dir::before { 360 | content: " "; 361 | border-color: white; 362 | border-width: 1pt 1pt 0 0; 363 | border-style: solid; 364 | padding: 3pt; 365 | transform: rotate(135deg); 366 | display: inline-block; 367 | position: relative; 368 | bottom: 3pt; 369 | } 370 | 371 | ul.section-tree > li.file { 372 | padding-left: 5pt; 373 | padding-top: 7pt; 374 | color: grey; 375 | font-size: 95%; 376 | margin-left: 28pt; 377 | } 378 | 379 | ul.section-tree > li.file::before { 380 | content: "\f383"; 381 | font-family: bootstrap-icons !important; 382 | font-style: normal; 383 | font-weight: normal !important; 384 | font-variant: normal; 385 | text-transform: none; 386 | margin-left: -1.6em; 387 | vertical-align: -0.3ex; 388 | padding-right: 0.4em; 389 | } 390 | 391 | /* dir in nested subdir*/ 392 | ul.section-tree ul.section-tree > li.dir { 393 | padding-left: 18pt; 394 | } 395 | 396 | /* file in nested subdir*/ 397 | ul.section-tree ul.section-tree > li.file { 398 | padding-left: 4pt; 399 | } 400 | 401 | /* sidebar slide-in animation */ 402 | @keyframes slide-in { 403 | 100% { 404 | transform: translateX(0%); 405 | } 406 | } 407 | -------------------------------------------------------------------------------- /hugo.toml: -------------------------------------------------------------------------------- 1 | # Minimum support hugo 2 | [module] 3 | [module.hugoVersion] 4 | min = "0.124.0" 5 | 6 | # Support Taxonomies 7 | [taxonomies] 8 | autor = "author" 9 | tag = "tags" 10 | category = "categories" 11 | 12 | # Theme parameters 13 | [params] 14 | 15 | # Parameters applied in HTML 16 | [params.site] 17 | # Website ICON 18 | faviconUrl = "" 19 | 20 | # Do you have any CSS in local? List them in an array. 21 | # They should be placed inside "/assets" dir. 22 | # Please list your files relative to the /assets directory. 23 | # Glob pattern is acceptable 24 | # If only a few pages need the extra style files, list them in the page metadata. 25 | localCss = [] 26 | 27 | # Do you need to add any external CSS? List their URL in an array. 28 | # If only a few pages need the extra style files, list them in the page metadata. 29 | # These URLs will be inserted into tags directly without any check. 30 | externalCss = [] 31 | 32 | # Like the one above, but this will download a local copy and combine it with 33 | # other CSS files into a single file while in production mode. 34 | externalCssDownload = [] 35 | 36 | # Do you have any script in local? List them in an array. 37 | # They should be placed inside "/assets" dir. 38 | # Please list your files relative to the /assets directory. 39 | # Glob pattern is acceptable 40 | # If only a few pages need the extra script files, list them in the page metadata. 41 | localJs = [] 42 | 43 | # Do you have any external Script need to add on? List their URL in an array. 44 | # If only a few pages need the extra script files, list them in the page metadata. 45 | # These URLs will be inserted into