diff --git a/.github/workflows/hugo-artifact.yml b/.github/workflows/hugo-artifact.yml new file mode 100644 index 0000000..be63ba0 --- /dev/null +++ b/.github/workflows/hugo-artifact.yml @@ -0,0 +1,42 @@ +name: Build Hugo Artifact + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [master] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Hugo setup + uses: peaceiris/actions-hugo@v2.4.13 + with: + # The Hugo version to download (if necessary) and use. Example: 0.58.2 + hugo-version: latest # optional, default is latest + # Download (if necessary) and use Hugo extended version. Example: true + extended: true # optional, default is false + + # Runs a set of commands using the runners shell + - name: Generate Hugo site + run: cd exampleSite && hugo --gc --themesDir ../.. + + - name: Upload Hugo artifact + uses: actions/upload-artifact@v2.2.2 + with: + # Artifact name + name: resources + # A file, directory or wildcard pattern that describes what to upload + path: resources diff --git a/assets/scss/partials/highlight/dark.scss b/assets/scss/partials/highlight/dark.scss index 00e8942..2c13946 100644 --- a/assets/scss/partials/highlight/dark.scss +++ b/assets/scss/partials/highlight/dark.scss @@ -14,8 +14,7 @@ /* Error */ .chroma .err { - color: #960050; - background-color: #1e0010 + color: #bb0064; } /* LineTableTD */ diff --git a/assets/scss/partials/highlight/light.scss b/assets/scss/partials/highlight/light.scss index 7ac7d71..9ddcff9 100644 --- a/assets/scss/partials/highlight/light.scss +++ b/assets/scss/partials/highlight/light.scss @@ -15,7 +15,6 @@ /* Error */ .chroma .err { color: #960050; - background-color: #1e0010 } /* LineTableTD */ diff --git a/assets/scss/partials/layout/article.scss b/assets/scss/partials/layout/article.scss index 4b3beca..361e691 100644 --- a/assets/scss/partials/layout/article.scss +++ b/assets/scss/partials/layout/article.scss @@ -244,7 +244,6 @@ padding: 2px 4px; border-radius: var(--tag-border-radius); font-family: var(--code-font-family); - word-wrap: break-word; } .gallery { diff --git a/assets/scss/variables.scss b/assets/scss/variables.scss index 3a8a1a5..cba32e5 100644 --- a/assets/scss/variables.scss +++ b/assets/scss/variables.scss @@ -52,8 +52,8 @@ $defaultTagColors: #fff, #fff, #fff, #fff, #fff; --sys-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Droid Sans", "Helvetica Neue"; --zh-font-family: "PingFang SC", "Hiragino Sans GB", "Droid Sans Fallback", "Microsoft YaHei"; - --base-font-family: "Lato", var(--sys-font-family), var(--zh-font-family); - --code-font-family: Menlo, Monaco, Consolas, "Courier New"; + --base-font-family: "Lato", var(--sys-font-family), var(--zh-font-family), sans-serif; + --code-font-family: Menlo, Monaco, Consolas, "Courier New", monospace; } /* diff --git a/data/external.yaml b/data/external.yaml new file mode 100644 index 0000000..2721e76 --- /dev/null +++ b/data/external.yaml @@ -0,0 +1,38 @@ +Vibrant: + - src: https://cdn.jsdelivr.net/npm/node-vibrant@3.1.5/dist/vibrant.min.js + integrity: sha256-5NovOZc4iwiAWTYIFiIM7DxKUXKWvpVEuMEPLzcm5/g= + type: script + +PhotoSwipe: + - src: https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js + integrity: sha256-ePwmChbbvXbsO02lbM3HoHbSHTHFAeChekF1xKJdleo= + type: script + defer: true + + - src: https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js + integrity: sha256-UKkzOn/w1mBxRmLLGrSeyB4e1xbrp4xylgAWb3M42pU= + type: script + defer: true + + - src: https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.css + integrity: sha256-c0uckgykQ9v5k+IqViZOZKc47Jn7KQil4/MP3ySA3F8= + type: style + + - src: https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.css + integrity: sha256-SBLU4vv6CA6lHsZ1XyTdhyjJxCjPif/TRkjnsyGAGnE= + type: style + +KaTeX: + - src: https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css + integrity: sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X + type: style + + - src: https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js + integrity: sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4 + type: script + defer: true + + - src: https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js + integrity: sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa + type: script + defer: true diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 16f2d98..d46e84d 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -7,6 +7,9 @@ title: Example Site # Change it to your Disqus shortname before using disqusShortname: hugo-theme-stack +# GA Tracking ID +googleAnalytics: + # Theme i18n support # Available values: en, fr, id, ja, ko, pt-br, zh-cn DefaultContentLanguage: en @@ -46,11 +49,12 @@ params: comments: enabled: true provider: disqus + utterances: repo: issueTerm: pathname label: - theme: preferred-color-scheme + remark42: host: # remark42服务端地址 site: # remark site id参数 diff --git a/layouts/_default/list.html b/layouts/_default/list.html index b4efb67..90e5b66 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -42,8 +42,17 @@ {{ end }} - {{ $subsections := .Sections }} - {{ with $subsections }} + {{- $subsections := .Sections -}} + {{- $pages := .Pages | complement $subsections -}} + + {{- if eq (len $pages) 0 -}} + {{/* If there are no normal pages, display subsections in list style, with pagination */}} + {{/* This happens with taxonomies like categories or tags */}} + {{- $pages = $subsections -}} + {{- $subsections = slice -}} + {{- end -}} + + {{- with $subsections -}}