├── layouts ├── partials │ ├── head │ │ ├── custom.html │ │ ├── script.html │ │ ├── opengraph │ │ │ ├── include.html │ │ │ └── provider │ │ │ │ ├── twitter.html │ │ │ │ └── base.html │ │ ├── style.html │ │ ├── head.html │ │ └── colorScheme.html │ ├── footer │ │ ├── custom.html │ │ ├── include.html │ │ ├── components │ │ │ ├── script.html │ │ │ └── custom-font.html │ │ └── footer.html │ ├── article │ │ ├── components │ │ │ ├── content.html │ │ │ ├── tags.html │ │ │ ├── math.html │ │ │ ├── related-contents.html │ │ │ ├── footer.html │ │ │ ├── details.html │ │ │ ├── header.html │ │ │ └── photoswipe.html │ │ └── article.html │ ├── comments │ │ ├── include.html │ │ └── provider │ │ │ ├── disqus.html │ │ │ ├── cusdis.html │ │ │ ├── vssue.html │ │ │ ├── remark42.html │ │ │ ├── utterances.html │ │ │ ├── gitalk.html │ │ │ ├── waline.html │ │ │ ├── twikoo.html │ │ │ ├── giscus.html │ │ │ └── disqusjs.html │ ├── article-list │ │ ├── default.html │ │ ├── compact.html │ │ └── tile.html │ ├── helper │ │ ├── icon.html │ │ ├── external.html │ │ └── image.html │ ├── sidebar │ │ ├── right.html │ │ └── left.html │ ├── data │ │ ├── description.html │ │ └── title.html │ ├── widget │ │ ├── tag-cloud.html │ │ ├── search.html │ │ └── archives.html │ └── pagination.html ├── _default │ ├── _markup │ │ ├── render-link.html │ │ └── render-image.html │ ├── baseof.html │ ├── archives.html │ ├── single.html │ └── list.html ├── 404.html ├── shortcodes │ ├── tencent.html │ ├── video.html │ ├── youtube.html │ └── bilibili.html ├── index.html ├── page │ ├── search.json │ └── search.html └── rss.xml ├── .github ├── FUNDING.yml ├── workflows │ ├── release-drafter.yml │ └── hugo-artifact.yml ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md └── release-drafter.yml ├── .gitignore ├── debug.sh ├── images ├── tn.png └── screenshot.png ├── exampleSite ├── README.md ├── content │ ├── post │ │ ├── chinese-test │ │ │ ├── luca-bravo-alS7ewQ41M8-unsplash.jpg │ │ │ ├── helena-hertz-wWZzXlDpMog-unsplash.jpg │ │ │ ├── hudai-gayiran-3Od_VKcDEAA-unsplash.jpg │ │ │ ├── florian-klauer-nptLmg6jqDo-unsplash.jpg │ │ │ └── index.md │ │ ├── placeholder-text │ │ │ ├── matt-le-SJSpo9hQf7s-unsplash.jpg │ │ │ └── index.md │ │ ├── markdown-syntax │ │ │ ├── pawel-czerwinski-8uZPynIu-rQ-unsplash.jpg │ │ │ └── index.md │ │ ├── emoji-support │ │ │ ├── the-creative-exchange-d2zvqp3fpro-unsplash.jpg │ │ │ └── index.md │ │ ├── rich-content │ │ │ └── index.md │ │ └── math-typesetting │ │ │ └── index.md │ ├── categories │ │ └── Test │ │ │ ├── hutomo-abrianto-l2jk-uxb1BY-unsplash.jpg │ │ │ └── _index.md │ └── page │ │ ├── archives.md │ │ ├── search.md │ │ └── about.md ├── .gitignore ├── LICENSE └── config.yaml ├── assets ├── scss │ ├── custom.scss │ ├── partials │ │ ├── layout │ │ │ ├── archives.scss │ │ │ ├── 404.scss │ │ │ ├── list.scss │ │ │ └── search.scss │ │ ├── pagination.scss │ │ ├── footer.scss │ │ ├── base.scss │ │ ├── widgets.scss │ │ ├── sidebar.scss │ │ ├── menu.scss │ │ └── highlight │ │ │ ├── dark.scss │ │ │ └── light.scss │ ├── breakpoints.scss │ ├── style.scss │ ├── grid.scss │ └── variables.scss ├── img │ └── avatar.png ├── jsconfig.json ├── icons │ ├── back.svg │ ├── arrow-back.svg │ ├── clock.svg │ ├── copyright.svg │ ├── search.svg │ ├── user.svg │ ├── toggle-left.svg │ ├── toggle-right.svg │ ├── rss.svg │ ├── tag.svg │ ├── link.svg │ ├── messages.svg │ ├── archives.svg │ ├── home.svg │ ├── infinity.svg │ ├── hash.svg │ ├── date.svg │ ├── brand-github.svg │ └── brand-twitter.svg └── ts │ ├── createElement.ts │ ├── color.ts │ ├── colorScheme.ts │ ├── menu.ts │ ├── main.ts │ └── gallery.ts ├── archetypes ├── tags.md ├── categories.md └── default.md ├── theme.toml ├── i18n ├── zh-CN.yaml ├── zh-TW.yaml ├── ja.yaml ├── nl.yaml ├── tr.yaml ├── ko.yaml ├── pt-BR.yaml ├── en.yaml ├── it.yaml ├── pl.yaml ├── es.yaml ├── id.yaml ├── uk.yaml ├── th.yaml ├── de.yaml ├── fr.yaml ├── ru.yaml └── el.yaml ├── netlify.toml ├── .devcontainer ├── Dockerfile └── devcontainer.json ├── data └── external.yaml ├── config.yaml └── README.md /layouts/partials/head/custom.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layouts/partials/head/script.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: jimmycai -------------------------------------------------------------------------------- /layouts/partials/footer/custom.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | public 2 | resources 3 | assets/jsconfig.json -------------------------------------------------------------------------------- /debug.sh: -------------------------------------------------------------------------------- 1 | cd exampleSite && hugo server --gc --themesDir=../.. -------------------------------------------------------------------------------- /images/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hahwul/hugo-theme-stack/master/images/tn.png -------------------------------------------------------------------------------- /exampleSite/README.md: -------------------------------------------------------------------------------- 1 | Example site modified from https://github.com/gohugoio/hugoBasicExample -------------------------------------------------------------------------------- /assets/scss/custom.scss: -------------------------------------------------------------------------------- 1 | /* Place your custom SCSS in HUGO_SITE_FOLDER/assets/scss/custom.scss */ -------------------------------------------------------------------------------- /assets/img/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hahwul/hugo-theme-stack/master/assets/img/avatar.png -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hahwul/hugo-theme-stack/master/images/screenshot.png -------------------------------------------------------------------------------- /archetypes/tags.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | description: 4 | image: 5 | --- -------------------------------------------------------------------------------- /assets/scss/partials/layout/archives.scss: -------------------------------------------------------------------------------- 1 | .archives-group { 2 | margin-bottom: var(--section-separation); 3 | } -------------------------------------------------------------------------------- /layouts/partials/article/components/content.html: -------------------------------------------------------------------------------- 1 |
2 | {{ .Content }} 3 |
4 | -------------------------------------------------------------------------------- /layouts/partials/head/opengraph/include.html: -------------------------------------------------------------------------------- 1 | {{ partial "head/opengraph/provider/base" . }} 2 | {{ partial "head/opengraph/provider/twitter" . }} -------------------------------------------------------------------------------- /archetypes/categories.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | image: 4 | style: 5 | background: "#2a9d8f" 6 | color: "#fff" 7 | --- -------------------------------------------------------------------------------- /layouts/partials/comments/include.html: -------------------------------------------------------------------------------- 1 | {{ if .Site.Params.comments.enabled }} 2 | {{ partial (printf "comments/provider/%s" .Site.Params.comments.provider) . }} 3 | {{ end }} -------------------------------------------------------------------------------- /layouts/partials/footer/include.html: -------------------------------------------------------------------------------- 1 | {{ partialCached "footer/components/script.html" . }} 2 | {{ partialCached "footer/components/custom-font.html" . }} 3 | {{ partial "footer/custom.html" . }} -------------------------------------------------------------------------------- /layouts/partials/head/style.html: -------------------------------------------------------------------------------- 1 | {{ $sass := resources.Get "scss/style.scss" }} 2 | {{ $style := $sass | resources.ToCSS | minify }} 3 | -------------------------------------------------------------------------------- /assets/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "paths": { 5 | "*": [ 6 | "*" 7 | ] 8 | }, 9 | } 10 | } -------------------------------------------------------------------------------- /exampleSite/content/post/chinese-test/luca-bravo-alS7ewQ41M8-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hahwul/hugo-theme-stack/master/exampleSite/content/post/chinese-test/luca-bravo-alS7ewQ41M8-unsplash.jpg -------------------------------------------------------------------------------- /exampleSite/content/categories/Test/hutomo-abrianto-l2jk-uxb1BY-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hahwul/hugo-theme-stack/master/exampleSite/content/categories/Test/hutomo-abrianto-l2jk-uxb1BY-unsplash.jpg -------------------------------------------------------------------------------- /exampleSite/content/post/chinese-test/helena-hertz-wWZzXlDpMog-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hahwul/hugo-theme-stack/master/exampleSite/content/post/chinese-test/helena-hertz-wWZzXlDpMog-unsplash.jpg -------------------------------------------------------------------------------- /exampleSite/content/post/chinese-test/hudai-gayiran-3Od_VKcDEAA-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hahwul/hugo-theme-stack/master/exampleSite/content/post/chinese-test/hudai-gayiran-3Od_VKcDEAA-unsplash.jpg -------------------------------------------------------------------------------- /exampleSite/content/post/placeholder-text/matt-le-SJSpo9hQf7s-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hahwul/hugo-theme-stack/master/exampleSite/content/post/placeholder-text/matt-le-SJSpo9hQf7s-unsplash.jpg -------------------------------------------------------------------------------- /exampleSite/content/post/chinese-test/florian-klauer-nptLmg6jqDo-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hahwul/hugo-theme-stack/master/exampleSite/content/post/chinese-test/florian-klauer-nptLmg6jqDo-unsplash.jpg -------------------------------------------------------------------------------- /archetypes/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | description: 4 | date: {{ .Date }} 5 | image: 6 | math: 7 | license: 8 | hidden: false 9 | comments: true 10 | draft: true 11 | --- -------------------------------------------------------------------------------- /exampleSite/content/post/markdown-syntax/pawel-czerwinski-8uZPynIu-rQ-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hahwul/hugo-theme-stack/master/exampleSite/content/post/markdown-syntax/pawel-czerwinski-8uZPynIu-rQ-unsplash.jpg -------------------------------------------------------------------------------- /exampleSite/content/post/emoji-support/the-creative-exchange-d2zvqp3fpro-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hahwul/hugo-theme-stack/master/exampleSite/content/post/emoji-support/the-creative-exchange-d2zvqp3fpro-unsplash.jpg -------------------------------------------------------------------------------- /assets/scss/partials/layout/404.scss: -------------------------------------------------------------------------------- 1 | .not-found-card { 2 | background-color: var(--card-background); 3 | box-shadow: var(--shadow-l1); 4 | border-radius: var(--card-border-radius); 5 | padding: var(--card-padding); 6 | } 7 | -------------------------------------------------------------------------------- /exampleSite/content/page/archives.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Archives" 3 | date: 2019-05-28 4 | layout: "archives" 5 | slug: "archives" 6 | menu: 7 | main: 8 | weight: -70 9 | params: 10 | icon: archives 11 | --- 12 | -------------------------------------------------------------------------------- /exampleSite/content/page/search.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Search" 3 | slug: "search" 4 | layout: "search" 5 | outputs: 6 | - html 7 | - json 8 | menu: 9 | main: 10 | weight: -60 11 | params: 12 | icon: search 13 | --- -------------------------------------------------------------------------------- /layouts/_default/_markup/render-link.html: -------------------------------------------------------------------------------- 1 | {{ .Text | safeHTML }} -------------------------------------------------------------------------------- /exampleSite/content/categories/Test/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Test" 3 | description: "This is an example category" 4 | slug: "test" 5 | image: "hutomo-abrianto-l2jk-uxb1BY-unsplash.jpg" 6 | style: 7 | background: "#2a9d8f" 8 | color: "#fff" 9 | --- 10 | -------------------------------------------------------------------------------- /layouts/partials/article/components/tags.html: -------------------------------------------------------------------------------- 1 | {{ if .Params.Tags }} 2 |
3 | {{ range (.GetTerms "tags") }} 4 | {{ .LinkTitle }} 5 | {{ end }} 6 |
7 | {{ end }} -------------------------------------------------------------------------------- /layouts/partials/article-list/default.html: -------------------------------------------------------------------------------- 1 | {{ $image := partialCached "helper/image" (dict "Context" . "Type" "articleList") .RelPermalink "articleList" }} 2 |
3 | {{ partial "article/components/header" . }} 4 |
-------------------------------------------------------------------------------- /layouts/404.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 |
3 |

{{ T "notFound.title" }}

4 |

{{ T "notFound.subtitle" }}

5 |
6 | {{ partialCached "footer/footer" . }} 7 | {{ end }} -------------------------------------------------------------------------------- /layouts/partials/helper/icon.html: -------------------------------------------------------------------------------- 1 | {{- $iconFile := resources.GetMatch (printf "icons/%s.svg" .) -}} 2 | {{- if $iconFile -}} 3 | {{- $iconFile.Content | safeHTML -}} 4 | {{- else -}} 5 | {{- errorf "Error: icon '%s.svg' is not found under 'assets/icons' folder" . -}} 6 | {{- end -}} -------------------------------------------------------------------------------- /layouts/partials/footer/components/script.html: -------------------------------------------------------------------------------- 1 | {{- partial "helper/external" (dict "Context" . "Namespace" "Vibrant") -}} 2 | 3 | {{- $opts := dict "minify" hugo.IsProduction -}} 4 | {{- $script := resources.Get "ts/main.ts" | js.Build $opts -}} 5 | 6 | -------------------------------------------------------------------------------- /layouts/partials/sidebar/right.html: -------------------------------------------------------------------------------- 1 | {{ if .Site.Params.widgets.enabled }} 2 | {{ $context := . }} 3 | 8 | {{ end }} -------------------------------------------------------------------------------- /assets/icons/back.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /layouts/shortcodes/tencent.html: -------------------------------------------------------------------------------- 1 | {{ $vid := .Get 0 }} 2 |
3 | 10 |
-------------------------------------------------------------------------------- /assets/icons/arrow-back.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/icons/clock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/icons/copyright.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/icons/search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/icons/user.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /layouts/partials/data/description.html: -------------------------------------------------------------------------------- 1 | 2 | {{ $description := .Site.Params.sidebar.subtitle }} 3 | 4 | {{ if .Description }} 5 | 6 | {{ $description = .Description }} 7 | {{ else if .IsPage }} 8 | 9 | {{ $description = .Summary }} 10 | {{ end }} 11 | 12 | {{ return ($description | plainify)}} -------------------------------------------------------------------------------- /assets/icons/toggle-left.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/icons/toggle-right.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/icons/rss.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /layouts/partials/footer/components/custom-font.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layouts/partials/article/article.html: -------------------------------------------------------------------------------- 1 |
2 | {{ partial "article/components/header" . }} 3 | 4 | {{ partial "article/components/content" . }} 5 | 6 | {{ partial "article/components/footer" . }} 7 | 8 | {{ if or .Params.math .Site.Params.article.math }} 9 | {{ partialCached "article/components/math.html" . }} 10 | {{ end }} 11 |
-------------------------------------------------------------------------------- /assets/icons/tag.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/icons/link.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/scss/breakpoints.scss: -------------------------------------------------------------------------------- 1 | $breakpoints: ( 2 | sm: 640px, 3 | md: 768px, 4 | lg: 1024px, 5 | xl: 1280px, 6 | 2xl: 1536px, 7 | ); 8 | 9 | @mixin respond($breakpoint) { 10 | @if not map-has-key($breakpoints, $breakpoint) { 11 | @warn "'#{$breakpoint}' is not a valid breakpoint"; 12 | } @else { 13 | @media (min-width: map-get($breakpoints, $breakpoint)) { 14 | @content; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /assets/icons/messages.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/icons/archives.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /exampleSite/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | 25 | public 26 | themes 27 | resources 28 | 29 | assets/jsconfig.json 30 | .DS_Store 31 | -------------------------------------------------------------------------------- /assets/icons/home.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /assets/icons/infinity.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/icons/hash.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /layouts/shortcodes/video.html: -------------------------------------------------------------------------------- 1 | {{- $src := .Get "src" | default (.Get 0) -}} 2 |
3 | 14 |
15 | -------------------------------------------------------------------------------- /.github/workflows/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name: Release Drafter 2 | 3 | on: 4 | push: 5 | # branches to consider in the event; optional, defaults to all 6 | branches: 7 | - master 8 | 9 | jobs: 10 | update_release_draft: 11 | runs-on: ubuntu-latest 12 | steps: 13 | # Drafts your next Release notes as Pull Requests are merged into "master" 14 | - uses: release-drafter/release-drafter@v5 15 | env: 16 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 17 | -------------------------------------------------------------------------------- /assets/icons/date.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /layouts/shortcodes/youtube.html: -------------------------------------------------------------------------------- 1 | {{- $pc := .Page.Site.Config.Privacy.YouTube -}} 2 | {{- if not $pc.Disable -}} 3 | {{- $ytHost := cond $pc.PrivacyEnhanced "www.youtube-nocookie.com" "www.youtube.com" -}} 4 | {{- $id := .Get "id" | default (.Get 0) -}} 5 |
6 | 12 |
13 | {{ end -}} -------------------------------------------------------------------------------- /layouts/partials/widget/tag-cloud.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ partial "helper/icon" "tag" }} 4 |
5 |

{{ T "widget.tagCloud.title" }}

6 | 7 |
8 | {{ range first .Site.Params.widgets.tagCloud.limit .Site.Taxonomies.tags.ByCount }} 9 | 10 | {{ .Page.Title }} 11 | 12 | {{ end }} 13 |
14 |
-------------------------------------------------------------------------------- /layouts/partials/article/components/math.html: -------------------------------------------------------------------------------- 1 | {{- partial "helper/external" (dict "Context" . "Namespace" "KaTeX") -}} 2 | -------------------------------------------------------------------------------- /layouts/partials/comments/provider/disqus.html: -------------------------------------------------------------------------------- 1 |
2 | {{ template "_internal/disqus.html" . }} 3 |
4 | 5 | 13 | 14 | -------------------------------------------------------------------------------- /assets/icons/brand-github.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /layouts/partials/article/components/related-contents.html: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /assets/icons/brand-twitter.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/scss/partials/pagination.scss: -------------------------------------------------------------------------------- 1 | .pagination { 2 | display: flex; 3 | background-color: var(--card-background); 4 | box-shadow: var(--shadow-l1); 5 | border-radius: var(--card-border-radius); 6 | overflow: hidden; 7 | flex-wrap: wrap; 8 | margin: var(--section-separation) 0; 9 | 10 | .page-link { 11 | padding: 16px 32px; 12 | display: inline-flex; 13 | 14 | &.current { 15 | font-weight: bold; 16 | background-color: var(--card-background-selected); 17 | color: var(--card-text-color-main); 18 | } 19 | 20 | color: var(--card-text-color-secondary); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /layouts/index.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} 3 | {{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }} 4 | {{ $filtered := ($pages | intersect $notHidden) }} 5 | {{ $pag := .Paginate ($filtered) }} 6 | 7 |
8 | {{ range $index, $element := $pag.Pages }} 9 | {{ partial "article-list/default" . }} 10 | {{ end }} 11 |
12 | 13 | {{- partial "pagination.html" . -}} 14 | {{- partial "footer/footer" . -}} 15 | {{ end }} 16 | 17 | {{ define "right-sidebar" }} 18 | {{ partial "sidebar/right.html" . }} 19 | {{ end }} -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /layouts/partials/widget/search.html: -------------------------------------------------------------------------------- 1 | {{- $query := first 1 (where .Site.Pages "Layout" "==" "search") -}} 2 | {{- if $query -}} 3 | {{- $searchPage := index $query 0 -}} 4 |
5 |

6 | 7 | 8 | 9 | 12 |

13 |
14 | {{- else -}} 15 | {{- warnf "Search page not found. Create a page with layout: search." -}} 16 | {{- end -}} -------------------------------------------------------------------------------- /assets/scss/partials/footer.scss: -------------------------------------------------------------------------------- 1 | footer.site-footer { 2 | padding: 20px 0 var(--section-separation) 0; 3 | font-size: 1.4rem; 4 | line-height: 1.75; 5 | margin-top: var(--section-separation); 6 | 7 | &:before { 8 | content: ""; 9 | display: block; 10 | height: 3px; 11 | width: 50px; 12 | background: var(--body-text-color); 13 | margin-bottom: 20px; 14 | } 15 | 16 | .copyright { 17 | color: var(--accent-color); 18 | font-weight: bold; 19 | margin-bottom: 5px; 20 | } 21 | 22 | .powerby { 23 | color: var(--body-text-color); 24 | font-weight: normal; 25 | font-size: 1.2rem; 26 | 27 | a { 28 | color: var(--body-text-color); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /layouts/partials/comments/provider/cusdis.html: -------------------------------------------------------------------------------- 1 | {{- $host := default "https://cusdis.com" .Site.Params.comments.cusdis.host -}} 2 |
8 | 9 | 10 | 22 | -------------------------------------------------------------------------------- /theme.toml: -------------------------------------------------------------------------------- 1 | # theme.toml template for a Hugo theme 2 | # See https://github.com/gohugoio/hugoThemes#themetoml for an example 3 | 4 | name = "Stack" 5 | license = "GPL-3.0-only" 6 | licenselink = "https://github.com/CaiJimmy/hugo-theme-stack/blob/master/LICENSE" 7 | description = "Card-style Hugo theme designed for bloggers" 8 | homepage = "https://github.com/CaiJimmy/hugo-theme-stack" 9 | demosite = "https://demo.stack.jimmycai.com" 10 | 11 | tags = ["blog", "responsive", "clean", "light", "dark", "personal"] 12 | 13 | features = [ 14 | "disqus", 15 | "photoswipe", 16 | "opengraph", 17 | "widgets", 18 | "darkmode", 19 | "table of contents", 20 | "search", 21 | ] 22 | 23 | min_version = "0.87.0" 24 | 25 | [author] 26 | name = "Jimmy Cai" 27 | homepage = "https://jimmycai.com" 28 | -------------------------------------------------------------------------------- /layouts/partials/article/components/footer.html: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /layouts/partials/head/opengraph/provider/twitter.html: -------------------------------------------------------------------------------- 1 | {{- with .Site.Params.opengraph.twitter.site -}} 2 | 3 | 4 | {{- end -}} 5 | 6 | {{- $title := partialCached "data/title" . .RelPermalink -}} 7 | {{- $description := partialCached "data/description" . .RelPermalink -}} 8 | 9 | 10 | 11 | 12 | {{- $image := partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" -}} 13 | {{- if $image.exists -}} 14 | 15 | 16 | {{- end -}} -------------------------------------------------------------------------------- /assets/scss/partials/base.scss: -------------------------------------------------------------------------------- 1 | html { 2 | font-size: 62.5%; 3 | overflow-y: scroll; 4 | scroll-behavior: smooth; 5 | } 6 | 7 | * { 8 | box-sizing: border-box; 9 | } 10 | 11 | body { 12 | background: var(--body-background); 13 | margin: 0; 14 | font-family: var(--base-font-family); 15 | font-size: 1.6rem; 16 | -webkit-font-smoothing: antialiased; 17 | -moz-osx-font-smoothing: grayscale; 18 | } 19 | 20 | /* scrollbar styles for Firefox */ 21 | * { 22 | scrollbar-width: auto; 23 | scrollbar-color: var(--scrollbar-thumb) transparent; 24 | } 25 | /**/ 26 | 27 | /* scrollbar styles for Chromium */ 28 | ::-webkit-scrollbar { 29 | height: auto; 30 | } 31 | 32 | ::-webkit-scrollbar-thumb { 33 | background-color: var(--scrollbar-thumb); 34 | } 35 | 36 | ::-webkit-scrollbar-track { 37 | background-color: transparent; 38 | } 39 | /**/ 40 | -------------------------------------------------------------------------------- /i18n/zh-CN.yaml: -------------------------------------------------------------------------------- 1 | toggleMenu: 2 | other: 切换菜单 3 | 4 | darkMode: 5 | other: 暗色模式 6 | 7 | article: 8 | back: 9 | other: 返回 10 | 11 | tableOfContents: 12 | other: 目录 13 | 14 | relatedContents: 15 | other: 相关文章 16 | 17 | lastUpdatedOn: 18 | other: 最后更新于 19 | 20 | readingTime: 21 | other: "阅读时长: {{ .Count }} 分钟" 22 | 23 | notFound: 24 | title: 25 | other: 404 错误 26 | subtitle: 27 | other: 页面不存在 28 | 29 | widget: 30 | archives: 31 | title: 32 | other: 归档 33 | 34 | more: 35 | other: 更多 36 | 37 | tagCloud: 38 | title: 39 | other: 标签云 40 | 41 | search: 42 | title: 43 | other: 搜索 44 | 45 | placeholder: 46 | other: 输入关键词... 47 | 48 | resultTitle: 49 | other: "#PAGES_COUNT 个结果 (用时 #TIME_SECONDS 秒)" 50 | -------------------------------------------------------------------------------- /i18n/zh-TW.yaml: -------------------------------------------------------------------------------- 1 | toggleMenu: 2 | other: 切換選單 3 | 4 | darkMode: 5 | other: 夜晚模式 6 | 7 | article: 8 | back: 9 | other: 返回 10 | 11 | tableOfContents: 12 | other: 目錄 13 | 14 | relatedContents: 15 | other: 相關文章 16 | 17 | lastUpdatedOn: 18 | other: 最後更新 19 | 20 | readingTime: 21 | other: "閱讀時間: {{ .Count }} 分鐘" 22 | 23 | notFound: 24 | title: 25 | other: 404 錯誤 26 | subtitle: 27 | other: 頁面不存在 28 | 29 | widget: 30 | archives: 31 | title: 32 | other: 紀錄 33 | 34 | more: 35 | other: 更多 36 | 37 | tagCloud: 38 | title: 39 | other: 標籤雲 40 | 41 | search: 42 | title: 43 | other: 搜尋 44 | 45 | placeholder: 46 | other: 輸入關鍵字... 47 | 48 | resultTitle: 49 | other: "#PAGES_COUNT 個結果 (用時 #TIME_SECONDS 秒)" 50 | -------------------------------------------------------------------------------- /layouts/_default/baseof.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{- partial "head/head.html" . -}} 5 | {{- block "head" . -}}{{ end }} 6 | 7 | 8 | {{- partial "head/colorScheme" . -}} 9 |
10 | {{- block "left-sidebar" . -}} 11 | {{ partial "sidebar/left.html" . }} 12 | {{- end -}} 13 |
14 | {{- block "main" . }}{{- end }} 15 |
16 | {{- block "right-sidebar" . -}}{{ end }} 17 |
18 | {{ partial "footer/include.html" . }} 19 | 20 | 21 | -------------------------------------------------------------------------------- /i18n/ja.yaml: -------------------------------------------------------------------------------- 1 | toggleMenu: 2 | other: メニューを開く・閉じる 3 | 4 | darkMode: 5 | other: ダークモード 6 | 7 | article: 8 | back: 9 | other: 前のページ 10 | 11 | tableOfContents: 12 | other: 目次 13 | 14 | relatedContents: 15 | other: 関連するコンテンツ 16 | 17 | lastUpdatedOn: 18 | other: 最終更新 19 | 20 | readingTime: 21 | other: "読了時間: {{ .Count }}分" 22 | 23 | notFound: 24 | title: 25 | other: 404 Not Found 26 | subtitle: 27 | other: 指定されたページは存在しません。 28 | 29 | widget: 30 | archives: 31 | title: 32 | other: アーカイブ 33 | 34 | more: 35 | other: さらに見る 36 | 37 | tagCloud: 38 | title: 39 | other: タグ 40 | 41 | search: 42 | title: 43 | other: 検索 44 | 45 | placeholder: 46 | other: 入力... 47 | 48 | resultTitle: 49 | other: "#PAGES_COUNT 件 (#TIME_SECONDS 秒)" 50 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name-template: "v$RESOLVED_VERSION 🌈" 2 | tag-template: "v$RESOLVED_VERSION" 3 | categories: 4 | - title: "🚀 Features" 5 | labels: 6 | - "feature" 7 | - "enhancement" 8 | - title: "🐛 Bug Fixes" 9 | labels: 10 | - "fix" 11 | - "bugfix" 12 | - "bug" 13 | - title: "🧰 Maintenance" 14 | label: "chore" 15 | - title: "♻️ Refactor" 16 | label: refactor 17 | change-template: "- $TITLE @$AUTHOR (#$NUMBER)" 18 | change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. 19 | version-resolver: 20 | major: 21 | labels: 22 | - "major" 23 | minor: 24 | labels: 25 | - "minor" 26 | patch: 27 | labels: 28 | - "patch" 29 | default: patch 30 | template: | 31 | ## Changes 32 | 33 | $CHANGES 34 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | publish = "exampleSite/public" 3 | 4 | [build.environment] 5 | HUGO_VERSION = "0.87.0" 6 | HUGO_THEME = "repo" 7 | 8 | [context.production] 9 | command = "cd exampleSite && hugo --gc --themesDir ../.. -b ${URL}" 10 | [context.production.environment] 11 | HUGO_ENV = "production" 12 | 13 | [context.branch-deploy] 14 | command = "cd exampleSite && hugo --gc --themesDir ../.. -b ${DEPLOY_PRIME_URL}" 15 | 16 | [context.deploy-preview] 17 | command = "cd exampleSite && hugo --gc --themesDir ../.. -b ${DEPLOY_PRIME_URL}" 18 | 19 | [[plugins]] 20 | package = "netlify-plugin-hugo-cache-resources" 21 | 22 | [plugins.inputs] 23 | # If it should show more verbose logs (optional, default = true) 24 | debug = true 25 | # Relative path to source directory in case you use Hugo's "--s" option 26 | srcdir = "exampleSite" -------------------------------------------------------------------------------- /layouts/partials/head/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{- $description := partialCached "data/description" . .RelPermalink -}} 5 | 6 | 7 | {{- $title := partialCached "data/title" . .RelPermalink -}} 8 | {{ $title }} 9 | 10 | 11 | 12 | {{- partial "head/style.html" . -}} 13 | {{- partial "head/script.html" . -}} 14 | {{- partial "head/opengraph/include.html" . -}} 15 | 16 | {{- range .AlternativeOutputFormats -}} 17 | 18 | {{- end -}} 19 | 20 | {{ with .Site.Params.favicon }} 21 | 22 | {{ end }} 23 | 24 | {{- template "_internal/google_analytics.html" . -}} 25 | {{- partial "head/custom.html" . -}} 26 | -------------------------------------------------------------------------------- /layouts/shortcodes/bilibili.html: -------------------------------------------------------------------------------- 1 | {{ $vid := (.Get 0) }} 2 | {{ $videopage := default 1 (.Get 1) }} 3 | {{ $basicQuery := querify "page" $videopage "high_quality" 1 "as_wide" 1 }} 4 | {{ $videoQuery := "" }} 5 | 6 | {{ if strings.HasPrefix (lower $vid) "av" }} 7 | {{ $videoQuery = querify "aid" (strings.TrimPrefix "av" (lower $vid)) }} 8 | {{ else if strings.HasPrefix (lower $vid) "bv" }} 9 | {{ $videoQuery = querify "bvid" $vid }} 10 | {{ else }} 11 |

Bilibili 视频av号或BV号错误!请检查视频av号或BV号是否正确

12 |

当前视频av或BV号:{{ $vid }},视频分P:{{ $videopage }}

13 | {{ end }} 14 | 15 |
16 | 23 |
24 | -------------------------------------------------------------------------------- /exampleSite/content/post/rich-content/index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "Hugo Authors" 3 | title = "Rich Content" 4 | date = "2019-03-10" 5 | description = "A brief description of Hugo Shortcodes" 6 | tags = [ 7 | "shortcodes", 8 | "privacy", 9 | ] 10 | +++ 11 | 12 | Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-management/shortcodes/#use-hugo-s-built-in-shortcodes) for rich content, along with a [Privacy Config](https://gohugo.io/about/hugo-and-gdpr/) and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds. 13 | 14 | --- 15 | 16 | ## YouTube Privacy Enhanced Shortcode 17 | 18 | {{< youtube ZJthWmvUzzc >}} 19 | 20 |
21 | 22 | --- 23 | 24 | ## Twitter Simple Shortcode 25 | 26 | {{< twitter_simple 1085870671291310081 >}} 27 | 28 |
29 | 30 | --- 31 | 32 | ## Vimeo Simple Shortcode 33 | 34 | {{< vimeo_simple 48912912 >}} 35 | 36 | ## bilibilibi Shortcode 37 | 38 | {{< bilibili av498363026 >}} 39 | -------------------------------------------------------------------------------- /layouts/partials/comments/provider/vssue.html: -------------------------------------------------------------------------------- 1 | {{- with .Site.Params.comments.vssue -}} 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 27 | {{- end -}} 28 | -------------------------------------------------------------------------------- /layouts/partials/helper/external.html: -------------------------------------------------------------------------------- 1 | {{- $List := index .Context.Site.Data.external .Namespace -}} 2 | {{- with $List -}} 3 | {{- range . -}} 4 | {{- if eq .type "script" -}} 5 | 14 | {{- else if eq .type "style" -}} 15 | 23 | {{- else -}} 24 | {{- errorf "Error: unknown external resource type: %s" .type -}} 25 | {{- end -}} 26 | {{- end -}} 27 | {{- else -}} 28 | {{- errorf "Error: external resource '%s' is not found" .Namespace -}} 29 | {{- end -}} -------------------------------------------------------------------------------- /assets/ts/createElement.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * createElement 3 | * Edited from: 4 | * @link https://stackoverflow.com/a/42405694 5 | */ 6 | function createElement(tag, attrs, children) { 7 | var element = document.createElement(tag); 8 | 9 | for (let name in attrs) { 10 | if (name && attrs.hasOwnProperty(name)) { 11 | let value = attrs[name]; 12 | 13 | if (name == "dangerouslySetInnerHTML") { 14 | element.innerHTML = value.__html; 15 | } 16 | else if (value === true) { 17 | element.setAttribute(name, name); 18 | } else if (value !== false && value != null) { 19 | element.setAttribute(name, value.toString()); 20 | } 21 | } 22 | } 23 | for (let i = 2; i < arguments.length; i++) { 24 | let child = arguments[i]; 25 | if (child) { 26 | element.appendChild( 27 | child.nodeType == null ? 28 | document.createTextNode(child.toString()) : child); 29 | } 30 | } 31 | return element; 32 | } 33 | 34 | export default createElement; -------------------------------------------------------------------------------- /layouts/partials/comments/provider/remark42.html: -------------------------------------------------------------------------------- 1 | {{- with .Site.Params.comments.remark42 -}} 2 |
3 | 29 | {{- end -}} 30 | -------------------------------------------------------------------------------- /exampleSite/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Steve Francia 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /layouts/page/search.json: -------------------------------------------------------------------------------- 1 | {{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}} 2 | {{- $notHidden := where .Site.RegularPages "Params.hidden" "!=" true -}} 3 | {{- $filtered := ($pages | intersect $notHidden) -}} 4 | 5 | {{- $result := slice -}} 6 | 7 | {{- range $filtered -}} 8 | {{- $data := dict "title" .Title "date" .Date "permalink" .Permalink "content" (.Plain) -}} 9 | 10 | {{- $image := partialCached "helper/image" (dict "Context" . "Type" "articleList") .RelPermalink "articleList" -}} 11 | {{- if $image.exists -}} 12 | {{- $imagePermalink := "" -}} 13 | {{- if and $image.resource (default true .Page.Site.Params.imageProcessing.cover.enabled) -}} 14 | {{- $thumbnail := $image.resource.Fill "120x120" -}} 15 | {{- $imagePermalink = (absURL $thumbnail.Permalink) -}} 16 | {{- else -}} 17 | {{- $imagePermalink = $image.permalink -}} 18 | {{- end -}} 19 | 20 | {{- $data = merge $data (dict "image" (absURL $imagePermalink)) -}} 21 | {{- end -}} 22 | 23 | {{- $result = $result | append $data -}} 24 | {{- end -}} 25 | 26 | {{ jsonify $result }} -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 13 | 14 | ## Describe the bug 15 | A clear and concise description of what the bug is. 16 | 17 | ## Expected behavior 18 | A clear and concise description of what you expected to happen. 19 | 20 | ## To Reproduce 21 | Indicate the steps to reproduce this bug, if applicable. 22 | 23 | ## Screenshots 24 | Add screenshots to help explain your problem. 25 | 26 | ## Environment 27 | 28 | - **Hugo version** [e.g: 0.80.0]: 29 | - **Hugo extended?**: Yes / No 30 | 31 | ## Additional context 32 | Add any other context about the problem here. 33 | 34 | If it's a UI issue, fill the following information: 35 | 36 | - OS: [e.g. iOS] 37 | - Browser [e.g. chrome, safari] 38 | - Version [e.g. 22] 39 | 40 | ## Content of config.yaml 41 | ```yaml 42 | ### Paste the content of the config file here 43 | ``` 44 | 45 | ## Link to the demo site and/or source repository 46 | -------------------------------------------------------------------------------- /layouts/partials/footer/footer.html: -------------------------------------------------------------------------------- 1 | {{- $ThemeVersion := "3.5.0" -}} 2 | 24 | -------------------------------------------------------------------------------- /i18n/nl.yaml: -------------------------------------------------------------------------------- 1 | toggleMenu: 2 | other: Open Menu 3 | 4 | darkMode: 5 | other: Donkere modus 6 | 7 | list: 8 | page: 9 | one: "{{ .Count }} pagina" 10 | other: "{{ .Count }} pagina's" 11 | 12 | section: 13 | other: Sectie 14 | 15 | subsection: 16 | one: Subsectie 17 | other: Subsecties 18 | 19 | article: 20 | relatedContents: 21 | other: Gerelateerde inhoud 22 | lastUpdatedOn: 23 | other: Laatst bijgewerkt op 24 | 25 | notFound: 26 | title: 27 | other: Niet gevonden 28 | subtitle: 29 | other: Deze pagina bestaat niet. 30 | 31 | widget: 32 | archives: 33 | title: 34 | other: Archief 35 | more: 36 | other: Meer 37 | tagCloud: 38 | title: 39 | other: Tags 40 | 41 | search: 42 | title: 43 | other: Zoeken 44 | placeholder: 45 | other: Typ iets 46 | resultTitle: 47 | other: "#PAGES_COUNT pagina's (#TIME_SECONDS seconden)" 48 | 49 | footer: 50 | builtWith: 51 | other: Gemaakt met {{ .Generator }} 52 | designedBy: 53 | other: Theme {{ .Theme }} ontworpen door {{ .DesignedBy }} 54 | -------------------------------------------------------------------------------- /i18n/tr.yaml: -------------------------------------------------------------------------------- 1 | toggleMenu: 2 | other: Menüyü Gizle 3 | 4 | darkMode: 5 | other: Koyu Mod 6 | 7 | list: 8 | page: 9 | one: "{{ .Count }} makale" 10 | other: "{{ .Count }} makale" 11 | 12 | section: 13 | other: Bölüm 14 | 15 | subsection: 16 | one: Alt bölüm 17 | other: Alt bölümler 18 | 19 | article: 20 | relatedContents: 21 | other: Alakalı içerikler 22 | lastUpdatedOn: 23 | other: Son güncelleme 24 | 25 | notFound: 26 | title: 27 | other: Bulunamadı 28 | subtitle: 29 | other: Aradığınız sayfa mevcut değil. 30 | 31 | widget: 32 | archives: 33 | title: 34 | other: Arşiv 35 | more: 36 | other: Daha fazla 37 | tagCloud: 38 | title: 39 | other: Etiketler 40 | 41 | search: 42 | title: 43 | other: Arama 44 | placeholder: 45 | other: Birşeyler yazın... 46 | resultTitle: 47 | other: "#PAGES_COUNT sayfa (#TIME_SECONDS saniye)" 48 | 49 | footer: 50 | builtWith: 51 | other: "{{ .Generator }} ile oluşturuldu." 52 | designedBy: 53 | other: "{{ .Theme }} teması {{ .DesignedBy }} tarafından tasarlandı" 54 | -------------------------------------------------------------------------------- /layouts/page/search.html: -------------------------------------------------------------------------------- 1 | {{ define "body-class" }}template-search{{ end }} 2 | {{ define "head" }} 3 | {{- with .OutputFormats.Get "json" -}} 4 | 5 | {{- end -}} 6 | {{ end }} 7 | {{ define "main" }} 8 |
9 |

10 | 11 | 12 |

13 | 14 | 17 |
18 | 19 |

20 |
21 | 22 | 25 | 26 | {{- $opts := dict "minify" hugo.IsProduction "JSXFactory" "createElement" -}} 27 | {{- $searchScript := resources.Get "ts/search.tsx" | js.Build $opts -}} 28 | 29 | 30 | {{ partialCached "footer/footer" . }} 31 | {{ end }} -------------------------------------------------------------------------------- /layouts/partials/comments/provider/utterances.html: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | 18 | 41 | -------------------------------------------------------------------------------- /layouts/partials/comments/provider/gitalk.html: -------------------------------------------------------------------------------- 1 | {{- with .Site.Params.comments.gitalk -}} 2 |
3 | 7 | 8 | 9 | 30 | {{ end }} 31 | -------------------------------------------------------------------------------- /layouts/partials/comments/provider/waline.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 14 | 15 | {{- with .Site.Params.comments.waline -}} 16 | {{- $config := dict "el" "#waline" "dark" `html[data-scheme="dark"]` -}} 17 | {{- $replaceKeys := dict "serverurl" "serverURL" "requiredmeta" "requiredMeta" "wordlimit" "wordLimit" "pagesize" "pageSize" "avatarcdn" "avatarCDN" "avatarforce" "avatarForce" -}} 18 | 19 | {{- range $key, $val := . -}} 20 | {{- if $val -}} 21 | {{- $replaceKey := index $replaceKeys $key -}} 22 | {{- $k := default $key $replaceKey -}} 23 | 24 | {{- $config = merge $config (dict $k $val) -}} 25 | {{- end -}} 26 | {{- end -}} 27 | 28 | 32 | {{- end -}} 33 | -------------------------------------------------------------------------------- /layouts/partials/data/title.html: -------------------------------------------------------------------------------- 1 | {{- $title := .Title -}} 2 | {{- $siteTitle := .Site.Title -}} 3 | 4 | {{- if .IsHome -}} 5 | 6 | 7 | 8 | {{ $pages := where .Site.RegularPages "Section" "in" .Site.Params.mainSections }} 9 | {{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }} 10 | {{ $filtered := ($pages | intersect $notHidden) }} 11 | {{ $pag := .Paginate ($filtered) }} 12 | 13 | {{ if .Paginator.HasPrev }} 14 | 15 | {{ $title = printf "%s - %s" .Paginator $siteTitle }} 16 | {{ else }} 17 | {{ $title = $siteTitle}} 18 | {{ end }} 19 | {{- else if eq .Kind "term" -}} 20 | 21 | 22 | 23 | {{ $notHidden := where .Pages "Params.hidden" "!=" true }} 24 | {{ $pag := .Paginate ($notHidden) }} 25 | 26 | 27 | {{ $title = slice (title .Data.Singular) ": " $title }} 28 | 29 | {{ if .Paginator.HasPrev }} 30 | 31 | {{ $title = $title | append " - " .Paginator }} 32 | {{ end }} 33 | 34 | {{ $title = $title | append " - " $siteTitle }} 35 | {{ $title = delimit $title "" }} 36 | {{- end -}} 37 | 38 | {{ return $title }} -------------------------------------------------------------------------------- /layouts/partials/pagination.html: -------------------------------------------------------------------------------- 1 | {{ if gt .Paginator.TotalPages 1 }} 2 | 26 | {{ end }} 27 | -------------------------------------------------------------------------------- /i18n/ko.yaml: -------------------------------------------------------------------------------- 1 | toggleMenu: 2 | other: 메뉴 여닫기 3 | 4 | darkMode: 5 | other: 다크 모드 6 | 7 | list: 8 | page: 9 | one: "{{ .Count }} 페이지" 10 | other: "{{ .Count }} 페이지" 11 | 12 | section: 13 | other: 섹션 14 | 15 | subsection: 16 | one: 서브섹션 17 | other: 서브섹션 18 | 19 | article: 20 | back: 21 | other: 뒤로가기 22 | 23 | tableOfContents: 24 | other: 목차 25 | 26 | relatedContents: 27 | other: 관련 글 28 | 29 | lastUpdatedOn: 30 | other: "마지막 수정: " 31 | 32 | readingTime: 33 | one: "{{ .Count }} 분 정도" 34 | other: "{{ .Count }} 분 정도" 35 | 36 | notFound: 37 | title: 38 | other: 찾을 수 없음 39 | 40 | subtitle: 41 | other: 페이지를 찾을 수 없습니다. 42 | 43 | widget: 44 | archives: 45 | title: 46 | other: 보관함 47 | more: 48 | other: 더보기 49 | 50 | tagCloud: 51 | title: 52 | other: 태그 53 | 54 | search: 55 | title: 56 | other: 검색 57 | 58 | placeholder: 59 | other: 검색어를 입력하세요... 60 | 61 | resultTitle: 62 | other: "#PAGES_COUNT 페이지 (#TIME_SECONDS 초)" 63 | 64 | footer: 65 | builtWith: 66 | other: "{{ .Generator }}로 만듦" 67 | designedBy: 68 | other: "{{ .DesignedBy }}의 {{ .Theme }} 테마 사용 중" 69 | -------------------------------------------------------------------------------- /layouts/_default/archives.html: -------------------------------------------------------------------------------- 1 | {{ define "body-class" }}template-archives{{ end }} 2 | {{ define "main" }} 3 | {{- $taxonomy := $.Site.GetPage "taxonomyTerm" "categories" -}} 4 | {{- $terms := $taxonomy.Pages -}} 5 | {{ if $terms }} 6 |

{{ $taxonomy.Title }}

7 |
8 |
9 | {{ range $terms }} 10 | {{ partial "article-list/tile" (dict "context" . "size" "250x150" "Type" "taxonomy") }} 11 | {{ end }} 12 |
13 |
14 | {{ end }} 15 | 16 | {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} 17 | {{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }} 18 | {{ $filtered := ($pages | intersect $notHidden) }} 19 | 20 | {{ range $filtered.GroupByDate "2006" }} 21 | {{ $id := lower (replace .Key " " "-") }} 22 |
23 |

{{ .Key }}

24 |
25 | {{ range .Pages }} 26 | {{ partial "article-list/compact" . }} 27 | {{ end }} 28 |
29 |
30 | {{ end }} 31 | 32 | {{ partialCached "footer/footer" . }} 33 | {{ end }} 34 | -------------------------------------------------------------------------------- /i18n/pt-BR.yaml: -------------------------------------------------------------------------------- 1 | toggleMenu: 2 | other: Alternar Menu 3 | 4 | darkMode: 5 | other: Modo Escuro 6 | 7 | list: 8 | page: 9 | one: "{{ .Count }} página" 10 | other: "{{ .Count }} páginas" 11 | 12 | section: 13 | other: Seção 14 | 15 | subsection: 16 | one: Subseção 17 | other: Subseções 18 | 19 | article: 20 | back: 21 | other: Voltar 22 | 23 | tableOfContents: 24 | other: Índice 25 | 26 | relatedContents: 27 | other: Conteúdo relacionado 28 | 29 | lastUpdatedOn: 30 | other: Última atualização em 31 | 32 | readingTime: 33 | one: "{{ .Count }} minuto de leitura" 34 | other: "{{ .Count }} minutos de leitura" 35 | 36 | notFound: 37 | title: 38 | other: Não Encontrado 39 | subtitle: 40 | other: Esta página não existe. 41 | 42 | widget: 43 | archives: 44 | title: 45 | other: Arquivos 46 | more: 47 | other: Mais 48 | tagCloud: 49 | title: 50 | other: Tags 51 | 52 | search: 53 | title: 54 | other: Busca 55 | placeholder: 56 | other: Digite algo... 57 | resultTitle: 58 | other: "#PAGES_COUNT páginas (#TIME_SECONDS segundos)" 59 | 60 | footer: 61 | builtWith: 62 | other: Criado com {{ .Generator }} 63 | designedBy: 64 | other: Tema {{ .Theme }} desenvolvido por {{ .DesignedBy }} 65 | -------------------------------------------------------------------------------- /i18n/en.yaml: -------------------------------------------------------------------------------- 1 | toggleMenu: 2 | other: Toggle Menu 3 | 4 | darkMode: 5 | other: Dark Mode 6 | 7 | list: 8 | page: 9 | one: "{{ .Count }} page" 10 | other: "{{ .Count }} pages" 11 | 12 | section: 13 | other: Section 14 | 15 | subsection: 16 | one: Subsection 17 | other: Subsections 18 | 19 | article: 20 | back: 21 | other: Back 22 | 23 | tableOfContents: 24 | other: Table of contents 25 | 26 | relatedContents: 27 | other: Related contents 28 | 29 | lastUpdatedOn: 30 | other: Last updated on 31 | 32 | readingTime: 33 | one: "{{ .Count }} minute read" 34 | other: "{{ .Count }} minute read" 35 | 36 | notFound: 37 | title: 38 | other: Not Found 39 | 40 | subtitle: 41 | other: This page does not exist 42 | 43 | widget: 44 | archives: 45 | title: 46 | other: Archives 47 | 48 | more: 49 | other: More 50 | 51 | tagCloud: 52 | title: 53 | other: Tags 54 | 55 | search: 56 | title: 57 | other: Search 58 | 59 | placeholder: 60 | other: Type something... 61 | 62 | resultTitle: 63 | other: "#PAGES_COUNT pages (#TIME_SECONDS seconds)" 64 | 65 | footer: 66 | builtWith: 67 | other: Built with {{ .Generator }} 68 | 69 | designedBy: 70 | other: Theme {{ .Theme }} designed by {{ .DesignedBy }} 71 | -------------------------------------------------------------------------------- /i18n/it.yaml: -------------------------------------------------------------------------------- 1 | toggleMenu: 2 | other: Toggle Menu 3 | 4 | darkMode: 5 | other: Dark Mode 6 | 7 | list: 8 | page: 9 | one: "{{ .Count }} pagina" 10 | other: "{{ .Count }} pagine" 11 | 12 | section: 13 | other: Sezione 14 | 15 | subsection: 16 | one: Sottosezione 17 | other: Sottosezioni 18 | 19 | article: 20 | back: 21 | other: Indietro 22 | 23 | tableOfContents: 24 | other: Indice 25 | 26 | relatedContents: 27 | other: Contenuti correlati 28 | 29 | lastUpdatedOn: 30 | other: Aggiornato il 31 | 32 | readingTime: 33 | one: "{{ .Count }} min per leggere" 34 | other: "{{ .Count }} min per leggere" 35 | 36 | notFound: 37 | title: 38 | other: Non trovato 39 | subtitle: 40 | other: Questa pagina non esiste. 41 | 42 | widget: 43 | archives: 44 | title: 45 | other: Archivi 46 | 47 | more: 48 | other: Di più 49 | 50 | tagCloud: 51 | title: 52 | other: Tags 53 | 54 | search: 55 | title: 56 | other: Cerca 57 | 58 | placeholder: 59 | other: Scrivi qualcosa... 60 | 61 | resultTitle: 62 | other: "#PAGES_COUNT pagine (#TIME_SECONDS secondi)" 63 | 64 | footer: 65 | builtWith: 66 | other: Realizzato con {{ .Generator }} 67 | 68 | designedBy: 69 | other: Tema {{ .Theme }} realizzato da {{ .DesignedBy }} 70 | -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | # Update the NODE_VERSION arg in docker-compose.yml to pick a Node version: 10, 12, 14 2 | ARG NODE_VERSION=14 3 | FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${NODE_VERSION} 4 | 5 | # VARIANT can be either 'hugo' for the standard version or 'hugo_extended' for the extended version. 6 | ARG VARIANT=hugo 7 | # VERSION can be either 'latest' or a specific version number 8 | ARG VERSION=latest 9 | 10 | # Download Hugo 11 | RUN apt-get update && apt-get install -y ca-certificates openssl git curl && \ 12 | rm -rf /var/lib/apt/lists/* && \ 13 | case ${VERSION} in \ 14 | latest) \ 15 | export VERSION=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') ;;\ 16 | esac && \ 17 | echo ${VERSION} && \ 18 | wget -O ${VERSION}.tar.gz https://github.com/gohugoio/hugo/releases/download/v${VERSION}/${VARIANT}_${VERSION}_Linux-64bit.tar.gz && \ 19 | tar xf ${VERSION}.tar.gz && \ 20 | mv hugo /usr/bin/hugo 21 | 22 | # Hugo dev server port 23 | EXPOSE 1313 24 | 25 | # [Optional] Uncomment this section to install additional OS packages you may want. 26 | # 27 | # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ 28 | # && apt-get -y install --no-install-recommends 29 | 30 | # [Optional] Uncomment if you want to install more global node packages 31 | # RUN sudo -u node npm install -g 32 | -------------------------------------------------------------------------------- /i18n/pl.yaml: -------------------------------------------------------------------------------- 1 | toggleMenu: 2 | other: Przełącz Menu 3 | 4 | darkMode: 5 | other: Tryb ciemny 6 | 7 | list: 8 | page: 9 | one: "{{ .Count }} strona" 10 | other: "{{ .Count }} stron" 11 | 12 | section: 13 | other: Sekcja 14 | 15 | subsection: 16 | one: Podsekcja 17 | other: Podsekcje 18 | 19 | article: 20 | back: 21 | other: Wróć 22 | 23 | tableOfContents: 24 | other: Spis treści 25 | 26 | relatedContents: 27 | other: Powiązane artykuły 28 | 29 | lastUpdatedOn: 30 | other: Ostatnio zaktualizowany 31 | 32 | readingTime: 33 | one: "Przeczytasz w {{ .Count }} minutę" 34 | other: "Przeczytasz w {{ .Count }} minut" 35 | 36 | notFound: 37 | title: 38 | other: Nie znaleziono 39 | subtitle: 40 | other: Ta strona nie istnieje 41 | 42 | widget: 43 | archives: 44 | title: 45 | other: Archiwum 46 | 47 | more: 48 | other: Więcej 49 | 50 | tagCloud: 51 | title: 52 | other: Tagi 53 | 54 | search: 55 | title: 56 | other: Szukaj 57 | 58 | placeholder: 59 | other: Wpisz coś... 60 | 61 | resultTitle: 62 | other: "#PAGES_COUNT stron (#TIME_SECONDS sekund)" 63 | 64 | footer: 65 | builtWith: 66 | other: Zbudowano z {{ .Generator }} 67 | 68 | designedBy: 69 | other: Motyw {{ .Theme }} zaprojektowany przez {{ .DesignedBy }} 70 | -------------------------------------------------------------------------------- /i18n/es.yaml: -------------------------------------------------------------------------------- 1 | toggleMenu: 2 | other: Toggle Menu 3 | 4 | darkMode: 5 | other: Modo oscuro 6 | 7 | list: 8 | page: 9 | one: "{{ .Count }} página" 10 | other: "{{ .Count }} páginas" 11 | 12 | section: 13 | other: Sección 14 | 15 | subsection: 16 | one: Subsección 17 | other: Subsecciones 18 | 19 | article: 20 | back: 21 | other: Volver 22 | 23 | tableOfContents: 24 | other: Tabla de contenido 25 | 26 | relatedContents: 27 | other: Contenidos relacionados 28 | 29 | lastUpdatedOn: 30 | other: Última vez actualizado 31 | 32 | readingTime: 33 | one: "{{ .Count }} minuto a leer" 34 | other: "{{ .Count }} minutos a leer" 35 | 36 | notFound: 37 | title: 38 | other: No Encontrado 39 | 40 | subtitle: 41 | other: Esta página no existe 42 | 43 | widget: 44 | archives: 45 | title: 46 | other: Archivo 47 | 48 | more: 49 | other: Más 50 | 51 | tagCloud: 52 | title: 53 | other: Etiquetas 54 | 55 | search: 56 | title: 57 | other: Búsqueda 58 | 59 | placeholder: 60 | other: Teclea algo... 61 | 62 | resultTitle: 63 | other: "#PAGES_COUNT páginas en (#TIME_SECONDS segundos)" 64 | 65 | footer: 66 | builtWith: 67 | other: Creado con {{ .Generator }} 68 | 69 | designedBy: 70 | other: Tema {{ .Theme }} diseñado por {{ .DesignedBy }} 71 | -------------------------------------------------------------------------------- /i18n/id.yaml: -------------------------------------------------------------------------------- 1 | toggleMenu: 2 | other: Tampilkan Menu 3 | 4 | darkMode: 5 | other: Mode Gelap 6 | 7 | list: 8 | page: 9 | one: "{{ .Count }} halaman" 10 | other: "{{ .Count }} halaman" 11 | 12 | section: 13 | other: Bagian 14 | 15 | subsection: 16 | one: Subbagian 17 | other: Subbagian 18 | 19 | article: 20 | back: 21 | other: Kembali 22 | 23 | tableOfContents: 24 | other: Daftar Isi 25 | 26 | relatedContents: 27 | other: Konten terkait 28 | 29 | lastUpdatedOn: 30 | other: Terakhir diperbarui pada 31 | 32 | readingTime: 33 | one: "Waktu Membaca: {{ .Count }} menit" 34 | other: "Waktu Membaca: {{ .Count }} menit" 35 | 36 | notFound: 37 | title: 38 | other: Tidak ditemukan 39 | subtitle: 40 | other: Halaman yang Anda akses tidak ditemukan. 41 | 42 | widget: 43 | archives: 44 | title: 45 | other: Arsip 46 | 47 | more: 48 | other: Lebih 49 | 50 | tagCloud: 51 | title: 52 | other: Tag 53 | 54 | search: 55 | title: 56 | other: Cari 57 | 58 | placeholder: 59 | other: Ketik sesuatu... 60 | 61 | resultTitle: 62 | other: "#PAGES_COUNT halaman (#TIME_SECONDS detik)" 63 | 64 | footer: 65 | builtWith: 66 | other: Dibangun dengan {{ .Generator }} 67 | 68 | designedBy: 69 | other: Tema {{ .Theme }} dirancang oleh {{ .DesignedBy }} 70 | -------------------------------------------------------------------------------- /i18n/uk.yaml: -------------------------------------------------------------------------------- 1 | toggleMenu: 2 | other: Показати меню 3 | 4 | darkMode: 5 | other: Темна тема 6 | 7 | list: 8 | page: 9 | one: "{{ .Count }} сторінка" 10 | few: "{{ .Count }} сторінки" 11 | other: "{{ .Count }} сторінок" 12 | 13 | section: 14 | other: Секція 15 | 16 | subsection: 17 | one: Підсекція 18 | other: Підсекції 19 | 20 | article: 21 | back: 22 | other: Назад 23 | 24 | tableOfContents: 25 | other: Зміст 26 | 27 | relatedContents: 28 | other: Схожі матеріали 29 | 30 | lastUpdatedOn: 31 | other: Востаннє оновлено 32 | 33 | readingTime: 34 | one: "Час читання: {{ .Count }} хв" 35 | other: "Час читання: {{ .Count }} хв" 36 | 37 | notFound: 38 | title: 39 | other: Не знайдено 40 | 41 | subtitle: 42 | other: Ця сторінка не існує 43 | 44 | widget: 45 | archives: 46 | title: 47 | other: Архіви 48 | 49 | more: 50 | other: Більше 51 | 52 | tagCloud: 53 | title: 54 | other: Теґи 55 | 56 | search: 57 | title: 58 | other: Пошук 59 | 60 | placeholder: 61 | other: Напишіть що-небудь... 62 | 63 | resultTitle: 64 | other: "#PAGES_COUNT сторінок (#TIME_SECONDS секунд)" 65 | 66 | footer: 67 | builtWith: 68 | other: Створено з {{ .Generator }} 69 | 70 | designedBy: 71 | other: Тема {{ .Theme }}, дизайн {{ .DesignedBy }} 72 | -------------------------------------------------------------------------------- /i18n/th.yaml: -------------------------------------------------------------------------------- 1 | toggleMenu: 2 | other: สลับเมนู 3 | 4 | darkMode: 5 | other: ธีมมืด 6 | 7 | list: 8 | page: 9 | one: "{{ .Count }} หน้า" 10 | other: "{{ .Count }} หน้า" 11 | 12 | section: 13 | other: หมวดหมู่ 14 | 15 | subsection: 16 | one: หมวดหมู่ย่อย 17 | other: หมวดหมู่ย่อยอื่นๆ 18 | 19 | article: 20 | back: 21 | other: กลับไป 22 | 23 | tableOfContents: 24 | other: สารบัญ 25 | 26 | relatedContents: 27 | other: เนื้อหาคล้ายคลึงกัน 28 | 29 | lastUpdatedOn: 30 | other: อัปเดตล่าสุดเมื่อ 31 | 32 | readingTime: 33 | one: "น่าจะใช้เวลา {{ .Count }} นาทีในการอ่าน" 34 | other: "น่าจะใช้เวลา {{ .Count }} นาทีในการอ่าน" 35 | 36 | notFound: 37 | title: 38 | other: ไม่พบหัวข้อ 39 | 40 | subtitle: 41 | other: ไม่พบหน้านี้ในระบบ 42 | 43 | widget: 44 | archives: 45 | title: 46 | other: เนื้อหาที่เก็บถาวรแล้ว 47 | 48 | more: 49 | other: อื่นๆ นอกจากนี้ 50 | 51 | tagCloud: 52 | title: 53 | other: แท็ก 54 | 55 | search: 56 | title: 57 | other: ค้นหา 58 | 59 | placeholder: 60 | other: พิมพ์เพื่อค้นหา ... 61 | 62 | resultTitle: 63 | other: "#PAGES_COUNT pages (#TIME_SECONDS seconds)" 64 | 65 | footer: 66 | builtWith: 67 | other: ถูกสร้างด้วย {{ .Generator }} 68 | 69 | designedBy: 70 | other: ธีม {{ .Theme }} ออกแบบโดย {{ .DesignedBy }} 71 | -------------------------------------------------------------------------------- /i18n/de.yaml: -------------------------------------------------------------------------------- 1 | toggleMenu: 2 | other: Menü umschalten 3 | 4 | darkMode: 5 | other: Dunkler Modus 6 | 7 | list: 8 | page: 9 | one: "{{ .Count }} Seite" 10 | other: "{{ .Count }} Seiten" 11 | 12 | section: 13 | other: Abschnitt 14 | 15 | subsection: 16 | one: Unterabschnitt 17 | other: Unterabschnitte 18 | 19 | article: 20 | back: 21 | other: Zurück 22 | 23 | tableOfContents: 24 | other: Inhaltsverzeichnis 25 | 26 | relatedContents: 27 | other: Verwandte Inhalte 28 | 29 | lastUpdatedOn: 30 | other: Zuletzt aktualisiert am 31 | 32 | readingTime: 33 | one: "{{ .Count }} Minute Lesezeit" 34 | other: "{{ .Count }} Minuten Lesezeit" 35 | 36 | notFound: 37 | title: 38 | other: Seite nicht gefunden 39 | 40 | subtitle: 41 | other: Diese Seite existiert nicht 42 | 43 | widget: 44 | archives: 45 | title: 46 | other: Archiv 47 | 48 | more: 49 | other: Weitere 50 | 51 | tagCloud: 52 | title: 53 | other: Schlagwörter 54 | 55 | search: 56 | title: 57 | other: Suche 58 | 59 | placeholder: 60 | other: Etwas tippen... 61 | 62 | resultTitle: 63 | other: "#PAGES_COUNT Seiten (#TIME_SECONDS Sekunden)" 64 | 65 | footer: 66 | builtWith: 67 | other: Erstellt mit {{ .Generator }} 68 | 69 | designedBy: 70 | other: Theme {{ .Theme }} gestaltet von {{ .DesignedBy }} 71 | -------------------------------------------------------------------------------- /i18n/fr.yaml: -------------------------------------------------------------------------------- 1 | toggleMenu: 2 | other: Afficher le menu 3 | 4 | darkMode: 5 | other: Mode sombre 6 | 7 | list: 8 | page: 9 | one: "{{ .Count }} page" 10 | other: "{{ .Count }} pages" 11 | 12 | section: 13 | other: Section 14 | 15 | subsection: 16 | one: Sous-section 17 | other: Sous-sections 18 | 19 | article: 20 | back: 21 | other: Retour 22 | 23 | tableOfContents: 24 | other: Table des matières 25 | 26 | relatedContents: 27 | other: Contenus liés 28 | 29 | lastUpdatedOn: 30 | other: Dernière mise à jour le 31 | 32 | readingTime: 33 | one: "{{ .Count }} minute de lecture" 34 | other: "{{ .Count }} minutes de lecture" 35 | 36 | notFound: 37 | title: 38 | other: Page non trouvée 39 | subtitle: 40 | other: Cette page n'existe pas. 41 | 42 | widget: 43 | archives: 44 | title: 45 | other: Archives 46 | 47 | more: 48 | other: Autres 49 | 50 | tagCloud: 51 | title: 52 | other: Mots clés 53 | 54 | search: 55 | title: 56 | other: Rechercher 57 | 58 | placeholder: 59 | other: Cherchez un article, une publication, etc. 60 | 61 | resultTitle: 62 | other: "#PAGES_COUNT pages (#TIME_SECONDS secondes)" 63 | 64 | footer: 65 | builtWith: 66 | other: Généré avec {{ .Generator }} 67 | 68 | designedBy: 69 | other: Thème {{ .Theme }} conçu par {{ .DesignedBy }} 70 | -------------------------------------------------------------------------------- /i18n/ru.yaml: -------------------------------------------------------------------------------- 1 | toggleMenu: 2 | other: Показать/скрыть меню 3 | 4 | darkMode: 5 | other: Тёмный режим 6 | 7 | list: 8 | page: 9 | one: "{{ .Count }} страница" 10 | few: "{{ .Count }} страницы" 11 | many: "{{ .Count }} страниц" 12 | other: "{{ .Count }} страниц" 13 | 14 | section: 15 | other: Раздел 16 | 17 | subsection: 18 | one: Подраздел 19 | few: Подразделы 20 | many: Подразделы 21 | other: Подразделы 22 | 23 | article: 24 | back: 25 | other: Назад 26 | relatedContents: 27 | other: Также рекомендуем 28 | lastUpdatedOn: 29 | other: Обновлено 30 | tableOfContents: 31 | other: Содержание 32 | readingTime: 33 | other: "Время чтения: {{ .Count }} мин." 34 | 35 | notFound: 36 | title: 37 | other: Не найдено 38 | subtitle: 39 | other: Запрашиваемая страница не существует 40 | 41 | widget: 42 | archives: 43 | title: 44 | other: Архивы 45 | more: 46 | other: Ещё 47 | tagCloud: 48 | title: 49 | other: Теги 50 | 51 | search: 52 | title: 53 | other: Поиск 54 | placeholder: 55 | other: Введите что-нибудь... 56 | resultTitle: 57 | other: "Найдено #PAGES_COUNT страниц (за #TIME_SECONDS с.)" 58 | 59 | footer: 60 | builtWith: 61 | other: Создано при помощи {{ .Generator }} 62 | designedBy: 63 | other: Тема {{ .Theme }}, дизайн {{ .DesignedBy }} 64 | -------------------------------------------------------------------------------- /layouts/partials/article/components/details.html: -------------------------------------------------------------------------------- 1 |
2 | {{ if .Params.categories }} 3 | 10 | {{ end }} 11 | 12 |

13 | 14 | {{- .Title -}} 15 | 16 |

17 | 18 | {{ with .Params.description }} 19 |

20 | {{ . }} 21 |

22 | {{ end }} 23 | 24 | {{ if or (not .Date.IsZero) (.Site.Params.article.readingTime) }} 25 |
26 | {{ if not .Date.IsZero }} 27 |
28 | {{ partial "helper/icon" "date" }} 29 | 32 |
33 | {{ end }} 34 | 35 | {{ if .Site.Params.article.readingTime }} 36 |
37 | {{ partial "helper/icon" "clock" }} 38 | 41 |
42 | {{ end }} 43 |
44 | {{ end }} 45 |
-------------------------------------------------------------------------------- /layouts/partials/comments/provider/twikoo.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 32 | 33 | {{- with .Site.Params.comments.twikoo -}} 34 | 49 | {{- end -}} 50 | -------------------------------------------------------------------------------- /i18n/el.yaml: -------------------------------------------------------------------------------- 1 | toggleMenu: 2 | other: Εναλλαγή Μενού 3 | 4 | darkMode: 5 | other: Σκοτεινό θέμα 6 | 7 | list: 8 | page: 9 | one: "{{ .Count }} σελιδα" 10 | other: "{{ .Count }} σελιδες" 11 | 12 | section: 13 | other: Ενότητα 14 | 15 | subsection: 16 | one: Υποενότητα 17 | other: Υποενότητες 18 | 19 | article: 20 | back: 21 | other: Πισω 22 | 23 | tableOfContents: 24 | other: Πινακας περιεχομενων 25 | 26 | relatedContents: 27 | other: Σχετικο περιεχομενο 28 | 29 | lastUpdatedOn: 30 | other: Τελευταια τροποποιηση στις 31 | 32 | readingTime: 33 | one: "{{ .Count }} λεπτό ανάγνωσης" 34 | ### Seems that there's no need to add 's' even if it's plural in English 35 | other: "{{ .Count }} λεπτά ανάγνωσης" 36 | 37 | notFound: 38 | title: 39 | other: Δε βρέθηκε 40 | subtitle: 41 | other: Η σελίδα δε βρέθηκε. 42 | 43 | widget: 44 | archives: 45 | title: 46 | other: Αρχειο 47 | 48 | more: 49 | other: Περισσότερα 50 | 51 | tagCloud: 52 | title: 53 | other: Tags 54 | 55 | search: 56 | title: 57 | other: Αναζήτηση 58 | 59 | placeholder: 60 | other: Πληκτρολογήστε κάτι... 61 | 62 | resultTitle: 63 | other: "#PAGES_COUNT σελιδες (#TIME_SECONDS δευτερολεπτα)" 64 | 65 | footer: 66 | builtWith: 67 | other: Δημιουργήθηκε με τη χρήση {{ .Generator }} 68 | 69 | designedBy: 70 | other: Το θέμα {{ .Theme }} σχεδιάστηκε από το {{ .DesignedBy }} 71 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: 2 | // https://github.com/microsoft/vscode-dev-containers/tree/v0.202.3/containers/hugo 3 | { 4 | "name": "Hugo (Community)", 5 | "build": { 6 | "dockerfile": "Dockerfile", 7 | "args": { 8 | // Update VARIANT to pick hugo variant. 9 | // Example variants: hugo, hugo_extended 10 | // Rebuild the container if it already exists to update. 11 | "VARIANT": "hugo_extended", 12 | // Update VERSION to pick a specific hugo version. 13 | // Example versions: latest, 0.73.0, 0,71.1 14 | // Rebuild the container if it already exists to update. 15 | "VERSION": "latest", 16 | // Update NODE_VERSION to pick the Node.js version: 12, 14 17 | "NODE_VERSION": "14", 18 | } 19 | }, 20 | 21 | // Set *default* container specific settings.json values on container create. 22 | "settings": { 23 | "html.format.templating": true, 24 | }, 25 | 26 | // Add the IDs of extensions you want installed when the container is created. 27 | "extensions": [ 28 | "bungcip.better-toml", 29 | "davidanson.vscode-markdownlint" 30 | ], 31 | 32 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 33 | "forwardPorts": [ 34 | 1313 35 | ], 36 | 37 | // Use 'postCreateCommand' to run commands after the container is created. 38 | // "postCreateCommand": "uname -a", 39 | 40 | // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. 41 | "remoteUser": "node", 42 | "features": { 43 | "golang": "latest" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /exampleSite/content/page/about.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: About 3 | description: Hugo, the world's fastest framework for building websites 4 | date: '2019-02-28' 5 | aliases: 6 | - about-us 7 | - about-hugo 8 | - contact 9 | license: CC BY-NC-ND 10 | lastmod: '2020-10-09' 11 | menu: 12 | main: 13 | weight: -90 14 | params: 15 | icon: user 16 | --- 17 | 18 | Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows. 19 | 20 | Hugo makes use of a variety of open source projects including: 21 | 22 | * https://github.com/yuin/goldmark 23 | * https://github.com/alecthomas/chroma 24 | * https://github.com/muesli/smartcrop 25 | * https://github.com/spf13/cobra 26 | * https://github.com/spf13/viper 27 | 28 | Hugo is ideal for blogs, corporate websites, creative portfolios, online magazines, single page applications or even a website with thousands of pages. 29 | 30 | Hugo is for people who want to hand code their own website without worrying about setting up complicated runtimes, dependencies and databases. 31 | 32 | Websites built with Hugo are extremelly fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider. 33 | 34 | Learn more and contribute on [GitHub](https://github.com/gohugoio). 35 | -------------------------------------------------------------------------------- /assets/scss/style.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Hugo Theme Stack 3 | * 4 | * @author: Jimmy Cai 5 | * @website: https://jimmycai.com 6 | * @link: https://github.com/CaiJimmy/hugo-theme-stack 7 | */ 8 | 9 | @import "breakpoints.scss"; 10 | @import "variables.scss"; 11 | @import "grid.scss"; 12 | 13 | @import "external/normalize.scss"; 14 | 15 | @import "partials/menu.scss"; 16 | @import "partials/article.scss"; 17 | @import "partials/widgets.scss"; 18 | @import "partials/footer.scss"; 19 | @import "partials/pagination.scss"; 20 | @import "partials/sidebar.scss"; 21 | @import "partials/base.scss"; 22 | @import "partials/layout/archives.scss"; 23 | @import "partials/layout/article.scss"; 24 | @import "partials/layout/list.scss"; 25 | @import "partials/layout/404.scss"; 26 | @import "partials/layout/search.scss"; 27 | 28 | @import "custom.scss"; 29 | 30 | a { 31 | text-decoration: none; 32 | color: var(--accent-color); 33 | 34 | &:hover { 35 | color: var(--accent-color-darker); 36 | } 37 | 38 | &.link { 39 | box-shadow: 0px -2px 0px rgba(var(--link-background-color), var(--link-background-opacity)) inset; 40 | transition: all 0.3s ease; 41 | 42 | &:hover { 43 | box-shadow: 0px -10px 0px rgba(var(--link-background-color), var(--link-background-opacity-hover)) inset; 44 | } 45 | } 46 | } 47 | 48 | .section-title { 49 | text-transform: uppercase; 50 | margin-top: 0; 51 | margin-bottom: 10px; 52 | display: block; 53 | font-size: 1.6rem; 54 | font-weight: bold; 55 | color: var(--body-text-color); 56 | 57 | a { 58 | color: var(--body-text-color); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /layouts/partials/head/colorScheme.html: -------------------------------------------------------------------------------- 1 | {{- $defaultColorScheme := default "auto" .Site.Params.colorScheme.default -}} 2 | {{- if not (default false .Site.Params.colorScheme.toggle) -}} 3 | {{/* If toggle is disabled, force default scheme */}} 4 | 10 | {{- else -}} 11 | {{/* Otherwise set to default scheme only if no preference is set by user */}} 12 | 20 | {{- end -}} 21 | 22 | 40 | -------------------------------------------------------------------------------- /data/external.yaml: -------------------------------------------------------------------------------- 1 | Vibrant: 2 | - src: https://cdn.jsdelivr.net/npm/node-vibrant@3.1.5/dist/vibrant.min.js 3 | integrity: sha256-5NovOZc4iwiAWTYIFiIM7DxKUXKWvpVEuMEPLzcm5/g= 4 | type: script 5 | 6 | PhotoSwipe: 7 | - src: https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js 8 | integrity: sha256-ePwmChbbvXbsO02lbM3HoHbSHTHFAeChekF1xKJdleo= 9 | type: script 10 | defer: true 11 | 12 | - src: https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js 13 | integrity: sha256-UKkzOn/w1mBxRmLLGrSeyB4e1xbrp4xylgAWb3M42pU= 14 | type: script 15 | defer: true 16 | 17 | - src: https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.css 18 | integrity: sha256-c0uckgykQ9v5k+IqViZOZKc47Jn7KQil4/MP3ySA3F8= 19 | type: style 20 | 21 | - src: https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.css 22 | integrity: sha256-SBLU4vv6CA6lHsZ1XyTdhyjJxCjPif/TRkjnsyGAGnE= 23 | type: style 24 | 25 | KaTeX: 26 | - src: https://cdn.jsdelivr.net/npm/katex@0.13.13/dist/katex.min.css 27 | integrity: sha384-RZU/ijkSsFbcmivfdRBQDtwuwVqK7GMOw6IMvKyeWL2K5UAlyp6WonmB8m7Jd0Hn 28 | type: style 29 | 30 | - src: https://cdn.jsdelivr.net/npm/katex@0.13.13/dist/katex.min.js 31 | integrity: sha384-pK1WpvzWVBQiP0/GjnvRxV4mOb0oxFuyRxJlk6vVw146n3egcN5C925NCP7a7BY8 32 | type: script 33 | defer: true 34 | 35 | - src: https://cdn.jsdelivr.net/npm/katex@0.13.13/dist/contrib/auto-render.min.js 36 | integrity: sha384-vZTG03m+2yp6N6BNi5iM4rW4oIwk5DfcNdFfxkk9ZWpDriOkXX8voJBFrAO7MpVl 37 | type: script 38 | defer: true 39 | -------------------------------------------------------------------------------- /layouts/partials/widget/archives.html: -------------------------------------------------------------------------------- 1 | {{- $query := first 1 (where .Site.Pages "Layout" "==" "archives") -}} 2 | {{- if $query -}} 3 | {{- $archivesPage := index $query 0 -}} 4 |
5 |
6 | {{ partial "helper/icon" "infinity" }} 7 |
8 |

{{ T "widget.archives.title" }}

9 | 10 | {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} 11 | {{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }} 12 | {{ $filtered := ($pages | intersect $notHidden) }} 13 | {{ $archives := $filtered.GroupByDate "2006" }} 14 | 15 |
16 | {{ range $index, $item := first (add .Site.Params.widgets.archives.limit 1) ($archives) }} 17 | {{- $id := lower (replace $item.Key " " "-") -}} 18 | 28 | {{ end }} 29 |
30 |
31 | {{- else -}} 32 | {{- warnf "Archives page not found. Create a page with layout: archives." -}} 33 | {{- end -}} -------------------------------------------------------------------------------- /layouts/partials/comments/provider/giscus.html: -------------------------------------------------------------------------------- 1 | {{- with .Site.Params.comments.giscus -}} 2 | 15 | 48 | {{- end -}} 49 | 50 | -------------------------------------------------------------------------------- /layouts/_default/_markup/render-image.html: -------------------------------------------------------------------------------- 1 | {{- $image := .Page.Resources.GetMatch (printf "%s" (.Destination | safeURL)) -}} 2 | {{- $Permalink := .Destination | relURL | safeURL -}} 3 | {{- $alt := .PlainText | safeHTML -}} 4 | {{- $Width := 0 -}} 5 | {{- $Height := 0 -}} 6 | {{- $Srcset := "" -}} 7 | 8 | {{/* SVG and external images won't work with gallery layout, because their width and height attributes are unknown */}} 9 | {{- $galleryImage := false -}} 10 | 11 | {{- if $image -}} 12 | {{- $notSVG := ne (path.Ext .Destination) ".svg" -}} 13 | {{- $Permalink = $image.RelPermalink -}} 14 | 15 | {{- if $notSVG -}} 16 | {{- $Width = $image.Width -}} 17 | {{- $Height = $image.Height -}} 18 | {{- $galleryImage = true -}} 19 | 20 | {{- if (default true .Page.Site.Params.imageProcessing.content.enabled) -}} 21 | {{- $small := $image.Resize `480x` -}} 22 | {{- $big := $image.Resize `1024x` -}} 23 | {{- $Srcset = printf `%s 480w, %s 1024w` $small.RelPermalink $big.RelPermalink -}} 24 | {{- end -}} 25 | {{- end -}} 26 | {{- end -}} 27 | 28 | -------------------------------------------------------------------------------- /layouts/partials/head/opengraph/provider/base.html: -------------------------------------------------------------------------------- 1 | {{- $title := partialCached "data/title" . .RelPermalink -}} 2 | {{- $description := partialCached "data/description" . .RelPermalink -}} 3 | 4 | 5 | 6 | 7 | 8 | 15 | 16 | {{- with .Params.locale -}} 17 | 18 | {{- end -}} 19 | 20 | {{- if .IsPage -}} 21 | 22 | {{- range .Params.tags -}} 23 | 24 | {{- end -}} 25 | {{- end -}} 26 | 27 | {{- if .IsPage -}} 28 | {{- if not .Date.IsZero -}} 29 | 30 | {{- end -}} 31 | {{- if not .Lastmod.IsZero -}} 32 | 33 | {{- end -}} 34 | {{- else -}} 35 | {{- if not .Site.LastChange.IsZero -}} 36 | 37 | {{- end -}} 38 | {{- end -}} 39 | 40 | {{ $image := partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" }} 41 | {{- if $image.exists -}} 42 | 43 | {{- end -}} -------------------------------------------------------------------------------- /assets/scss/partials/widgets.scss: -------------------------------------------------------------------------------- 1 | .widget { 2 | .widget-icon { 3 | svg { 4 | width: 32px; 5 | height: 32px; 6 | stroke-width: 1.6; 7 | color: var(--body-text-color); 8 | } 9 | } 10 | } 11 | 12 | /* Tag cloud widget */ 13 | .tagCloud { 14 | .tagCloud-tags { 15 | display: flex; 16 | flex-wrap: wrap; 17 | 18 | a { 19 | background: var(--card-background); 20 | box-shadow: var(--shadow-l1); 21 | border-radius: var(--tag-border-radius); 22 | padding: 8px 20px; 23 | 24 | color: var(--card-text-color-main); 25 | margin-bottom: 10px; 26 | margin-right: 5px; 27 | font-size: 1.4rem; 28 | transition: box-shadow 0.3s ease; 29 | 30 | &:hover { 31 | box-shadow: var(--shadow-l2); 32 | } 33 | } 34 | } 35 | } 36 | 37 | /* Archives widget */ 38 | .widget.archives { 39 | .widget-archive--list { 40 | border-radius: var(--card-border-radius); 41 | box-shadow: var(--shadow-l1); 42 | background-color: var(--card-background); 43 | } 44 | 45 | .archives-year { 46 | &:not(:last-of-type) { 47 | border-bottom: 1.5px solid var(--card-separator-color); 48 | } 49 | 50 | a { 51 | font-size: 1.4rem; 52 | padding: 18px 25px; 53 | display: flex; 54 | 55 | span.year { 56 | flex: 1; 57 | color: var(--card-text-color-main); 58 | font-weight: bold; 59 | } 60 | 61 | span.count { 62 | color: var(--card-text-color-tertiary); 63 | } 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /layouts/partials/article/components/header.html: -------------------------------------------------------------------------------- 1 |
2 | {{- $image := partialCached "helper/image" (dict "Context" . "Type" "article") .RelPermalink "article" -}} 3 | {{ if $image.exists }} 4 |
5 | 6 | {{ if $image.resource }} 7 | {{- $Permalink := $image.resource.RelPermalink -}} 8 | {{- $Width := $image.resource.Width -}} 9 | {{- $Height := $image.resource.Height -}} 10 | {{- $Srcset := "" -}} 11 | 12 | {{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}} 13 | {{- $thumbnail := $image.resource.Resize "800x" -}} 14 | {{- $thumbnailRetina := $image.resource.Resize "1600x" -}} 15 | {{- $Srcset = printf "%s 800w, %s 1600w" $thumbnail.RelPermalink $thumbnailRetina.RelPermalink -}} 16 | {{- $Permalink = $thumbnail.RelPermalink -}} 17 | {{- $Width = $thumbnail.Width -}} 18 | {{- $Height = $thumbnail.Height -}} 19 | {{- end -}} 20 | 21 | Featured image of post {{ .Title }} 27 | {{ else }} 28 | Featured image of post {{ .Title }} 29 | {{ end }} 30 | 31 |
32 | {{ end }} 33 | 34 | {{ partialCached "article/components/details" . .RelPermalink }} 35 |
-------------------------------------------------------------------------------- /layouts/partials/article-list/compact.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |

5 | {{- .Title -}} 6 |

7 |
8 | 11 |
12 |
13 | 14 | {{- $image := partialCached "helper/image" (dict "Context" . "Type" "articleList") .RelPermalink "articleList" -}} 15 | {{ if $image.exists }} 16 |
17 | {{ if $image.resource }} 18 | {{- $Permalink := $image.resource.RelPermalink -}} 19 | {{- $Width := $image.resource.Width -}} 20 | {{- $Height := $image.resource.Height -}} 21 | 22 | {{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}} 23 | {{- $thumbnail := $image.resource.Fill "120x120" -}} 24 | {{- $Permalink = $thumbnail.RelPermalink -}} 25 | {{- $Width = $thumbnail.Width -}} 26 | {{- $Height = $thumbnail.Height -}} 27 | {{- end -}} 28 | 29 | {{ .Title }} 34 | {{ else }} 35 | Featured image of post {{ .Title }} 36 | {{ end }} 37 |
38 | {{ end }} 39 |
40 |
-------------------------------------------------------------------------------- /assets/scss/partials/layout/list.scss: -------------------------------------------------------------------------------- 1 | .section-card { 2 | border-radius: var(--card-border-radius); 3 | background-color: var(--card-background); 4 | padding: var(--small-card-padding); 5 | box-shadow: var(--shadow-l1); 6 | margin-bottom: var(--section-separation); 7 | display: flex; 8 | align-items: center; 9 | 10 | --separation: 15px; 11 | 12 | .section-term { 13 | font-size: 2.2rem; 14 | margin: 0; 15 | margin-top: calc(var(--separation) / 2); 16 | color: var(--card-text-color-main); 17 | 18 | & + .section-description { 19 | margin-top: var(--separation); 20 | } 21 | } 22 | 23 | .section-description { 24 | font-weight: normal; 25 | color: var(--card-text-color-secondary); 26 | font-size: 1.6rem; 27 | margin: 0; 28 | } 29 | 30 | .section-details { 31 | flex-grow: 1; 32 | margin-right: 20px; 33 | } 34 | 35 | .section-image { 36 | img { 37 | width: 60px; 38 | height: 60px; 39 | } 40 | } 41 | 42 | .section-count { 43 | color: var(--card-text-color-tertiary); 44 | font-size: 1.4rem; 45 | margin: 0; 46 | font-weight: bold; 47 | text-transform: uppercase; 48 | } 49 | } 50 | 51 | .subsection-list { 52 | margin-bottom: var(--section-separation); 53 | overflow-x: auto; 54 | 55 | .article-list--tile { 56 | display: flex; 57 | padding-bottom: 15px; 58 | 59 | article { 60 | width: 250px; 61 | height: 150px; 62 | margin-right: 20px; 63 | flex-shrink: 0; 64 | 65 | .article-title { 66 | margin: 0; 67 | font-size: 1.8rem; 68 | } 69 | 70 | .article-details { 71 | padding: 20px; 72 | } 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /.github/workflows/hugo-artifact.yml: -------------------------------------------------------------------------------- 1 | name: Build Hugo Artifact 2 | 3 | # Controls when the action will run. 4 | on: 5 | # Triggers the workflow on push or pull request events but only for the master branch 6 | push: 7 | branches: [master] 8 | 9 | # Allows you to run this workflow manually from the Actions tab 10 | workflow_dispatch: 11 | 12 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 13 | jobs: 14 | # This workflow contains a single job called "build" 15 | build: 16 | # The type of runner that the job will run on 17 | runs-on: ubuntu-latest 18 | 19 | # Steps represent a sequence of tasks that will be executed as part of the job 20 | steps: 21 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 22 | - uses: actions/checkout@v2 23 | 24 | - name: Hugo setup 25 | uses: peaceiris/actions-hugo@v2.4.13 26 | with: 27 | # The Hugo version to download (if necessary) and use. Example: 0.58.2 28 | hugo-version: latest # optional, default is latest 29 | # Download (if necessary) and use Hugo extended version. Example: true 30 | extended: true # optional, default is false 31 | 32 | # Runs a set of commands using the runners shell 33 | - name: Generate Hugo site 34 | run: cd exampleSite && hugo --gc --themesDir ../.. 35 | 36 | - name: Upload Hugo artifact 37 | uses: actions/upload-artifact@v2.2.2 38 | with: 39 | # Artifact name 40 | name: resources 41 | # A file, directory or wildcard pattern that describes what to upload 42 | path: | 43 | exampleSite/resources 44 | !exampleSite/resources/_gen/images 45 | -------------------------------------------------------------------------------- /layouts/partials/article-list/tile.html: -------------------------------------------------------------------------------- 1 | {{ $image := partialCached "helper/image" (dict "Context" .context "Type" .Type) .context.RelPermalink .Type }} 2 |
3 | 4 | 5 | {{ if $image.exists }} 6 |
7 | {{ if $image.resource }} 8 | {{- $imageRaw := $image.resource | resources.Fingerprint "md5" -}} 9 | {{- $Permalink := $imageRaw.RelPermalink -}} 10 | {{- $Width := $imageRaw.Width -}} 11 | {{- $Height := $imageRaw.Height -}} 12 | 13 | {{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}} 14 | {{- $thumbnail := $imageRaw.Fill .size -}} 15 | {{- $Permalink = $thumbnail.RelPermalink -}} 16 | {{- $Width = $thumbnail.Width -}} 17 | {{- $Height = $thumbnail.Height -}} 18 | {{- end -}} 19 | 20 | Featured image of post {{ .context.Title }} 27 | {{ else }} 28 | 29 | {{ end }} 30 |
31 | {{ end }} 32 | 33 |
34 |

35 | {{- .context.Title -}} 36 |

37 |
38 |
39 |
-------------------------------------------------------------------------------- /assets/ts/color.ts: -------------------------------------------------------------------------------- 1 | interface colorScheme { 2 | hash: string, /// Regenerate color scheme when the image hash is changed 3 | DarkMuted: { 4 | hex: string, 5 | rgb: Number[], 6 | bodyTextColor: string 7 | }, 8 | Vibrant: { 9 | hex: string, 10 | rgb: Number[], 11 | bodyTextColor: string 12 | } 13 | } 14 | 15 | let colorsCache: { [key: string]: colorScheme } = {}; 16 | 17 | if (localStorage.hasOwnProperty('StackColorsCache')) { 18 | try { 19 | colorsCache = JSON.parse(localStorage.getItem('StackColorsCache')); 20 | } 21 | catch (e) { 22 | colorsCache = {}; 23 | } 24 | } 25 | 26 | async function getColor(key: string, hash: string, imageURL: string) { 27 | if (!key) { 28 | /** 29 | * If no key is provided, do not cache the result 30 | */ 31 | return await Vibrant.from(imageURL).getPalette(); 32 | } 33 | 34 | if (!colorsCache.hasOwnProperty(key) || colorsCache[key].hash !== hash) { 35 | /** 36 | * If key is provided, but not found in cache, or the hash mismatches => Regenerate color scheme 37 | */ 38 | const palette = await Vibrant.from(imageURL).getPalette(); 39 | 40 | colorsCache[key] = { 41 | hash: hash, 42 | Vibrant: { 43 | hex: palette.Vibrant.hex, 44 | rgb: palette.Vibrant.rgb, 45 | bodyTextColor: palette.Vibrant.bodyTextColor 46 | }, 47 | DarkMuted: { 48 | hex: palette.DarkMuted.hex, 49 | rgb: palette.DarkMuted.rgb, 50 | bodyTextColor: palette.DarkMuted.bodyTextColor 51 | } 52 | } 53 | 54 | /* Save the result in localStorage */ 55 | localStorage.setItem('StackColorsCache', JSON.stringify(colorsCache)); 56 | } 57 | 58 | return colorsCache[key]; 59 | } 60 | 61 | export { 62 | getColor 63 | } -------------------------------------------------------------------------------- /assets/scss/partials/layout/search.scss: -------------------------------------------------------------------------------- 1 | .search-form { 2 | margin-bottom: var(--section-separation); 3 | position: relative; 4 | --button-size: 80px; 5 | 6 | &.widget { 7 | --button-size: 60px; 8 | 9 | label { 10 | font-size: 1.3rem; 11 | top: 10px; 12 | } 13 | 14 | input { 15 | font-size: 1.5rem; 16 | padding: 30px 20px 15px 20px; 17 | } 18 | } 19 | 20 | p { 21 | position: relative; 22 | margin: 0; 23 | } 24 | 25 | label { 26 | position: absolute; 27 | top: 15px; 28 | left: 20px; 29 | font-size: 1.4rem; 30 | color: var(--card-text-color-tertiary); 31 | } 32 | 33 | input { 34 | padding: 40px 20px 20px; 35 | border-radius: var(--card-border-radius); 36 | background-color: var(--card-background); 37 | box-shadow: var(--shadow-l1); 38 | color: var(--card-text-color-main); 39 | width: 100%; 40 | border: 0; 41 | -webkit-appearance: none; 42 | 43 | transition: box-shadow 0.3s ease; 44 | 45 | font-size: 1.8rem; 46 | 47 | &:focus { 48 | outline: 0; 49 | box-shadow: var(--shadow-l2); 50 | } 51 | } 52 | 53 | button { 54 | position: absolute; 55 | right: 0; 56 | top: 0; 57 | height: 100%; 58 | width: var(--button-size); 59 | cursor: pointer; 60 | background-color: transparent; 61 | border: 0; 62 | 63 | padding: 0 10px; 64 | 65 | &:focus { 66 | outline: 0; 67 | 68 | svg { 69 | stroke-width: 2; 70 | color: var(--accent-color); 71 | } 72 | } 73 | 74 | svg { 75 | color: var(--card-text-color-secondary); 76 | stroke-width: 1.33; 77 | transition: all 0.3s ease; 78 | width: 20px; 79 | height: 20px; 80 | } 81 | } 82 | } -------------------------------------------------------------------------------- /layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{ define "body-class" }} 2 | {{ $TOCEnabled := default (default false .Site.Params.article.toc) .Params.toc }} 3 | {{- .Scratch.Set "hasTOC" (and (ge (len .TableOfContents) 100) $TOCEnabled) -}} 4 | article-page {{ if (.Scratch.Get "hasTOC") }}has-toc{{ end }} 5 | {{ end }} 6 | 7 | {{ define "container-class" }} 8 | {{ if (.Scratch.Get "hasTOC") }} 9 | extended 10 | {{ else }} 11 | on-phone--column {{ if .Site.Params.widgets.enabled }}extended{{ else }}compact{{ end }} 12 | {{ end }} 13 | {{ end }} 14 | 15 | {{ define "main" }} 16 | {{ partial "article/article.html" . }} 17 | 18 | {{ partial "article/components/related-contents" . }} 19 | 20 | {{ if not (eq .Params.comments false) }} 21 | {{ partial "comments/include" . }} 22 | {{ end }} 23 | 24 | {{ partialCached "footer/footer" . }} 25 | 26 | {{ partialCached "article/components/photoswipe" . }} 27 | {{ end }} 28 | 29 | {{ define "left-sidebar" }} 30 | {{ if (.Scratch.Get "hasTOC") }} 31 |
32 | 33 | {{ (resources.Get "icons/back.svg").Content | safeHTML }} 34 | {{ T "article.back" }} 35 | 36 |
37 | {{ else }} 38 | {{ partial "sidebar/left.html" . }} 39 | {{ end }} 40 | {{ end }} 41 | 42 | {{ define "right-sidebar" }} 43 | {{ if (.Scratch.Get "hasTOC") }} 44 | 56 | {{ end }} 57 | {{ end }} 58 | -------------------------------------------------------------------------------- /exampleSite/content/post/emoji-support/index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "Hugo Authors" 3 | title = "Emoji Support" 4 | date = "2019-03-05" 5 | description = "Guide to emoji usage in Hugo" 6 | categories = [ 7 | "Test" 8 | ] 9 | tags = [ 10 | "emoji", 11 | ] 12 | image = "the-creative-exchange-d2zvqp3fpro-unsplash.jpg" 13 | +++ 14 | 15 | Emoji can be enabled in a Hugo project in a number of ways. 16 | 17 | The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes). 18 | 19 | To enable emoji globally, set `enableEmoji` to `true` in your site's [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g. 20 | 21 |

🙈 :see_no_evil: 🙉 :hear_no_evil: 🙊 :speak_no_evil:

22 |
23 | 24 | The [Emoji cheat sheet](http://www.emoji-cheat-sheet.com/) is a useful reference for emoji shorthand codes. 25 | 26 | *** 27 | 28 | **N.B.** The above steps enable Unicode Standard emoji characters and sequences in Hugo, however the rendering of these glyphs depends on the browser and the platform. To style the emoji you can either use a third party emoji font or a font stack; e.g. 29 | 30 | {{< highlight html >}} 31 | .emoji { 32 | font-family: Apple Color Emoji, Segoe UI Emoji, NotoColorEmoji, Segoe UI Symbol, Android Emoji, EmojiSymbols; 33 | } 34 | {{< /highlight >}} 35 | 36 | {{< css.inline >}} 37 | 50 | {{< /css.inline >}} 51 | -------------------------------------------------------------------------------- /exampleSite/content/post/chinese-test/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Chinese Test 3 | description: 这是一个副标题 4 | date: 2020-09-09 5 | slug: test-chinese 6 | image: helena-hertz-wWZzXlDpMog-unsplash.jpg 7 | categories: 8 | - Test 9 | - 测试 10 | --- 11 | 12 | ## 正文测试 13 | 14 | 而这些并不是完全重要,更加重要的问题是, 带着这些问题,我们来审视一下学生会退会。 既然如何, 对我个人而言,学生会退会不仅仅是一个重大的事件,还可能会改变我的人生。 我们不得不面对一个非常尴尬的事实,那就是, 可是,即使是这样,学生会退会的出现仍然代表了一定的意义。 学生会退会,发生了会如何,不发生又会如何。 经过上述讨论, 生活中,若学生会退会出现了,我们就不得不考虑它出现了的事实。 学生会退会,到底应该如何实现。 这样看来, 在这种困难的抉择下,本人思来想去,寝食难安。 对我个人而言,学生会退会不仅仅是一个重大的事件,还可能会改变我的人生。 就我个人来说,学生会退会对我的意义,不能不说非常重大。 莎士比亚曾经提到过,人的一生是短的,但如果卑劣地过这一生,就太长了。这似乎解答了我的疑惑。 莫扎特说过一句富有哲理的话,谁和我一样用功,谁就会和我一样成功。这启发了我, 对我个人而言,学生会退会不仅仅是一个重大的事件,还可能会改变我的人生。 学生会退会,到底应该如何实现。 一般来说, 从这个角度来看, 这种事实对本人来说意义重大,相信对这个世界也是有一定意义的。 在这种困难的抉择下,本人思来想去,寝食难安。 了解清楚学生会退会到底是一种怎么样的存在,是解决一切问题的关键。 一般来说, 生活中,若学生会退会出现了,我们就不得不考虑它出现了的事实。 问题的关键究竟为何? 而这些并不是完全重要,更加重要的问题是。 15 | 16 | 奥斯特洛夫斯基曾经说过,共同的事业,共同的斗争,可以使人们产生忍受一切的力量。 带着这句话,我们还要更加慎重的审视这个问题: 一般来讲,我们都必须务必慎重的考虑考虑。 既然如此, 这种事实对本人来说意义重大,相信对这个世界也是有一定意义的。 带着这些问题,我们来审视一下学生会退会。 我认为, 我认为, 在这种困难的抉择下,本人思来想去,寝食难安。 问题的关键究竟为何? 每个人都不得不面对这些问题。 在面对这种问题时, 要想清楚,学生会退会,到底是一种怎么样的存在。 我认为, 既然如此, 每个人都不得不面对这些问题。 在面对这种问题时, 那么, 我认为, 学生会退会因何而发生。 17 | 18 | ## 引用 19 | 20 | > 思念是最暖的忧伤像一双翅膀 21 | > 让我停不了飞不远在过往游荡 22 | > 不告而别的你 就算为了我着想 23 | > 这么沉痛的呵护 我怎么能翱翔 24 | > 25 | > *[最暖的憂傷 - 田馥甄](https://www.youtube.com/watch?v=3aypp_YlBzI)* 26 | 27 | ## 图片 28 | 29 | ![Photo by Florian Klauer on Unsplash](florian-klauer-nptLmg6jqDo-unsplash.jpg) ![Photo by Luca Bravo on Unsplash](luca-bravo-alS7ewQ41M8-unsplash.jpg) 30 | 31 | ![Photo by Helena Hertz on Unsplash](helena-hertz-wWZzXlDpMog-unsplash.jpg) ![Photo by Hudai Gayiran on Unsplash](hudai-gayiran-3Od_VKcDEAA-unsplash.jpg) 32 | 33 | ```markdown 34 | ![Photo by Florian Klauer on Unsplash](florian-klauer-nptLmg6jqDo-unsplash.jpg) ![Photo by Luca Bravo on Unsplash](luca-bravo-alS7ewQ41M8-unsplash.jpg) 35 | 36 | ![Photo by Helena Hertz on Unsplash](helena-hertz-wWZzXlDpMog-unsplash.jpg) ![Photo by Hudai Gayiran on Unsplash](hudai-gayiran-3Od_VKcDEAA-unsplash.jpg) 37 | ``` 38 | 39 | 相册语法来自 [Typlog](https://typlog.com/) -------------------------------------------------------------------------------- /exampleSite/content/post/math-typesetting/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: Hugo Authors 3 | title: Math Typesetting 4 | date: 2019-03-08 5 | description: A brief guide to setup KaTeX 6 | math: true 7 | --- 8 | 9 | Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries. 10 | 11 | 12 | In this example we will be using [KaTeX](https://katex.org/) 13 | 14 | - Create a partial under `/layouts/partials/math.html` 15 | - Within this partial reference the [Auto-render Extension](https://katex.org/docs/autorender.html) or host these scripts locally. 16 | - Include the partial in your templates like so: 17 | 18 | ```bash 19 | {{ if or .Params.math .Site.Params.math }} 20 | {{ partial "math.html" . }} 21 | {{ end }} 22 | ``` 23 | 24 | - To enable KaTex globally set the parameter `math` to `true` in a project's configuration 25 | - To enable KaTex on a per page basis include the parameter `math: true` in content files 26 | 27 | **Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html) 28 | 29 | {{< math.inline >}} 30 | {{ if or .Page.Params.math .Site.Params.math }} 31 | 32 | 33 | 34 | 35 | {{ end }} 36 | {{}} 37 | 38 | ### Examples 39 | 40 | {{< math.inline >}} 41 |

42 | Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\) 43 |

44 | {{}} 45 | 46 | Block math: 47 | $$ 48 | \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } 49 | $$ 50 | -------------------------------------------------------------------------------- /assets/scss/grid.scss: -------------------------------------------------------------------------------- 1 | .container { 2 | margin-left: auto; 3 | margin-right: auto; 4 | 5 | .left-sidebar { 6 | max-width: var(--left-sidebar-max-width); 7 | } 8 | 9 | .right-sidebar { 10 | max-width: var(--right-sidebar-max-width); 11 | 12 | /// Display right sidebar when min-width: lg 13 | @include respond(lg) { 14 | display: block; 15 | } 16 | } 17 | 18 | &.extended { 19 | @include respond(md) { 20 | max-width: 1024px; 21 | --left-sidebar-max-width: 25%; 22 | --right-sidebar-max-width: 30%; 23 | } 24 | 25 | @include respond(lg) { 26 | max-width: 1280px; 27 | --left-sidebar-max-width: 20%; 28 | --right-sidebar-max-width: 30%; 29 | } 30 | 31 | @include respond(xl) { 32 | max-width: 1536px; 33 | --left-sidebar-max-width: 15%; 34 | --right-sidebar-max-width: 25%; 35 | } 36 | } 37 | 38 | &.compact { 39 | @include respond(md) { 40 | --left-sidebar-max-width: 25%; 41 | max-width: 768px; 42 | } 43 | 44 | @include respond(lg) { 45 | max-width: 1024px; 46 | --left-sidebar-max-width: 20%; 47 | } 48 | 49 | @include respond(xl) { 50 | max-width: 1280px; 51 | } 52 | } 53 | } 54 | 55 | .flex { 56 | display: flex; 57 | flex-direction: row; 58 | 59 | &.column { 60 | flex-direction: column; 61 | } 62 | 63 | &.on-phone--column { 64 | flex-direction: column; 65 | @include respond(md) { 66 | flex-direction: unset; 67 | } 68 | } 69 | 70 | &.align-items--flex-start { 71 | align-items: flex-start; 72 | } 73 | 74 | .grow { 75 | flex-grow: 1; 76 | } 77 | 78 | .do-not-shrink { 79 | flex-shrink: 0; 80 | } 81 | 82 | .do-not-overflow { 83 | min-width: 0; 84 | flex-shrink: 1; 85 | max-width: 100%; 86 | } 87 | 88 | .full-width { 89 | width: 100%; 90 | } 91 | } 92 | 93 | main.main { 94 | min-width: 0; 95 | max-width: 100%; 96 | flex-grow: 1; 97 | padding-top: var(--main-top-padding); 98 | } 99 | 100 | .main-container { 101 | min-height: 100vh; 102 | align-items: flex-start; 103 | padding: 0 15px; 104 | column-gap: var(--section-separation); 105 | 106 | @include respond(md) { 107 | padding: 0 20px; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /layouts/rss.xml: -------------------------------------------------------------------------------- 1 | {{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}} 2 | {{- $notHidden := where .Site.RegularPages "Params.hidden" "!=" true -}} 3 | {{- $filtered := ($pages | intersect $notHidden) -}} 4 | {{- $limit := .Site.Config.Services.RSS.Limit -}} 5 | {{- if ge $limit 1 -}} 6 | {{- $filtered = $filtered | first $limit -}} 7 | {{- end -}} 8 | {{- printf "" | safeHTML }} 9 | 10 | 11 | {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} 12 | {{ .Permalink }} 13 | Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} 14 | Hugo -- gohugo.io{{ with .Site.LanguageCode }} 15 | {{.}}{{end}}{{ with .Site.Author.email }} 16 | {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} 17 | {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} 18 | {{.}}{{end}}{{ if not .Date.IsZero }} 19 | {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} 20 | {{- with .OutputFormats.Get "RSS" -}} 21 | {{ printf "" .Permalink .MediaType | safeHTML }} 22 | {{- end -}} 23 | {{ range $filtered }} 24 | {{- $content := safeHTML (.Summary | html) -}} 25 | {{- if .Site.Params.rssFullContent -}} 26 | {{- $content = safeHTML (.Content | html) -}} 27 | {{- end -}} 28 | 29 | {{ .Title }} 30 | {{ .Permalink }} 31 | {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} 32 | {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} 33 | {{ .Permalink }} 34 | 35 | {{- $image := partial "helper/image" (dict "Context" . "Type" "rss") -}} 36 | {{- if $image.exists -}} 37 | {{ "<" | html }}img src="{{ $image.permalink | absURL }}" alt="Featured image of post {{ .Title }}" {{ "/>" | html}} 38 | {{- end -}}{{ $content }} 39 | 40 | {{ end }} 41 | 42 | 43 | -------------------------------------------------------------------------------- /layouts/partials/helper/image.html: -------------------------------------------------------------------------------- 1 | {{ $result := dict "exists" false "permalink" nil "resource" nil "isDefault" false }} 2 | {{ $imageField := default "image" .Context.Site.Params.featuredImageField }} 3 | {{ $imageValue := index .Context.Params $imageField }} 4 | 5 | {{ if $imageValue }} 6 | 7 | {{ $result = merge $result (dict "exists" true) }} 8 | {{ $url := urls.Parse $imageValue }} 9 | 10 | {{ if or (eq $url.Scheme "http") (eq $url.Scheme "https") }} 11 | 12 | {{ $result = merge $result (dict "permalink" $imageValue) }} 13 | {{ else }} 14 | {{ $pageResourceImage := .Context.Resources.GetMatch (printf "%s" ($imageValue | safeURL)) }} 15 | 16 | {{ if $pageResourceImage }} 17 | 18 | {{ $result = merge $result (dict "permalink" $pageResourceImage.RelPermalink) }} 19 | 20 | 21 | {{ if ne (path.Ext $imageValue) ".svg" }} 22 | {{ $result = merge $result (dict "resource" $pageResourceImage) }} 23 | {{ end }} 24 | {{ else }} 25 | 26 | {{ $result = merge $result (dict "permalink" (relURL $imageValue)) }} 27 | {{ end }} 28 | 29 | {{ end }} 30 | 31 | {{ else if and (ne .Type nil) (index .Context.Site.Params.defaultImage .Type) }} 32 | 33 | {{ $defaultImageSetting := index .Context.Site.Params.defaultImage .Type }} 34 | 35 | {{ if $defaultImageSetting.enabled }} 36 | {{ $result = merge $result (dict "isDefault" true) }} 37 | {{ $result = merge $result (dict "exists" true) }} 38 | 39 | {{ if $defaultImageSetting.local }} 40 | {{ $siteResourceImage := resources.GetMatch (printf "%s" ($defaultImageSetting.src | safeURL)) }} 41 | 42 | {{ if $siteResourceImage }} 43 | 44 | {{ $result = merge $result (dict "permalink" $siteResourceImage.RelPermalink) }} 45 | {{ $result = merge $result (dict "resource" $siteResourceImage) }} 46 | {{ else }} 47 | 48 | {{ errorf "Failed loading image: %q" $defaultImageSetting.src }} 49 | {{ $result = merge $result (dict "exists" false) }} 50 | {{ end }} 51 | 52 | {{ else }} 53 | 54 | {{ $result = merge $result (dict "permalink" (relURL $defaultImageSetting.src)) }} 55 | {{ end }} 56 | 57 | {{ end }} 58 | 59 | {{ end }} 60 | 61 | {{ return $result }} 62 | -------------------------------------------------------------------------------- /layouts/partials/article/components/photoswipe.html: -------------------------------------------------------------------------------- 1 | 2 | 67 | 68 | {{- partial "helper/external" (dict "Context" . "Namespace" "PhotoSwipe") -}} -------------------------------------------------------------------------------- /layouts/partials/comments/provider/disqusjs.html: -------------------------------------------------------------------------------- 1 | {{- $pc := .Site.Config.Privacy.Disqus -}} 2 | {{- $disqusjs := .Site.Params.Comments.disqusjs -}} 3 | {{- if and (not $pc.Disable) (and $disqusjs.Shortname $disqusjs.ApiKey) -}} 4 | 5 | {{- $style := resources.Get "scss/partials/comments/disqusjs.scss" | resources.ToCSS | minify -}} 6 | 7 | 8 |
9 |
10 | 59 | 60 |
61 | {{- end -}} -------------------------------------------------------------------------------- /assets/ts/colorScheme.ts: -------------------------------------------------------------------------------- 1 | type colorScheme = 'light' | 'dark' | 'auto'; 2 | 3 | class StackColorScheme { 4 | private localStorageKey = 'StackColorScheme'; 5 | private currentScheme: colorScheme; 6 | private systemPreferScheme: colorScheme; 7 | 8 | constructor(toggleEl: HTMLElement) { 9 | this.bindMatchMedia(); 10 | this.currentScheme = this.getSavedScheme(); 11 | 12 | this.dispatchEvent(document.documentElement.dataset.scheme as colorScheme); 13 | 14 | if (toggleEl) 15 | this.bindClick(toggleEl); 16 | 17 | if (document.body.style.transition == '') 18 | document.body.style.setProperty('transition', 'background-color .3s ease'); 19 | } 20 | 21 | private saveScheme() { 22 | localStorage.setItem(this.localStorageKey, this.currentScheme); 23 | } 24 | 25 | private bindClick(toggleEl: HTMLElement) { 26 | toggleEl.addEventListener('click', (e) => { 27 | if (this.isDark()) { 28 | /// Disable dark mode 29 | this.currentScheme = 'light'; 30 | } 31 | else { 32 | this.currentScheme = 'dark'; 33 | } 34 | 35 | this.setBodyClass(); 36 | 37 | if (this.currentScheme == this.systemPreferScheme) { 38 | /// Set to auto 39 | this.currentScheme = 'auto'; 40 | } 41 | 42 | this.saveScheme(); 43 | }) 44 | } 45 | 46 | private isDark() { 47 | return (this.currentScheme == 'dark' || this.currentScheme == 'auto' && this.systemPreferScheme == 'dark'); 48 | } 49 | 50 | private dispatchEvent(colorScheme: colorScheme) { 51 | const event = new CustomEvent('onColorSchemeChange', { 52 | detail: colorScheme 53 | }); 54 | window.dispatchEvent(event); 55 | } 56 | 57 | private setBodyClass() { 58 | if (this.isDark()) { 59 | document.documentElement.dataset.scheme = 'dark'; 60 | } 61 | else { 62 | document.documentElement.dataset.scheme = 'light'; 63 | } 64 | 65 | this.dispatchEvent(document.documentElement.dataset.scheme as colorScheme); 66 | } 67 | 68 | private getSavedScheme(): colorScheme { 69 | const savedScheme = localStorage.getItem(this.localStorageKey); 70 | 71 | if (savedScheme == 'light' || savedScheme == 'dark' || savedScheme == 'auto') return savedScheme; 72 | else return 'auto'; 73 | } 74 | 75 | private bindMatchMedia() { 76 | window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => { 77 | if (e.matches) { 78 | this.systemPreferScheme = 'dark'; 79 | } 80 | else { 81 | this.systemPreferScheme = 'light'; 82 | } 83 | this.setBodyClass(); 84 | }); 85 | } 86 | } 87 | 88 | export default StackColorScheme; 89 | -------------------------------------------------------------------------------- /exampleSite/content/post/placeholder-text/index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "Hugo Authors" 3 | title = "Placeholder Text" 4 | date = "2019-03-09" 5 | description = "Lorem Ipsum Dolor Si Amet" 6 | categories = [ 7 | "Test", 8 | "Test with whitespaces" 9 | ] 10 | tags = [ 11 | "markdown", 12 | "text", 13 | "tag with whitespaces" 14 | ] 15 | image = "matt-le-SJSpo9hQf7s-unsplash.jpg" 16 | +++ 17 | 18 | Lorem est tota propiore conpellat pectoribus de pectora summo. Redit teque digerit hominumque toris verebor lumina non cervice subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum. 19 | 20 | 1. Exierant elisi ambit vivere dedere 21 | 2. Duce pollice 22 | 3. Eris modo 23 | 4. Spargitque ferrea quos palude 24 | 25 | Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus silentia flumen, sustinet placuit petis in dilapsa erat sunt. Atria tractus malis. 26 | 27 | 1. Comas hunc haec pietate fetum procerum dixit 28 | 2. Post torum vates letum Tiresia 29 | 3. Flumen querellas 30 | 4. Arcanaque montibus omnes 31 | 5. Quidem et 32 | 33 | # Vagus elidunt 34 | 35 | 36 | 37 | [The Van de Graaf Canon](https://en.wikipedia.org/wiki/Canons_of_page_construction#Van_de_Graaf_canon) 38 | 39 | ## Mane refeci capiebant unda mulcebat 40 | 41 | Victa caducifer, malo vulnere contra dicere aurato, ludit regale, voca! Retorsit colit est profanae esse virescere furit nec; iaculi matertera et visa est, viribus. Divesque creatis, tecta novat collumque vulnus est, parvas. **Faces illo pepulere** tempus adest. Tendit flamma, ab opes virum sustinet, sidus sequendo urbis. 42 | 43 | Iubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli Lelegas tu lux. Verbis obstitit intus oblectamina fixis linguisque ausus sperare Echionides cornuaque tenent clausit possit. Omnia putatur. Praeteritae refert ausus; ferebant e primus lora nutat, vici quae mea ipse. Et iter nil spectatae vulnus haerentia iuste et exercebat, sui et. 44 | 45 | Eurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel **mitis temploque** vocatus, inque alis, *oculos nomen* non silvis corpore coniunx ne displicet illa. Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem Propoetides **parte**. 46 | 47 | {{< css.inline >}} 48 | 51 | {{< /css.inline >}} 52 | -------------------------------------------------------------------------------- /layouts/_default/list.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 |

3 | {{ if eq .Parent (.GetPage "/") }} 4 | {{ T "list.section" }} 5 | {{ else }} 6 | {{ .Parent.Title }} 7 | {{ end }} 8 |

9 | 10 |
11 |
12 |

{{ T "list.page" (len .Pages) }}

13 |

{{ .Title }}

14 | {{ with .Params.description }} 15 |

{{ . }}

16 | {{ end }} 17 |
18 | 19 | {{- $image := partialCached "helper/image" (dict "Context" . "Type" "section") .RelPermalink "section" -}} 20 | {{ if $image.exists }} 21 |
22 | {{ if $image.resource }} 23 | {{- $Permalink := $image.resource.RelPermalink -}} 24 | {{- $Width := $image.resource.Width -}} 25 | {{- $Height := $image.resource.Height -}} 26 | 27 | {{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}} 28 | {{- $thumbnail := $image.resource.Fill "120x120" -}} 29 | {{- $Permalink = $thumbnail.RelPermalink -}} 30 | {{- $Width = $thumbnail.Width -}} 31 | {{- $Height = $thumbnail.Height -}} 32 | {{- end -}} 33 | 34 | 38 | {{ else }} 39 | 40 | {{ end }} 41 |
42 | {{ end }} 43 |
44 | 45 | {{- $subsections := .Sections -}} 46 | {{- $pages := .Pages | complement $subsections -}} 47 | 48 | {{- if eq (len $pages) 0 -}} 49 | {{/* If there are no normal pages, display subsections in list style, with pagination */}} 50 | {{/* This happens with taxonomies like categories or tags */}} 51 | {{- $pages = $subsections -}} 52 | {{- $subsections = slice -}} 53 | {{- end -}} 54 | 55 | {{- with $subsections -}} 56 |

{{ T "list.subsection" (len $subsections) }}

57 |
58 |
59 | {{ range . }} 60 | {{ partial "article-list/tile" (dict "context" . "size" "250x150" "Type" "section") }} 61 | {{ end }} 62 |
63 |
64 | {{- end -}} 65 | 66 | {{/* List only pages that are not a subsection */}} 67 | {{ $paginator := .Paginate $pages }} 68 |
69 | {{ range $paginator.Pages }} 70 | {{ partial "article-list/compact" . }} 71 | {{ end }} 72 |
73 | 74 | {{- partial "pagination.html" . -}} 75 | 76 | {{ partialCached "footer/footer" . }} 77 | {{ end }} 78 | 79 | {{ define "right-sidebar" }} 80 | {{ partialCached "sidebar/right.html" . }} 81 | {{ end }} -------------------------------------------------------------------------------- /assets/ts/menu.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Slide up/down 3 | * Code from https://dev.to/bmsvieira/vanilla-js-slidedown-up-4dkn 4 | * @param target 5 | * @param duration 6 | */ 7 | let slideUp = (target: HTMLElement, duration = 500) => { 8 | target.classList.add('transiting'); 9 | target.style.transitionProperty = 'height, margin, padding'; 10 | target.style.transitionDuration = duration + 'ms'; 11 | ///target.style.boxSizing = 'border-box'; 12 | target.style.height = target.offsetHeight + 'px'; 13 | target.offsetHeight; 14 | target.style.overflow = 'hidden'; 15 | target.style.height = "0"; 16 | target.style.paddingTop = "0"; 17 | target.style.paddingBottom = "0"; 18 | target.style.marginTop = "0"; 19 | target.style.marginBottom = "0"; 20 | window.setTimeout(() => { 21 | target.classList.remove('show') 22 | target.style.removeProperty('height'); 23 | target.style.removeProperty('padding-top'); 24 | target.style.removeProperty('padding-bottom'); 25 | target.style.removeProperty('margin-top'); 26 | target.style.removeProperty('margin-bottom'); 27 | target.style.removeProperty('overflow'); 28 | target.style.removeProperty('transition-duration'); 29 | target.style.removeProperty('transition-property'); 30 | target.classList.remove('transiting'); 31 | }, duration); 32 | } 33 | 34 | let slideDown = (target: HTMLElement, duration = 500) => { 35 | target.classList.add('transiting'); 36 | target.style.removeProperty('display'); 37 | 38 | target.classList.add('show'); 39 | 40 | let height = target.offsetHeight; 41 | target.style.overflow = 'hidden'; 42 | target.style.height = "0"; 43 | target.style.paddingTop = "0"; 44 | target.style.paddingBottom = "0"; 45 | target.style.marginTop = "0"; 46 | target.style.marginBottom = "0"; 47 | target.offsetHeight; 48 | ///target.style.boxSizing = 'border-box'; 49 | target.style.transitionProperty = "height, margin, padding"; 50 | target.style.transitionDuration = duration + 'ms'; 51 | target.style.height = height + 'px'; 52 | target.style.removeProperty('padding-top'); 53 | target.style.removeProperty('padding-bottom'); 54 | target.style.removeProperty('margin-top'); 55 | target.style.removeProperty('margin-bottom'); 56 | window.setTimeout(() => { 57 | target.style.removeProperty('height'); 58 | target.style.removeProperty('overflow'); 59 | target.style.removeProperty('transition-duration'); 60 | target.style.removeProperty('transition-property'); 61 | target.classList.remove('transiting'); 62 | }, duration); 63 | } 64 | 65 | let slideToggle = (target, duration = 500) => { 66 | if (window.getComputedStyle(target).display === 'none') { 67 | return slideDown(target, duration); 68 | } else { 69 | return slideUp(target, duration); 70 | } 71 | } 72 | 73 | export default function () { 74 | const toggleMenu = document.getElementById('toggle-menu'); 75 | if (toggleMenu) { 76 | toggleMenu.addEventListener('click', () => { 77 | if (document.getElementById('main-menu').classList.contains('transiting')) return; 78 | document.body.classList.toggle('show-menu'); 79 | slideToggle(document.getElementById('main-menu'), 300); 80 | toggleMenu.classList.toggle('is-active'); 81 | }); 82 | } 83 | } -------------------------------------------------------------------------------- /config.yaml: -------------------------------------------------------------------------------- 1 | module: 2 | hugoVersion: 3 | extended: true 4 | min: "0.87.0" 5 | 6 | params: 7 | mainSections: 8 | - post 9 | featuredImageField: image 10 | rssFullContent: true 11 | favicon: 12 | 13 | footer: 14 | since: 15 | customText: 16 | 17 | dateFormat: 18 | published: Jan 02, 2006 19 | lastUpdated: Jan 02, 2006 15:04 MST 20 | 21 | sidebar: 22 | emoji: 23 | subtitle: 24 | avatar: 25 | enabled: true 26 | local: true 27 | src: img/avatar.png 28 | 29 | article: 30 | math: false 31 | toc: true 32 | readingTime: true 33 | license: 34 | enabled: false 35 | default: Licensed under CC BY-NC-SA 4.0 36 | 37 | comments: 38 | enabled: false 39 | provider: disqus 40 | 41 | disqusjs: 42 | shortname: 43 | apiUrl: 44 | apiKey: 45 | admin: 46 | adminLabel: 47 | 48 | utterances: 49 | repo: 50 | issueTerm: pathname 51 | label: 52 | 53 | remark42: 54 | host: 55 | site: 56 | locale: 57 | 58 | vssue: 59 | platform: 60 | owner: 61 | repo: 62 | clientId: 63 | clientSecret: 64 | autoCreateIssue: false 65 | 66 | # Waline client configuration see: https://waline.js.org/en/reference/client.html 67 | waline: 68 | serverURL: 69 | lang: 70 | visitor: 71 | avatar: 72 | emoji: 73 | - https://cdn.jsdelivr.net/gh/walinejs/emojis/weibo 74 | requiredMeta: 75 | - name 76 | - email 77 | - url 78 | placeholder: 79 | locale: 80 | admin: Admin 81 | 82 | twikoo: 83 | envId: 84 | region: 85 | path: 86 | lang: 87 | 88 | giscus: 89 | repo: 90 | repoID: 91 | category: 92 | categoryID: 93 | mapping: 94 | lightTheme: 95 | darkTheme: 96 | reactionsEnabled: 1 97 | emitMetadata: 0 98 | 99 | gitalk: 100 | owner: 101 | admin: 102 | repo: 103 | clientID: 104 | clientSecret: 105 | 106 | cusdis: 107 | host: 108 | id: 109 | 110 | widgets: 111 | enabled: 112 | - search 113 | - archives 114 | - tag-cloud 115 | 116 | archives: 117 | limit: 5 118 | 119 | tagCloud: 120 | limit: 10 121 | 122 | opengraph: 123 | twitter: 124 | # Your Twitter username 125 | site: 126 | 127 | # Available values: summary, summary_large_image 128 | card: summary_large_image 129 | 130 | defaultImage: 131 | opengraph: 132 | enabled: false 133 | local: false 134 | src: 135 | 136 | colorScheme: 137 | # Display toggle 138 | toggle: true 139 | 140 | # Available values: auto, light, dark 141 | default: auto 142 | 143 | imageProcessing: 144 | cover: 145 | enabled: true 146 | content: 147 | enabled: true 148 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Stack](https://i.imgur.com/cCiHOGS.jpg) 2 | # Hugo Theme Stack 3 | 4 | > Card-style Hugo theme designed for bloggers. 5 | 6 | ## Demo 7 | 8 | [Example Site](https://theme-stack.jimmycai.com/) 9 | 10 | [![Netlify Status](https://api.netlify.com/api/v1/badges/a2d2807a-a905-4bcb-97da-8da8d847da3d/deploy-status)](https://app.netlify.com/sites/hugo-theme-stack/deploys) 11 | 12 | ## Documentation 13 | 14 | [Documentation](https://docs.stack.jimmycai.com/) | [中文文档](https://docs.stack.jimmycai.com/zh/) 15 | 16 | ## Introduction 17 | 18 | Stack is a simple card-style Hugo theme designed for bloggers, some of its features are: 19 | 20 | - Responsive images support 21 | - Lazy load images 22 | - Dark mode 23 | - Local search 24 | - [PhotoSwipe](https://photoswipe.com/) integration 25 | - Archive page template 26 | - Full native JavaScript, no jQuery or any other frameworks are used 27 | - No CSS framework, keep it simple and minimal 28 | - Properly cropped thumbnails 29 | - Subsection support 30 | - Table of contents 31 | 32 | ## Requirements 33 | 34 | It's necessary to use **Hugo Extended ≥ 0.87.0**. 35 | 36 | ## Installation 37 | 38 | Clone / Download this repository to `theme` folder, and edit your site config following `exampleSite/config.yaml`. 39 | 40 | *Note: Remove `config.toml` if there is one in the site folder.* 41 | 42 | Check [documentation](https://docs.stack.jimmycai.com/) for more details. 43 | 44 | ## Copyright 45 | 46 | **Licensed under the GNU General Public License v3.0** 47 | 48 | Please do not remove the "*Theme Stack designed by Jimmy*" text and link. 49 | 50 | If you want to port this theme to another blogging platform, please let me know🙏. 51 | 52 | ## Sponsoring 53 | 54 | If you like this theme, give it a star, and consider supporting its development: 55 | 56 | [![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/C0C530AXX) 57 | 58 | Your support is greatly appreciated :) 59 | 60 | ## Thanks to 61 | 62 | | Project | Description | Licence | 63 | | ------- | ----------- | ------- | 64 | | [PhotoSwipe](https://photoswipe.com/) | For the lightbox effect | [MIT](https://github.com/dimsemenov/PhotoSwipe/blob/master/LICENSE) | 65 | | [Normalize.css](https://github.com/necolas/normalize.css) | - | [MIT](https://github.com/necolas/normalize.css/blob/master/LICENSE.md) | 66 | | [Node Vibrant](https://github.com/Vibrant-Colors/node-vibrant) | To extract the color from images | [MIT](https://github.com/Vibrant-Colors/node-vibrant/blob/master/LICENSE.md) 67 | | [Tabler icons](https://github.com/tabler/tabler-icons) | Default menu icons | [MIT](https://github.com/tabler/tabler-icons/blob/master/LICENSE) | 68 | | [jonsuh/hamburgers](https://github.com/jonsuh/hamburgers) | Hamburger icon of menu | [MIT](https://github.com/jonsuh/hamburgers/blob/master/LICENSE) | 69 | | [lepture/yue.css](https://github.com/lepture/yue.css) | Part of it is used for styling article content | MIT | 70 | | [Typlog](https://typlog.com/) | Where the markdown gallery syntax is borrowed from | The author gave me the permission | 71 | | [Pure CSS implementation of Google Photos / 500px image layout](https://github.com/xieranmaya/blog/issues/6) | Used for image gallery | - | 72 | 73 | ### References 74 | 75 | Some references that I took while building this theme: 76 | 77 | | Project | Licence| 78 | | ------- | ------| 79 | | [artchen/hexo-theme-element](https://github.com/artchen/hexo-theme-element) | [MIT](https://github.com/artchen/hexo-theme-element/blob/master/LICENSE) | 80 | | [MunifTanjim/minimo](https://github.com/MunifTanjim/minimo) | [MIT](https://github.com/MunifTanjim/minimo/blob/master/LICENSE) | -------------------------------------------------------------------------------- /layouts/partials/sidebar/left.html: -------------------------------------------------------------------------------- 1 | 84 | -------------------------------------------------------------------------------- /assets/scss/partials/sidebar.scss: -------------------------------------------------------------------------------- 1 | .sidebar { 2 | &.sticky { 3 | @include respond(md) { 4 | position: sticky; 5 | } 6 | } 7 | } 8 | 9 | .left-sidebar { 10 | display: flex; 11 | flex-direction: column; 12 | flex-shrink: 0; 13 | align-self: stretch; 14 | 15 | width: 100%; 16 | padding: 30px 0 15px 0; 17 | max-width: none; 18 | 19 | --sidebar-avatar-size: 120px; 20 | --sidebar-element-separation: 20px; 21 | 22 | @include respond(md) { 23 | width: auto; 24 | padding-top: var(--main-top-padding); 25 | padding-bottom: var(--main-top-padding); 26 | max-height: 100vh; 27 | } 28 | 29 | @include respond(2xl) { 30 | --sidebar-avatar-size: 140px; 31 | --sidebar-element-separation: 25px; 32 | } 33 | 34 | &.sticky { 35 | top: 0; 36 | } 37 | } 38 | 39 | .right-sidebar { 40 | flex-shrink: 0; 41 | display: none; 42 | 43 | &.sticky { 44 | top: 0; 45 | } 46 | 47 | @include respond(lg) { 48 | padding-top: var(--main-top-padding); 49 | } 50 | } 51 | 52 | .site-info { 53 | z-index: 1; 54 | transition: box-shadow 0.5s ease; 55 | 56 | padding: 15px; 57 | 58 | @include respond(md) { 59 | padding: 0; 60 | } 61 | 62 | .site-avatar { 63 | position: relative; 64 | margin: 0; 65 | width: var(--sidebar-avatar-size); 66 | height: var(--sidebar-avatar-size); 67 | 68 | margin-bottom: var(--sidebar-element-separation); 69 | 70 | .site-logo { 71 | width: 100%; 72 | height: 100%; 73 | border-radius: 100%; 74 | box-shadow: var(--shadow-l1); 75 | } 76 | 77 | .emoji { 78 | position: absolute; 79 | width: 40px; 80 | height: 40px; 81 | line-height: 40px; 82 | border-radius: 100%; 83 | bottom: 0; 84 | right: 0; 85 | text-align: center; 86 | font-size: 20px; 87 | background-color: var(--card-background); 88 | box-shadow: var(--shadow-l2); 89 | 90 | @include respond(2xl) { 91 | width: 50px; 92 | height: 50px; 93 | line-height: 50px; 94 | } 95 | } 96 | } 97 | 98 | .site-name { 99 | color: var(--accent-color); 100 | margin: 0; 101 | font-size: 1.8rem; 102 | 103 | @include respond(2xl) { 104 | font-size: 2rem; 105 | } 106 | } 107 | 108 | .site-description { 109 | color: var(--body-text-color); 110 | font-weight: normal; 111 | margin: 10px 0; 112 | font-size: 1.6rem; 113 | 114 | @include respond(2xl) { 115 | font-size: 1.8rem; 116 | } 117 | } 118 | } 119 | 120 | .sidebar { 121 | .widget { 122 | margin-bottom: var(--section-separation); 123 | 124 | &:not(:last-of-type):after { 125 | content: ""; 126 | width: 100px; 127 | height: 2px; 128 | background-color: var(--body-text-color); 129 | display: block; 130 | margin-top: var(--section-separation); 131 | } 132 | } 133 | } 134 | 135 | [data-scheme="dark"] { 136 | #dark-mode-toggle { 137 | color: var(--accent-color); 138 | font-weight: 700; 139 | 140 | .icon-tabler-toggle-left { 141 | display: none; 142 | } 143 | 144 | .icon-tabler-toggle-right { 145 | display: unset; 146 | } 147 | } 148 | } 149 | 150 | #dark-mode-toggle { 151 | margin-top: auto; 152 | color: var(--body-text-color); 153 | display: flex; 154 | align-items: center; 155 | cursor: pointer; 156 | 157 | .icon-tabler-toggle-right { 158 | display: none; 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /assets/ts/main.ts: -------------------------------------------------------------------------------- 1 | /*! 2 | * Hugo Theme Stack 3 | * 4 | * @author: Jimmy Cai 5 | * @website: https://jimmycai.com 6 | * @link: https://github.com/CaiJimmy/hugo-theme-stack 7 | */ 8 | import StackGallery from "ts/gallery"; 9 | import { getColor } from 'ts/color'; 10 | import menu from 'ts/menu'; 11 | import createElement from 'ts/createElement'; 12 | import StackColorScheme from 'ts/colorScheme'; 13 | 14 | let Stack = { 15 | init: () => { 16 | /** 17 | * Bind menu event 18 | */ 19 | menu(); 20 | 21 | const articleContent = document.querySelector('.article-content') as HTMLElement; 22 | if (articleContent) { 23 | new StackGallery(articleContent); 24 | } 25 | 26 | /** 27 | * Add linear gradient background to tile style article 28 | */ 29 | const articleTile = document.querySelector('.article-list--tile'); 30 | if (articleTile) { 31 | let observer = new IntersectionObserver(async (entries, observer) => { 32 | entries.forEach(entry => { 33 | if (!entry.isIntersecting) return; 34 | observer.unobserve(entry.target); 35 | 36 | const articles = entry.target.querySelectorAll('article.has-image'); 37 | articles.forEach(async articles => { 38 | const image = articles.querySelector('img'), 39 | imageURL = image.src, 40 | key = image.getAttribute('data-key'), 41 | hash = image.getAttribute('data-hash'), 42 | articleDetails: HTMLDivElement = articles.querySelector('.article-details'); 43 | 44 | const colors = await getColor(key, hash, imageURL); 45 | 46 | articleDetails.style.background = ` 47 | linear-gradient(0deg, 48 | rgba(${colors.DarkMuted.rgb[0]}, ${colors.DarkMuted.rgb[1]}, ${colors.DarkMuted.rgb[2]}, 0.5) 0%, 49 | rgba(${colors.Vibrant.rgb[0]}, ${colors.Vibrant.rgb[1]}, ${colors.Vibrant.rgb[2]}, 0.75) 100%)`; 50 | }) 51 | }) 52 | }); 53 | 54 | observer.observe(articleTile) 55 | } 56 | 57 | 58 | /** 59 | * Add copy button to code block 60 | */ 61 | const codeBlocks = document.querySelectorAll('.article-content .highlight'); 62 | const copyText = `Copy`, 63 | copiedText = `Copied!`; 64 | codeBlocks.forEach(codeBlock => { 65 | const copyButton = document.createElement('button'); 66 | copyButton.innerHTML = copyText; 67 | copyButton.classList.add('copyCodeButton'); 68 | codeBlock.appendChild(copyButton); 69 | 70 | const pre = codeBlock.getElementsByTagName('pre'); 71 | const code = pre[0].textContent; 72 | 73 | copyButton.addEventListener('click', () => { 74 | navigator.clipboard.writeText(code) 75 | .then(() => { 76 | copyButton.textContent = copiedText; 77 | 78 | setTimeout(() => { 79 | copyButton.textContent = copyText; 80 | }, 1000); 81 | }) 82 | .catch(err => { 83 | alert(err) 84 | console.log('Something went wrong', err); 85 | }); 86 | }); 87 | }); 88 | 89 | new StackColorScheme(document.getElementById('dark-mode-toggle')); 90 | } 91 | } 92 | 93 | window.addEventListener('load', () => { 94 | setTimeout(function () { 95 | Stack.init(); 96 | }, 0); 97 | }) 98 | 99 | declare global { 100 | interface Window { 101 | createElement: any; 102 | Stack: any 103 | } 104 | } 105 | 106 | window.Stack = Stack; 107 | window.createElement = createElement; -------------------------------------------------------------------------------- /assets/ts/gallery.ts: -------------------------------------------------------------------------------- 1 | declare global { 2 | interface Window { 3 | PhotoSwipe: any; 4 | PhotoSwipeUI_Default: any 5 | } 6 | } 7 | 8 | interface PhotoSwipeItem { 9 | w: number; 10 | h: number; 11 | src: string; 12 | msrc: string; 13 | title?: string; 14 | el: HTMLElement; 15 | } 16 | 17 | class StackGallery { 18 | private galleryUID: number; 19 | private items: PhotoSwipeItem[] = []; 20 | 21 | constructor(container: HTMLElement, galleryUID = 1) { 22 | if (window.PhotoSwipe == undefined || window.PhotoSwipeUI_Default == undefined) { 23 | console.error("PhotoSwipe lib not loaded."); 24 | return; 25 | } 26 | 27 | this.galleryUID = galleryUID; 28 | 29 | StackGallery.createGallery(container); 30 | this.loadItems(container); 31 | this.bindClick(); 32 | } 33 | 34 | private loadItems(container: HTMLElement) { 35 | this.items = []; 36 | 37 | const figures = container.querySelectorAll('figure.gallery-image'); 38 | 39 | for (const el of figures) { 40 | const figcaption = el.querySelector('figcaption'), 41 | img = el.querySelector('img'); 42 | 43 | let aux: PhotoSwipeItem = { 44 | w: parseInt(img.getAttribute('width')), 45 | h: parseInt(img.getAttribute('height')), 46 | src: img.src, 47 | msrc: img.getAttribute('data-thumb') || img.src, 48 | el: el 49 | } 50 | 51 | if (figcaption) { 52 | aux.title = figcaption.innerHTML; 53 | } 54 | 55 | this.items.push(aux); 56 | } 57 | } 58 | 59 | public static createGallery(container: HTMLElement) { 60 | const figuresEl = container.querySelectorAll('figure.gallery-image'); 61 | 62 | let currentGallery = []; 63 | 64 | for (const figure of figuresEl) { 65 | if (!currentGallery.length) { 66 | /// First iteration 67 | currentGallery = [figure]; 68 | } 69 | else if (figure.previousElementSibling === currentGallery[currentGallery.length - 1]) { 70 | /// Adjacent figures 71 | currentGallery.push(figure); 72 | } 73 | else if (currentGallery.length) { 74 | /// End gallery 75 | StackGallery.wrap(currentGallery); 76 | currentGallery = [figure]; 77 | } 78 | } 79 | 80 | if (currentGallery.length > 0) { 81 | StackGallery.wrap(currentGallery); 82 | } 83 | } 84 | 85 | /** 86 | * Wrap adjacent figure tags with div.gallery 87 | * @param figures 88 | */ 89 | public static wrap(figures: HTMLElement[]) { 90 | const galleryContainer = document.createElement('div'); 91 | galleryContainer.className = 'gallery'; 92 | 93 | const parentNode = figures[0].parentNode, 94 | first = figures[0]; 95 | 96 | parentNode.insertBefore(galleryContainer, first) 97 | 98 | for (const figure of figures) { 99 | galleryContainer.appendChild(figure); 100 | } 101 | } 102 | 103 | public open(index: number) { 104 | const pswp = document.querySelector('.pswp') as HTMLDivElement; 105 | const ps = new window.PhotoSwipe(pswp, window.PhotoSwipeUI_Default, this.items, { 106 | index: index, 107 | galleryUID: this.galleryUID, 108 | getThumbBoundsFn: (index) => { 109 | const thumbnail = this.items[index].el.getElementsByTagName('img')[0], 110 | pageYScroll = window.pageYOffset || document.documentElement.scrollTop, 111 | rect = thumbnail.getBoundingClientRect(); 112 | 113 | return { x: rect.left, y: rect.top + pageYScroll, w: rect.width }; 114 | } 115 | }); 116 | 117 | ps.init(); 118 | } 119 | 120 | private bindClick() { 121 | for (const [index, item] of this.items.entries()) { 122 | const a = item.el.querySelector('a'); 123 | 124 | a.addEventListener('click', (e) => { 125 | e.preventDefault(); 126 | this.open(index); 127 | }) 128 | } 129 | } 130 | } 131 | 132 | export default StackGallery; -------------------------------------------------------------------------------- /exampleSite/content/post/markdown-syntax/index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "Hugo Authors" 3 | title = "Markdown Syntax Guide" 4 | date = "2019-03-11" 5 | description = "Sample article showcasing basic Markdown syntax and formatting for HTML elements." 6 | tags = [ 7 | "markdown", 8 | "css", 9 | "html", 10 | "themes", 11 | ] 12 | categories = [ 13 | "themes", 14 | "syntax", 15 | ] 16 | series = ["Themes Guide"] 17 | aliases = ["migrate-from-jekyl"] 18 | image = "pawel-czerwinski-8uZPynIu-rQ-unsplash.jpg" 19 | +++ 20 | 21 | This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme. 22 | 23 | 24 | ## Headings 25 | 26 | The following HTML `

`—`

` elements represent six levels of section headings. `

` is the highest section level while `

` is the lowest. 27 | 28 | # H1 29 | ## H2 30 | ### H3 31 | #### H4 32 | ##### H5 33 | ###### H6 34 | 35 | ## Paragraph 36 | 37 | Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat. 38 | 39 | Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat. 40 | 41 | ## Blockquotes 42 | 43 | The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations. 44 | 45 | #### Blockquote without attribution 46 | 47 | > Tiam, ad mint andaepu dandae nostion secatur sequo quae. 48 | > **Note** that you can use *Markdown syntax* within a blockquote. 49 | 50 | #### Blockquote with attribution 51 | 52 | > Don't communicate by sharing memory, share memory by communicating.
53 | > — Rob Pike[^1] 54 | 55 | [^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. 56 | 57 | ## Tables 58 | 59 | Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box. 60 | 61 | Name | Age 62 | --------|------ 63 | Bob | 27 64 | Alice | 23 65 | 66 | #### Inline Markdown within tables 67 | 68 | | Italics | Bold | Code | 69 | | -------- | -------- | ------ | 70 | | *italics* | **bold** | `code` | 71 | 72 | ## Code Blocks 73 | 74 | #### Code block with backticks 75 | 76 | ```html 77 | 78 | 79 | 80 | 81 | Example HTML5 Document 82 | 83 | 84 |

Test

85 | 86 | 87 | ``` 88 | 89 | #### Code block indented with four spaces 90 | 91 | 92 | 93 | 94 | 95 | Example HTML5 Document 96 | 97 | 98 |

Test

99 | 100 | 101 | 102 | #### Code block with Hugo's internal highlight shortcode 103 | {{< highlight html >}} 104 | 105 | 106 | 107 | 108 | Example HTML5 Document 109 | 110 | 111 |

Test

112 | 113 | 114 | {{< /highlight >}} 115 | 116 | ## List Types 117 | 118 | #### Ordered List 119 | 120 | 1. First item 121 | 2. Second item 122 | 3. Third item 123 | 124 | #### Unordered List 125 | 126 | * List item 127 | * Another item 128 | * And another item 129 | 130 | #### Nested list 131 | 132 | * Fruit 133 | * Apple 134 | * Orange 135 | * Banana 136 | * Dairy 137 | * Milk 138 | * Cheese 139 | 140 | ## Other Elements — abbr, sub, sup, kbd, mark 141 | 142 | GIF is a bitmap image format. 143 | 144 | H2O 145 | 146 | Xn + Yn = Zn 147 | 148 | Press CTRL+ALT+Delete to end the session. 149 | 150 | Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. 151 | -------------------------------------------------------------------------------- /assets/scss/variables.scss: -------------------------------------------------------------------------------- 1 | $defaultTagBackgrounds: #8ea885, #df7988, #0177b8, #ffb900, #6b69d6; 2 | $defaultTagColors: #fff, #fff, #fff, #fff, #fff; 3 | 4 | [data-scheme="light"] { 5 | --pre-text-color: #272822; 6 | --pre-background-color: #fafafa; 7 | @import "partials/highlight/light.scss"; 8 | } 9 | 10 | [data-scheme="dark"] { 11 | --pre-text-color: #f8f8f2; 12 | --pre-background-color: #272822; 13 | @import "partials/highlight/dark.scss"; 14 | } 15 | 16 | /* 17 | * Global style 18 | */ 19 | :root { 20 | @include respond(md) { 21 | --main-top-padding: 35px; 22 | } 23 | 24 | @include respond(xl) { 25 | --main-top-padding: 50px; 26 | } 27 | 28 | --body-background: #f5f5fa; 29 | 30 | --accent-color: #34495e; 31 | --accent-color-darker: #2c3e50; 32 | --accent-color-text: #fff; 33 | --body-text-color: #bababa; 34 | 35 | --tag-border-radius: 4px; 36 | 37 | --section-separation: 40px; 38 | 39 | --scrollbar-thumb: hsl(0, 0%, 85%); 40 | --scrollbar-track: var(--body-background); 41 | 42 | &[data-scheme="dark"] { 43 | --body-background: #303030; 44 | --accent-color: #ecf0f1; 45 | --accent-color-darker: #bdc3c7; 46 | --accent-color-text: #000; 47 | --body-text-color: rgba(255, 255, 255, 0.7); 48 | --scrollbar-thumb: #424242; 49 | --scrollbar-track: var(--body-background); 50 | } 51 | } 52 | 53 | /** 54 | * Global font family 55 | */ 56 | :root { 57 | --sys-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Droid Sans", "Helvetica Neue"; 58 | --zh-font-family: "PingFang SC", "Hiragino Sans GB", "Droid Sans Fallback", "Microsoft YaHei"; 59 | 60 | --base-font-family: "Lato", var(--sys-font-family), var(--zh-font-family), sans-serif; 61 | --code-font-family: Menlo, Monaco, Consolas, "Courier New", monospace; 62 | } 63 | 64 | /* 65 | * Card style 66 | */ 67 | :root { 68 | --card-background: #fff; 69 | --card-background-selected: #eaeaea; 70 | 71 | --card-text-color-main: #000; 72 | --card-text-color-secondary: #747474; 73 | --card-text-color-tertiary: #bababa; 74 | --card-separator-color: rgba(218, 218, 218, 0.5); 75 | 76 | --card-border-radius: 10px; 77 | 78 | --card-padding: 20px; 79 | 80 | @include respond(md) { 81 | --card-padding: 25px; 82 | } 83 | 84 | @include respond(xl) { 85 | --card-padding: 30px; 86 | } 87 | 88 | --small-card-padding: 25px 20px; 89 | 90 | @include respond(md) { 91 | --small-card-padding: 25px; 92 | } 93 | 94 | &[data-scheme="dark"] { 95 | --card-background: #424242; 96 | --card-background-selected: rgba(255, 255, 255, 0.16); 97 | --card-text-color-main: rgba(255, 255, 255, 0.9); 98 | --card-text-color-secondary: rgba(255, 255, 255, 0.7); 99 | --card-text-color-tertiary: rgba(255, 255, 255, 0.5); 100 | --card-separator-color: rgba(255, 255, 255, 0.12); 101 | } 102 | } 103 | 104 | /** 105 | * Article content font settings 106 | */ 107 | :root { 108 | --article-font-family: var(--base-font-family); 109 | --article-font-size: 1.6rem; 110 | 111 | @include respond(md) { 112 | --article-font-size: 1.7rem; 113 | } 114 | 115 | --article-line-height: 1.85; 116 | } 117 | 118 | /* 119 | * Article content style 120 | */ 121 | :root { 122 | --blockquote-border-size: 4px; 123 | --blockquote-background-color: rgb(248 248 248); 124 | 125 | --heading-border-size: 4px; 126 | 127 | --link-background-color: 189, 195, 199; 128 | --link-background-opacity: 0.5; 129 | --link-background-opacity-hover: 0.7; 130 | 131 | --pre-background-color: #272822; 132 | --pre-text-color: #f8f8f2; 133 | 134 | --code-background-color: rgba(0, 0, 0, 0.12); 135 | --code-text-color: #808080; 136 | 137 | --table-border-color: #dadada; 138 | --tr-even-background-color: #efefee; 139 | 140 | &[data-scheme="dark"] { 141 | --code-background-color: #272822; 142 | --code-text-color: rgba(255, 255, 255, 0.9); 143 | 144 | --table-border-color: #717171; 145 | --tr-even-background-color: #545454; 146 | 147 | --blockquote-background-color: rgb(75 75 75); 148 | } 149 | } 150 | 151 | /* 152 | * Shadow style 153 | * Thanks to https://www.figma.com/community/plugin/744987207861965946/Shadow-picker 154 | */ 155 | :root { 156 | --shadow-l1: 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 0px 2px rgba(0, 0, 0, 0.06), 0px 0px 1px rgba(0, 0, 0, 0.04); 157 | --shadow-l2: 0px 10px 20px rgba(0, 0, 0, 0.04), 0px 2px 6px rgba(0, 0, 0, 0.04), 0px 0px 1px rgba(0, 0, 0, 0.04); 158 | --shadow-l3: 0px 10px 20px rgba(0, 0, 0, 0.04), 0px 2px 6px rgba(0, 0, 0, 0.04), 0px 0px 1px rgba(0, 0, 0, 0.04); 159 | --shadow-l4: 0px 24px 32px rgba(0, 0, 0, 0.04), 0px 16px 24px rgba(0, 0, 0, 0.04), 0px 4px 8px rgba(0, 0, 0, 0.04), 160 | 0px 0px 1px rgba(0, 0, 0, 0.04); 161 | } 162 | -------------------------------------------------------------------------------- /assets/scss/partials/menu.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Hamburgers 3 | * @description Tasty CSS-animated hamburgers 4 | * @author Jonathan Suh @jonsuh 5 | * @site https://jonsuh.com/hamburgers 6 | * @link https://github.com/jonsuh/hamburgers 7 | */ 8 | 9 | .hamburger { 10 | padding-top: 10px; 11 | display: inline-block; 12 | cursor: pointer; 13 | transition-property: opacity, filter; 14 | transition-duration: 0.15s; 15 | transition-timing-function: linear; 16 | font: inherit; 17 | color: inherit; 18 | text-transform: none; 19 | background-color: transparent; 20 | border: 0; 21 | margin: 0; 22 | overflow: visible; 23 | } 24 | .hamburger:hover { 25 | opacity: 0.7; 26 | } 27 | .hamburger.is-active:hover { 28 | opacity: 0.7; 29 | } 30 | .hamburger.is-active .hamburger-inner, 31 | .hamburger.is-active .hamburger-inner::before, 32 | .hamburger.is-active .hamburger-inner::after { 33 | background-color: #000; 34 | } 35 | 36 | .hamburger-box { 37 | width: 30px; 38 | height: 24px; 39 | display: inline-block; 40 | position: relative; 41 | } 42 | 43 | .hamburger-inner { 44 | display: block; 45 | top: 50%; 46 | margin-top: -2px; 47 | } 48 | 49 | .hamburger-inner, 50 | .hamburger-inner::before, 51 | .hamburger-inner::after { 52 | width: 30px; 53 | height: 2px; 54 | background-color: var(--card-text-color-main); 55 | border-radius: 4px; 56 | position: absolute; 57 | transition-property: transform; 58 | transition-duration: 0.15s; 59 | transition-timing-function: ease; 60 | } 61 | .hamburger-inner::before, 62 | .hamburger-inner::after { 63 | content: ""; 64 | display: block; 65 | } 66 | .hamburger-inner::before { 67 | top: -10px; 68 | } 69 | .hamburger-inner::after { 70 | bottom: -10px; 71 | } 72 | 73 | .hamburger--spin .hamburger-inner { 74 | transition-duration: 0.22s; 75 | transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); 76 | } 77 | .hamburger--spin .hamburger-inner::before { 78 | transition: top 0.1s 0.25s ease-in, opacity 0.1s ease-in; 79 | } 80 | .hamburger--spin .hamburger-inner::after { 81 | transition: bottom 0.1s 0.25s ease-in, transform 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19); 82 | } 83 | 84 | .hamburger--spin.is-active .hamburger-inner { 85 | transform: rotate(225deg); 86 | transition-delay: 0.12s; 87 | transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); 88 | } 89 | .hamburger--spin.is-active .hamburger-inner::before { 90 | top: 0; 91 | opacity: 0; 92 | transition: top 0.1s ease-out, opacity 0.1s 0.12s ease-out; 93 | } 94 | .hamburger--spin.is-active .hamburger-inner::after { 95 | bottom: 0; 96 | transform: rotate(-90deg); 97 | transition: bottom 0.1s ease-out, transform 0.22s 0.12s cubic-bezier(0.215, 0.61, 0.355, 1); 98 | } 99 | 100 | #toggle-menu { 101 | background: none; 102 | border: none; 103 | position: absolute; 104 | right: 30px; 105 | top: 30px; 106 | z-index: 2; 107 | cursor: pointer; 108 | 109 | @include respond(md) { 110 | display: none; 111 | } 112 | 113 | outline: none; 114 | 115 | &.is-active { 116 | .hamburger-inner, 117 | .hamburger-inner::before, 118 | .hamburger-inner::after { 119 | background-color: var(--accent-color); 120 | } 121 | } 122 | } 123 | 124 | /* Menu style */ 125 | .menu { 126 | padding-left: 0; 127 | list-style: none; 128 | display: flex; 129 | flex-direction: column; 130 | overflow-y: auto; 131 | flex-grow: 1; 132 | font-size: 1.4rem; 133 | 134 | background-color: var(--card-background); 135 | padding: 15px 0; 136 | box-shadow: var(--shadow-l1); 137 | display: none; 138 | 139 | margin: 0 -15px; 140 | 141 | &.show { 142 | display: block; 143 | } 144 | 145 | @include respond(md) { 146 | align-items: flex-end; 147 | display: flex; 148 | background-color: transparent; 149 | padding: 0; 150 | box-shadow: none; 151 | margin: 0; 152 | margin-top: var(--sidebar-element-separation); 153 | } 154 | 155 | @include respond(xl) { 156 | margin-top: 30px; 157 | } 158 | 159 | li { 160 | position: relative; 161 | vertical-align: middle; 162 | padding: 10px 30px; 163 | 164 | &:not(:last-of-type) { 165 | margin-bottom: 15px; 166 | 167 | @include respond(xl) { 168 | margin-bottom: 20px; 169 | } 170 | } 171 | 172 | @include respond(md) { 173 | width: 100%; 174 | padding: 10px 0; 175 | } 176 | 177 | svg { 178 | stroke-width: 1.33; 179 | margin-right: 40px; 180 | 181 | width: 20px; 182 | height: 20px; 183 | } 184 | 185 | a { 186 | height: 100%; 187 | display: inline-flex; 188 | align-items: center; 189 | color: var(--body-text-color); 190 | } 191 | 192 | span { 193 | flex: 1; 194 | } 195 | 196 | &.current { 197 | a { 198 | color: var(--accent-color); 199 | font-weight: bold; 200 | } 201 | } 202 | } 203 | } 204 | 205 | .social-menu { 206 | list-style: none; 207 | padding: 0%; 208 | display: flex; 209 | flex-direction: row; 210 | gap: 10px; 211 | 212 | svg { 213 | width: 24px; 214 | height: 24px; 215 | stroke: var(--body-text-color); 216 | stroke-width: 1.33; 217 | } 218 | } 219 | -------------------------------------------------------------------------------- /exampleSite/config.yaml: -------------------------------------------------------------------------------- 1 | baseurl: https://example.com 2 | languageCode: en-us 3 | theme: hugo-theme-stack 4 | paginate: 5 5 | title: Example Site 6 | 7 | # Change it to your Disqus shortname before using 8 | disqusShortname: hugo-theme-stack 9 | 10 | # GA Tracking ID 11 | googleAnalytics: 12 | 13 | # Theme i18n support 14 | # Available values: en, fr, id, ja, ko, pt-br, zh-cn, zh-tw, es, de, nl, it, th, el, uk 15 | DefaultContentLanguage: en 16 | 17 | # Set hasCJKLanguage to true if DefaultContentLanguage is in [zh-cn ja ko] 18 | # This will make .Summary and .WordCount behave correctly for CJK languages. 19 | hasCJKLanguage: false 20 | 21 | permalinks: 22 | post: /p/:slug/ 23 | page: /:slug/ 24 | 25 | params: 26 | mainSections: 27 | - post 28 | featuredImageField: image 29 | rssFullContent: true 30 | favicon: 31 | 32 | footer: 33 | since: 2020 34 | customText: 35 | 36 | dateFormat: 37 | published: Jan 02, 2006 38 | lastUpdated: Jan 02, 2006 15:04 MST 39 | 40 | sidebar: 41 | emoji: 🍥 42 | subtitle: Lorem ipsum dolor sit amet, consectetur adipiscing elit. 43 | avatar: 44 | enabled: true 45 | local: true 46 | src: img/avatar.png 47 | 48 | article: 49 | math: false 50 | toc: true 51 | readingTime: true 52 | license: 53 | enabled: true 54 | default: Licensed under CC BY-NC-SA 4.0 55 | 56 | comments: 57 | enabled: true 58 | provider: disqus 59 | 60 | disqusjs: 61 | shortname: 62 | apiUrl: 63 | apiKey: 64 | admin: 65 | adminLabel: 66 | 67 | utterances: 68 | repo: 69 | issueTerm: pathname 70 | label: 71 | 72 | remark42: 73 | host: 74 | site: 75 | locale: 76 | 77 | vssue: 78 | platform: 79 | owner: 80 | repo: 81 | clientId: 82 | clientSecret: 83 | autoCreateIssue: false 84 | 85 | # Waline client configuration see: https://waline.js.org/en/reference/client.html 86 | waline: 87 | serverURL: 88 | lang: 89 | visitor: 90 | avatar: 91 | emoji: 92 | - https://cdn.jsdelivr.net/gh/walinejs/emojis/weibo 93 | requiredMeta: 94 | - name 95 | - email 96 | - url 97 | placeholder: 98 | locale: 99 | admin: Admin 100 | 101 | twikoo: 102 | envId: 103 | region: 104 | path: 105 | lang: 106 | 107 | giscus: 108 | repo: 109 | repoID: 110 | category: 111 | categoryID: 112 | mapping: 113 | lightTheme: 114 | darkTheme: 115 | reactionsEnabled: 1 116 | emitMetadata: 0 117 | 118 | gitalk: 119 | owner: 120 | admin: 121 | repo: 122 | clientID: 123 | clientSecret: 124 | 125 | cusdis: 126 | host: 127 | id: 128 | 129 | widgets: 130 | enabled: 131 | - search 132 | - archives 133 | - tag-cloud 134 | 135 | archives: 136 | limit: 5 137 | 138 | tagCloud: 139 | limit: 10 140 | 141 | opengraph: 142 | twitter: 143 | # Your Twitter username 144 | site: 145 | 146 | # Available values: summary, summary_large_image 147 | card: summary_large_image 148 | 149 | defaultImage: 150 | opengraph: 151 | enabled: false 152 | local: false 153 | src: 154 | 155 | colorScheme: 156 | # Display toggle 157 | toggle: true 158 | 159 | # Available values: auto, light, dark 160 | default: auto 161 | 162 | imageProcessing: 163 | cover: 164 | enabled: true 165 | content: 166 | enabled: true 167 | 168 | ### Custom menu 169 | ### See https://docs.stack.jimmycai.com/configuration/custom-menu.html 170 | ### To remove about, archive and search page menu item, remove `menu` field from their FrontMatter 171 | menu: 172 | main: 173 | - identifier: home 174 | name: Home 175 | url: / 176 | weight: -100 177 | params: 178 | ### For demonstration purpose, the home link will be open in a new tab 179 | newTab: true 180 | icon: home 181 | 182 | social: 183 | - identifier: github 184 | name: GitHub 185 | url: https://github.com/CaiJimmy/hugo-theme-stack 186 | params: 187 | icon: brand-github 188 | 189 | - identifier: twitter 190 | name: Twitter 191 | url: https://twitter.com 192 | params: 193 | icon: brand-twitter 194 | 195 | related: 196 | includeNewer: true 197 | threshold: 60 198 | toLower: false 199 | indices: 200 | - name: tags 201 | weight: 100 202 | 203 | - name: categories 204 | weight: 200 205 | 206 | markup: 207 | goldmark: 208 | renderer: 209 | ## Set to true if you have HTML content inside Markdown 210 | unsafe: false 211 | tableOfContents: 212 | endLevel: 4 213 | ordered: true 214 | startLevel: 2 215 | highlight: 216 | noClasses: false 217 | -------------------------------------------------------------------------------- /assets/scss/partials/highlight/dark.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Style: monokai 3 | * https://xyproto.github.io/splash/docs/monokai.html 4 | */ 5 | 6 | /* Background */ 7 | .chroma { 8 | color: #f8f8f2; 9 | background-color: #272822 10 | } 11 | 12 | /* Other */ 13 | .chroma .x {} 14 | 15 | /* Error */ 16 | .chroma .err { 17 | color: #bb0064; 18 | } 19 | 20 | /* LineTableTD */ 21 | .chroma .lntd { 22 | vertical-align: top; 23 | padding: 0; 24 | margin: 0; 25 | border: 0; 26 | } 27 | 28 | /* LineTable */ 29 | .chroma .lntable { 30 | border-spacing: 0; 31 | padding: 0; 32 | margin: 0; 33 | border: 0; 34 | width: auto; 35 | overflow: auto; 36 | display: block; 37 | } 38 | 39 | /* LineHighlight */ 40 | .chroma .hl { 41 | display: block; 42 | width: 100%; 43 | background-color: #ffffcc 44 | } 45 | 46 | /* LineNumbersTable */ 47 | .chroma .lnt { 48 | margin-right: 0.4em; 49 | padding: 0 0.4em 0 0.4em; 50 | color: #7f7f7f 51 | } 52 | 53 | /* LineNumbers */ 54 | .chroma .ln { 55 | margin-right: 0.4em; 56 | padding: 0 0.4em 0 0.4em; 57 | color: #7f7f7f 58 | } 59 | 60 | /* Keyword */ 61 | .chroma .k { 62 | color: #66d9ef 63 | } 64 | 65 | /* KeywordConstant */ 66 | .chroma .kc { 67 | color: #66d9ef 68 | } 69 | 70 | /* KeywordDeclaration */ 71 | .chroma .kd { 72 | color: #66d9ef 73 | } 74 | 75 | /* KeywordNamespace */ 76 | .chroma .kn { 77 | color: #f92672 78 | } 79 | 80 | /* KeywordPseudo */ 81 | .chroma .kp { 82 | color: #66d9ef 83 | } 84 | 85 | /* KeywordReserved */ 86 | .chroma .kr { 87 | color: #66d9ef 88 | } 89 | 90 | /* KeywordType */ 91 | .chroma .kt { 92 | color: #66d9ef 93 | } 94 | 95 | /* Name */ 96 | .chroma .n {} 97 | 98 | /* NameAttribute */ 99 | .chroma .na { 100 | color: #a6e22e 101 | } 102 | 103 | /* NameBuiltin */ 104 | .chroma .nb {} 105 | 106 | /* NameBuiltinPseudo */ 107 | .chroma .bp {} 108 | 109 | /* NameClass */ 110 | .chroma .nc { 111 | color: #a6e22e 112 | } 113 | 114 | /* NameConstant */ 115 | .chroma .no { 116 | color: #66d9ef 117 | } 118 | 119 | /* NameDecorator */ 120 | .chroma .nd { 121 | color: #a6e22e 122 | } 123 | 124 | /* NameEntity */ 125 | .chroma .ni {} 126 | 127 | /* NameException */ 128 | .chroma .ne { 129 | color: #a6e22e 130 | } 131 | 132 | /* NameFunction */ 133 | .chroma .nf { 134 | color: #a6e22e 135 | } 136 | 137 | /* NameFunctionMagic */ 138 | .chroma .fm {} 139 | 140 | /* NameLabel */ 141 | .chroma .nl {} 142 | 143 | /* NameNamespace */ 144 | .chroma .nn {} 145 | 146 | /* NameOther */ 147 | .chroma .nx { 148 | color: #a6e22e 149 | } 150 | 151 | /* NameProperty */ 152 | .chroma .py {} 153 | 154 | /* NameTag */ 155 | .chroma .nt { 156 | color: #f92672 157 | } 158 | 159 | /* NameVariable */ 160 | .chroma .nv {} 161 | 162 | /* NameVariableClass */ 163 | .chroma .vc {} 164 | 165 | /* NameVariableGlobal */ 166 | .chroma .vg {} 167 | 168 | /* NameVariableInstance */ 169 | .chroma .vi {} 170 | 171 | /* NameVariableMagic */ 172 | .chroma .vm {} 173 | 174 | /* Literal */ 175 | .chroma .l { 176 | color: #ae81ff 177 | } 178 | 179 | /* LiteralDate */ 180 | .chroma .ld { 181 | color: #e6db74 182 | } 183 | 184 | /* LiteralString */ 185 | .chroma .s { 186 | color: #e6db74 187 | } 188 | 189 | /* LiteralStringAffix */ 190 | .chroma .sa { 191 | color: #e6db74 192 | } 193 | 194 | /* LiteralStringBacktick */ 195 | .chroma .sb { 196 | color: #e6db74 197 | } 198 | 199 | /* LiteralStringChar */ 200 | .chroma .sc { 201 | color: #e6db74 202 | } 203 | 204 | /* LiteralStringDelimiter */ 205 | .chroma .dl { 206 | color: #e6db74 207 | } 208 | 209 | /* LiteralStringDoc */ 210 | .chroma .sd { 211 | color: #e6db74 212 | } 213 | 214 | /* LiteralStringDouble */ 215 | .chroma .s2 { 216 | color: #e6db74 217 | } 218 | 219 | /* LiteralStringEscape */ 220 | .chroma .se { 221 | color: #ae81ff 222 | } 223 | 224 | /* LiteralStringHeredoc */ 225 | .chroma .sh { 226 | color: #e6db74 227 | } 228 | 229 | /* LiteralStringInterpol */ 230 | .chroma .si { 231 | color: #e6db74 232 | } 233 | 234 | /* LiteralStringOther */ 235 | .chroma .sx { 236 | color: #e6db74 237 | } 238 | 239 | /* LiteralStringRegex */ 240 | .chroma .sr { 241 | color: #e6db74 242 | } 243 | 244 | /* LiteralStringSingle */ 245 | .chroma .s1 { 246 | color: #e6db74 247 | } 248 | 249 | /* LiteralStringSymbol */ 250 | .chroma .ss { 251 | color: #e6db74 252 | } 253 | 254 | /* LiteralNumber */ 255 | .chroma .m { 256 | color: #ae81ff 257 | } 258 | 259 | /* LiteralNumberBin */ 260 | .chroma .mb { 261 | color: #ae81ff 262 | } 263 | 264 | /* LiteralNumberFloat */ 265 | .chroma .mf { 266 | color: #ae81ff 267 | } 268 | 269 | /* LiteralNumberHex */ 270 | .chroma .mh { 271 | color: #ae81ff 272 | } 273 | 274 | /* LiteralNumberInteger */ 275 | .chroma .mi { 276 | color: #ae81ff 277 | } 278 | 279 | /* LiteralNumberIntegerLong */ 280 | .chroma .il { 281 | color: #ae81ff 282 | } 283 | 284 | /* LiteralNumberOct */ 285 | .chroma .mo { 286 | color: #ae81ff 287 | } 288 | 289 | /* Operator */ 290 | .chroma .o { 291 | color: #f92672 292 | } 293 | 294 | /* OperatorWord */ 295 | .chroma .ow { 296 | color: #f92672 297 | } 298 | 299 | /* Punctuation */ 300 | .chroma .p {} 301 | 302 | /* Comment */ 303 | .chroma .c { 304 | color: #75715e 305 | } 306 | 307 | /* CommentHashbang */ 308 | .chroma .ch { 309 | color: #75715e 310 | } 311 | 312 | /* CommentMultiline */ 313 | .chroma .cm { 314 | color: #75715e 315 | } 316 | 317 | /* CommentSingle */ 318 | .chroma .c1 { 319 | color: #75715e 320 | } 321 | 322 | /* CommentSpecial */ 323 | .chroma .cs { 324 | color: #75715e 325 | } 326 | 327 | /* CommentPreproc */ 328 | .chroma .cp { 329 | color: #75715e 330 | } 331 | 332 | /* CommentPreprocFile */ 333 | .chroma .cpf { 334 | color: #75715e 335 | } 336 | 337 | /* Generic */ 338 | .chroma .g {} 339 | 340 | /* GenericDeleted */ 341 | .chroma .gd { 342 | color: #f92672 343 | } 344 | 345 | /* GenericEmph */ 346 | .chroma .ge { 347 | font-style: italic 348 | } 349 | 350 | /* GenericError */ 351 | .chroma .gr {} 352 | 353 | /* GenericHeading */ 354 | .chroma .gh {} 355 | 356 | /* GenericInserted */ 357 | .chroma .gi { 358 | color: #a6e22e 359 | } 360 | 361 | /* GenericOutput */ 362 | .chroma .go {} 363 | 364 | /* GenericPrompt */ 365 | .chroma .gp {} 366 | 367 | /* GenericStrong */ 368 | .chroma .gs { 369 | font-weight: bold 370 | } 371 | 372 | /* GenericSubheading */ 373 | .chroma .gu { 374 | color: #75715e 375 | } 376 | 377 | /* GenericTraceback */ 378 | .chroma .gt {} 379 | 380 | /* GenericUnderline */ 381 | .chroma .gl {} 382 | 383 | /* TextWhitespace */ 384 | .chroma .w {} -------------------------------------------------------------------------------- /assets/scss/partials/highlight/light.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Style: monokailight 3 | * https://xyproto.github.io/splash/docs/monokailight.html 4 | */ 5 | 6 | /* Background */ 7 | .chroma { 8 | color: #272822; 9 | background-color: #fafafa; 10 | } 11 | 12 | /* Other */ 13 | .chroma .x {} 14 | 15 | /* Error */ 16 | .chroma .err { 17 | color: #960050; 18 | } 19 | 20 | /* LineTableTD */ 21 | .chroma .lntd { 22 | vertical-align: top; 23 | padding: 0; 24 | margin: 0; 25 | border: 0; 26 | } 27 | 28 | /* LineTable */ 29 | .chroma .lntable { 30 | border-spacing: 0; 31 | padding: 0; 32 | margin: 0; 33 | border: 0; 34 | width: auto; 35 | overflow: auto; 36 | display: block; 37 | } 38 | 39 | /* LineHighlight */ 40 | .chroma .hl { 41 | display: block; 42 | width: 100%; 43 | background-color: #ffffcc 44 | } 45 | 46 | /* LineNumbersTable */ 47 | .chroma .lnt { 48 | margin-right: 0.4em; 49 | padding: 0 0.4em 0 0.4em; 50 | color: #7f7f7f 51 | } 52 | 53 | /* LineNumbers */ 54 | .chroma .ln { 55 | margin-right: 0.4em; 56 | padding: 0 0.4em 0 0.4em; 57 | color: #7f7f7f 58 | } 59 | 60 | /* Keyword */ 61 | .chroma .k { 62 | color: #00a8c8 63 | } 64 | 65 | /* KeywordConstant */ 66 | .chroma .kc { 67 | color: #00a8c8 68 | } 69 | 70 | /* KeywordDeclaration */ 71 | .chroma .kd { 72 | color: #00a8c8 73 | } 74 | 75 | /* KeywordNamespace */ 76 | .chroma .kn { 77 | color: #f92672 78 | } 79 | 80 | /* KeywordPseudo */ 81 | .chroma .kp { 82 | color: #00a8c8 83 | } 84 | 85 | /* KeywordReserved */ 86 | .chroma .kr { 87 | color: #00a8c8 88 | } 89 | 90 | /* KeywordType */ 91 | .chroma .kt { 92 | color: #00a8c8 93 | } 94 | 95 | /* Name */ 96 | .chroma .n { 97 | color: #111111 98 | } 99 | 100 | /* NameAttribute */ 101 | .chroma .na { 102 | color: #75af00 103 | } 104 | 105 | /* NameBuiltin */ 106 | .chroma .nb { 107 | color: #111111 108 | } 109 | 110 | /* NameBuiltinPseudo */ 111 | .chroma .bp { 112 | color: #111111 113 | } 114 | 115 | /* NameClass */ 116 | .chroma .nc { 117 | color: #75af00 118 | } 119 | 120 | /* NameConstant */ 121 | .chroma .no { 122 | color: #00a8c8 123 | } 124 | 125 | /* NameDecorator */ 126 | .chroma .nd { 127 | color: #75af00 128 | } 129 | 130 | /* NameEntity */ 131 | .chroma .ni { 132 | color: #111111 133 | } 134 | 135 | /* NameException */ 136 | .chroma .ne { 137 | color: #75af00 138 | } 139 | 140 | /* NameFunction */ 141 | .chroma .nf { 142 | color: #75af00 143 | } 144 | 145 | /* NameFunctionMagic */ 146 | .chroma .fm { 147 | color: #111111 148 | } 149 | 150 | /* NameLabel */ 151 | .chroma .nl { 152 | color: #111111 153 | } 154 | 155 | /* NameNamespace */ 156 | .chroma .nn { 157 | color: #111111 158 | } 159 | 160 | /* NameOther */ 161 | .chroma .nx { 162 | color: #75af00 163 | } 164 | 165 | /* NameProperty */ 166 | .chroma .py { 167 | color: #111111 168 | } 169 | 170 | /* NameTag */ 171 | .chroma .nt { 172 | color: #f92672 173 | } 174 | 175 | /* NameVariable */ 176 | .chroma .nv { 177 | color: #111111 178 | } 179 | 180 | /* NameVariableClass */ 181 | .chroma .vc { 182 | color: #111111 183 | } 184 | 185 | /* NameVariableGlobal */ 186 | .chroma .vg { 187 | color: #111111 188 | } 189 | 190 | /* NameVariableInstance */ 191 | .chroma .vi { 192 | color: #111111 193 | } 194 | 195 | /* NameVariableMagic */ 196 | .chroma .vm { 197 | color: #111111 198 | } 199 | 200 | /* Literal */ 201 | .chroma .l { 202 | color: #ae81ff 203 | } 204 | 205 | /* LiteralDate */ 206 | .chroma .ld { 207 | color: #d88200 208 | } 209 | 210 | /* LiteralString */ 211 | .chroma .s { 212 | color: #d88200 213 | } 214 | 215 | /* LiteralStringAffix */ 216 | .chroma .sa { 217 | color: #d88200 218 | } 219 | 220 | /* LiteralStringBacktick */ 221 | .chroma .sb { 222 | color: #d88200 223 | } 224 | 225 | /* LiteralStringChar */ 226 | .chroma .sc { 227 | color: #d88200 228 | } 229 | 230 | /* LiteralStringDelimiter */ 231 | .chroma .dl { 232 | color: #d88200 233 | } 234 | 235 | /* LiteralStringDoc */ 236 | .chroma .sd { 237 | color: #d88200 238 | } 239 | 240 | /* LiteralStringDouble */ 241 | .chroma .s2 { 242 | color: #d88200 243 | } 244 | 245 | /* LiteralStringEscape */ 246 | .chroma .se { 247 | color: #8045ff 248 | } 249 | 250 | /* LiteralStringHeredoc */ 251 | .chroma .sh { 252 | color: #d88200 253 | } 254 | 255 | /* LiteralStringInterpol */ 256 | .chroma .si { 257 | color: #d88200 258 | } 259 | 260 | /* LiteralStringOther */ 261 | .chroma .sx { 262 | color: #d88200 263 | } 264 | 265 | /* LiteralStringRegex */ 266 | .chroma .sr { 267 | color: #d88200 268 | } 269 | 270 | /* LiteralStringSingle */ 271 | .chroma .s1 { 272 | color: #d88200 273 | } 274 | 275 | /* LiteralStringSymbol */ 276 | .chroma .ss { 277 | color: #d88200 278 | } 279 | 280 | /* LiteralNumber */ 281 | .chroma .m { 282 | color: #ae81ff 283 | } 284 | 285 | /* LiteralNumberBin */ 286 | .chroma .mb { 287 | color: #ae81ff 288 | } 289 | 290 | /* LiteralNumberFloat */ 291 | .chroma .mf { 292 | color: #ae81ff 293 | } 294 | 295 | /* LiteralNumberHex */ 296 | .chroma .mh { 297 | color: #ae81ff 298 | } 299 | 300 | /* LiteralNumberInteger */ 301 | .chroma .mi { 302 | color: #ae81ff 303 | } 304 | 305 | /* LiteralNumberIntegerLong */ 306 | .chroma .il { 307 | color: #ae81ff 308 | } 309 | 310 | /* LiteralNumberOct */ 311 | .chroma .mo { 312 | color: #ae81ff 313 | } 314 | 315 | /* Operator */ 316 | .chroma .o { 317 | color: #f92672 318 | } 319 | 320 | /* OperatorWord */ 321 | .chroma .ow { 322 | color: #f92672 323 | } 324 | 325 | /* Punctuation */ 326 | .chroma .p { 327 | color: #111111 328 | } 329 | 330 | /* Comment */ 331 | .chroma .c { 332 | color: #75715e 333 | } 334 | 335 | /* CommentHashbang */ 336 | .chroma .ch { 337 | color: #75715e 338 | } 339 | 340 | /* CommentMultiline */ 341 | .chroma .cm { 342 | color: #75715e 343 | } 344 | 345 | /* CommentSingle */ 346 | .chroma .c1 { 347 | color: #75715e 348 | } 349 | 350 | /* CommentSpecial */ 351 | .chroma .cs { 352 | color: #75715e 353 | } 354 | 355 | /* CommentPreproc */ 356 | .chroma .cp { 357 | color: #75715e 358 | } 359 | 360 | /* CommentPreprocFile */ 361 | .chroma .cpf { 362 | color: #75715e 363 | } 364 | 365 | /* Generic */ 366 | .chroma .g {} 367 | 368 | /* GenericDeleted */ 369 | .chroma .gd {} 370 | 371 | /* GenericEmph */ 372 | .chroma .ge { 373 | font-style: italic 374 | } 375 | 376 | /* GenericError */ 377 | .chroma .gr {} 378 | 379 | /* GenericHeading */ 380 | .chroma .gh {} 381 | 382 | /* GenericInserted */ 383 | .chroma .gi {} 384 | 385 | /* GenericOutput */ 386 | .chroma .go {} 387 | 388 | /* GenericPrompt */ 389 | .chroma .gp {} 390 | 391 | /* GenericStrong */ 392 | .chroma .gs { 393 | font-weight: bold 394 | } 395 | 396 | /* GenericSubheading */ 397 | .chroma .gu {} 398 | 399 | /* GenericTraceback */ 400 | .chroma .gt {} 401 | 402 | /* GenericUnderline */ 403 | .chroma .gl {} 404 | 405 | /* TextWhitespace */ 406 | .chroma .w {} --------------------------------------------------------------------------------