From e61bca1dbdfc8a8232193b7672e7d4190bb34d31 Mon Sep 17 00:00:00 2001 From: Spicy <68587155+Sp-cy@users.noreply.github.com> Date: Fri, 26 Feb 2021 10:43:47 -0600 Subject: [PATCH 001/119] i18n: Spanish translation (#155) Co-authored-by: Jimmy Cai --- i18n/es.yaml | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 i18n/es.yaml diff --git a/i18n/es.yaml b/i18n/es.yaml new file mode 100644 index 0000000..d82698b --- /dev/null +++ b/i18n/es.yaml @@ -0,0 +1,53 @@ +toggleMenu: + other: Toggle Menu + +darkMode: + other: Modo oscuro + +list: + page: + one: "{{ .Count }} página" + other: "{{ .Count }} páginas" + + section: + other: Sección + + subsection: + one: Subsección + other: Subsecciones + +article: + relatedContents: + other: Contenidos relacionados + lastUpdatedOn: + other: Última vez actualizado + +notFound: + title: + other: No Encontrado + subtitle: + other: Esta página no existe + +widget: + archives: + title: + other: Archivo + more: + other: Más + tagCloud: + title: + other: Etiquetas + +search: + title: + other: Búsqueda + placeholder: + other: Teclea algo... + resultTitle: + other: "#PAGES_COUNT páginas en (#TIME_SECONDS segundos)" + +footer: + builtWith: + other: Creado con {{ .Generator }} + designedBy: + other: Tema {{ .Theme }} diseñado por {{ .DesignedBy }} From 38eb9c4eaf513c278ca991c7f0e9e65f6d11890e Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Sat, 6 Mar 2021 13:41:46 -0600 Subject: [PATCH 002/119] fix(article): also define the padding for div under .article-content (#162) Fixes rstudio/blogdown#591: not only `

` but also `

` could be the direct child of `.article-content`, so we also need the padding for `
`. The `div`s are generated by Pandoc, instead of Hugo's Markdown renderer. I think it will be great to support both ways. --- assets/scss/partials/layout/article.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/scss/partials/layout/article.scss b/assets/scss/partials/layout/article.scss index 3248163..3fd6a46 100644 --- a/assets/scss/partials/layout/article.scss +++ b/assets/scss/partials/layout/article.scss @@ -189,7 +189,8 @@ font-size: var(--article-font-size); line-height: var(--article-line-height); - & > p { + & > p, + & > div { margin: 1.5em 0; padding: 0 var(--card-padding); } From d5268a41e0629efe728524d5f0a14564359ff279 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 7 Mar 2021 12:51:47 +0100 Subject: [PATCH 003/119] refactor(article): add default padding (#166) * refactor(article): add default padding closes https://github.com/CaiJimmy/hugo-theme-stack/issues/165 * fix(article): video iframe margin * fix: remove youtube iframe border --- assets/scss/partials/layout/article.scss | 49 +++++++++++++++++------- layouts/shortcodes/bilibili.html | 3 +- layouts/shortcodes/tencent.html | 6 +-- layouts/shortcodes/youtube.html | 10 +++-- 4 files changed, 46 insertions(+), 22 deletions(-) diff --git a/assets/scss/partials/layout/article.scss b/assets/scss/partials/layout/article.scss index 3fd6a46..3dce3e6 100644 --- a/assets/scss/partials/layout/article.scss +++ b/assets/scss/partials/layout/article.scss @@ -187,12 +187,11 @@ .article-content { font-family: var(--article-font-family); font-size: var(--article-font-size); + padding: 0 var(--card-padding); line-height: var(--article-line-height); - & > p, - & > div { + & > p { margin: 1.5em 0; - padding: 0 var(--card-padding); } h1, @@ -201,12 +200,12 @@ h4, h5, h6 { - padding: 0 calc(var(--card-padding) - var(--heading-border-size)); + margin-left: calc((var(--card-padding)) * -1); + padding-left: calc(var(--card-padding) - var(--heading-border-size)); border-left: var(--heading-border-size) solid var(--accent-color); } figure { - margin: 0 auto; text-align: center; figcaption { @@ -217,17 +216,12 @@ blockquote { position: relative; - margin: 10px 0; + margin: 1.5em 0; border-left: var(--blockquote-border-size) solid var(--card-separator-color); padding: 15px calc(var(--card-padding) - var(--blockquote-border-size)); background-color: var(--blockquote-background-color); } - & > ul, - & > ol { - margin: 1em var(--card-padding); - } - hr { width: 100px; margin: 40px auto; @@ -250,7 +244,7 @@ display: flex; flex-direction: row; justify-content: center; - margin: 20px 0; + margin: 1.5em 0; figure { margin: 0; @@ -280,9 +274,7 @@ } table { - margin: 0 var(--card-padding); width: 100%; - max-width: calc(100% - var(--card-padding) * 2); border-collapse: collapse; border-spacing: 0; margin-bottom: 1.5em; @@ -307,4 +299,33 @@ .twitter-tweet { color: var(--card-text-color-main); } + + .video-wrapper { + position: relative; + width: 100%; + height: 0; + padding-bottom: 56.25%; + overflow: hidden; + + & > iframe { + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; + border: 0; + } + } + + /// Negative margins + blockquote, + figure, + .gallery, + pre, + .video-wrapper, + .s_video_simple { + margin-left: calc((var(--card-padding)) * -1); + margin-right: calc((var(--card-padding)) * -1); + width: calc(100% + var(--card-padding) * 2); + } } diff --git a/layouts/shortcodes/bilibili.html b/layouts/shortcodes/bilibili.html index 3c563dc..602406c 100644 --- a/layouts/shortcodes/bilibili.html +++ b/layouts/shortcodes/bilibili.html @@ -12,13 +12,12 @@

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

{{ end }} -
+
diff --git a/layouts/shortcodes/tencent.html b/layouts/shortcodes/tencent.html index 09f9e8b..baf5f3c 100644 --- a/layouts/shortcodes/tencent.html +++ b/layouts/shortcodes/tencent.html @@ -1,10 +1,10 @@ {{ $vid := .Get 0 }} -
+
\ No newline at end of file diff --git a/layouts/shortcodes/youtube.html b/layouts/shortcodes/youtube.html index 5dd94e6..2f85931 100644 --- a/layouts/shortcodes/youtube.html +++ b/layouts/shortcodes/youtube.html @@ -2,8 +2,12 @@ {{- if not $pc.Disable -}} {{- $ytHost := cond $pc.PrivacyEnhanced "www.youtube-nocookie.com" "www.youtube.com" -}} {{- $id := .Get "id" | default (.Get 0) -}} -{{- $class := .Get "class" | default (.Get 1) }} -
- +
+
{{ end -}} \ No newline at end of file From 9befda7310feebd5b8e477f735dce62d85b3b412 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 7 Mar 2021 13:02:39 +0100 Subject: [PATCH 004/119] refactor: add exampleSite menu using FrontMatter (#167) --- exampleSite/config.yaml | 21 +++------------------ exampleSite/content/page/about.md | 24 +++++++++++++++--------- exampleSite/content/page/archives.md | 4 ++++ exampleSite/content/page/search.md | 4 ++++ 4 files changed, 26 insertions(+), 27 deletions(-) diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index b55925f..67dcfc2 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -99,6 +99,9 @@ params: content: enabled: true +### Custom menu +### See https://docs.stack.jimmycai.com/configuration/custom-menu +### To remove about, archive and search page menu item, remove `menu` field from their FrontMatter menu: main: - identifier: home @@ -107,24 +110,6 @@ menu: weight: -100 pre: home - - identifier: about - name: About - url: about - weight: -90 - pre: user - - - identifier: archives - name: Archives - url: archives - weight: -70 - pre: archives - - - identifier: search - name: Search - url: search - weight: -60 - pre: search - related: includeNewer: true threshold: 60 diff --git a/exampleSite/content/page/about.md b/exampleSite/content/page/about.md index 8a8789f..79898de 100644 --- a/exampleSite/content/page/about.md +++ b/exampleSite/content/page/about.md @@ -1,12 +1,18 @@ -+++ -title = "About" -description = "Hugo, the world's fastest framework for building websites" -date = "2019-02-28" -aliases = ["about-us", "about-hugo", "contact"] -author = "Hugo Authors" -license = "CC BY-NC-ND" -lastmod = "2020-10-09" -+++ +--- +title: About +description: Hugo, the world's fastest framework for building websites +date: '2019-02-28' +aliases: + - about-us + - about-hugo + - contact +license: CC BY-NC-ND +lastmod: '2020-10-09' +menu: + main: + weight: -90 + pre: user +--- 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. diff --git a/exampleSite/content/page/archives.md b/exampleSite/content/page/archives.md index e25595b..027dfc6 100644 --- a/exampleSite/content/page/archives.md +++ b/exampleSite/content/page/archives.md @@ -3,4 +3,8 @@ title: "Archives" date: 2019-05-28 layout: "archives" slug: "archives" +menu: + main: + weight: -70 + pre: archives --- diff --git a/exampleSite/content/page/search.md b/exampleSite/content/page/search.md index 0363546..f54cdb5 100644 --- a/exampleSite/content/page/search.md +++ b/exampleSite/content/page/search.md @@ -5,4 +5,8 @@ layout: "search" outputs: - html - json +menu: + main: + weight: -60 + pre: search --- \ No newline at end of file From 3e8490da1d7beabfc563a16e64428f1df9aa942c Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 7 Mar 2021 13:13:07 +0100 Subject: [PATCH 005/119] fix: incorrect image & menu path for site hosted in subdir (#168) --- layouts/_default/_markup/render-image.html | 2 +- layouts/partials/helper/image.html | 4 ++-- layouts/partials/sidebar/left.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index e13896a..fbaba27 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -26,5 +26,5 @@ {{ end }} {{- else -}} - {{ .Text }} + {{ .Text }} {{- end -}} \ No newline at end of file diff --git a/layouts/partials/helper/image.html b/layouts/partials/helper/image.html index 8791aa7..dd86d27 100644 --- a/layouts/partials/helper/image.html +++ b/layouts/partials/helper/image.html @@ -23,7 +23,7 @@ {{ end }} {{ else }} - {{ $result = merge $result (dict "permalink" $imageValue) }} + {{ $result = merge $result (dict "permalink" (relURL $imageValue)) }} {{ end }} {{ end }} @@ -51,7 +51,7 @@ {{ else }} - {{ $result = merge $result (dict "permalink" $defaultImageSetting.src) }} + {{ $result = merge $result (dict "permalink" (relURL $defaultImageSetting.src)) }} {{ end }} {{ end }} diff --git a/layouts/partials/sidebar/left.html b/layouts/partials/sidebar/left.html index 14f195e..c7158bb 100644 --- a/layouts/partials/sidebar/left.html +++ b/layouts/partials/sidebar/left.html @@ -37,7 +37,7 @@ {{ $active := or (eq $currentPage.Title .Name) (or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .)) }}
  • - + {{ if .Pre }} {{ partial "helper/icon" .Pre }} {{ end }} From 21a5834a2faff056815d8bb4c3b500a171971094 Mon Sep 17 00:00:00 2001 From: Matthias Thym Date: Sat, 27 Mar 2021 14:20:47 +0100 Subject: [PATCH 006/119] i18n: German translation --- exampleSite/config.yaml | 2 +- i18n/de.yaml | 53 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 i18n/de.yaml diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 67dcfc2..3357712 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -11,7 +11,7 @@ disqusShortname: hugo-theme-stack googleAnalytics: # Theme i18n support -# Available values: en, fr, id, ja, ko, pt-br, zh-cn +# Available values: en, fr, id, ja, ko, pt-br, zh-cn, de DefaultContentLanguage: en permalinks: diff --git a/i18n/de.yaml b/i18n/de.yaml new file mode 100644 index 0000000..25a708a --- /dev/null +++ b/i18n/de.yaml @@ -0,0 +1,53 @@ +toggleMenu: + other: Menü umschalten + +darkMode: + other: Dunkler Modus + +list: + page: + one: "{{ .Count }} Seite" + other: "{{ .Count }} Seiten" + + section: + other: Abschnitt + + subsection: + one: Unterabschnitt + other: Unterabschnitte + +article: + relatedContents: + other: Verwandte Inhalte + lastUpdatedOn: + other: Zuletzt aktualisiert am + +notFound: + title: + other: Seite nicht gefunden + subtitle: + other: Diese Seite existiert nicht. + +widget: + archives: + title: + other: Archiv + more: + other: Weitere + tagCloud: + title: + other: Schlagwörter + +search: + title: + other: Suche + placeholder: + other: Etwas tippen... + resultTitle: + other: "#PAGES_COUNT pages (#TIME_SECONDS seconds)" + +footer: + builtWith: + other: Erstellt mit {{ .Generator }} + designedBy: + other: Theme {{ .Theme }} gestaltet von {{ .DesignedBy }} From 87fad5fd81deff42d686c634fdf54cdec0a16221 Mon Sep 17 00:00:00 2001 From: Matthias Thym Date: Sat, 27 Mar 2021 14:34:00 +0100 Subject: [PATCH 007/119] refactor: add missing i18n option 'es' --- exampleSite/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 3357712..9a22130 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -11,7 +11,7 @@ disqusShortname: hugo-theme-stack googleAnalytics: # Theme i18n support -# Available values: en, fr, id, ja, ko, pt-br, zh-cn, de +# Available values: en, fr, id, ja, ko, pt-br, zh-cn, es, de DefaultContentLanguage: en permalinks: From 1300e0d714f102d4c26e10803d23b1ff9cbc4d9d Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sat, 27 Mar 2021 23:39:29 +0100 Subject: [PATCH 008/119] release: 2.3.0 --- layouts/partials/footer/footer.html | 2 +- .../style.scss_b95b077eb505d5c0aff8055eaced30ad.content | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/layouts/partials/footer/footer.html b/layouts/partials/footer/footer.html index 8f8340b..da41cdc 100644 --- a/layouts/partials/footer/footer.html +++ b/layouts/partials/footer/footer.html @@ -1,4 +1,4 @@ -{{- $ThemeVersion := "2.2.0" -}} +{{- $ThemeVersion := "2.3.0" -}} \ No newline at end of file + From d86b857635de302d7cceb64112e68a573e17b4de Mon Sep 17 00:00:00 2001 From: zhixuan <59254886+zhixuan666@users.noreply.github.com> Date: Tue, 27 Jul 2021 03:59:24 +0900 Subject: [PATCH 045/119] chore: update `KaTeX` to 0.13.13 (#275) --- data/external.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/data/external.yaml b/data/external.yaml index 2721e76..427c8aa 100644 --- a/data/external.yaml +++ b/data/external.yaml @@ -23,16 +23,16 @@ PhotoSwipe: 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 + - src: https://cdn.jsdelivr.net/npm/katex@0.13.13/dist/katex.min.css + integrity: sha384-RZU/ijkSsFbcmivfdRBQDtwuwVqK7GMOw6IMvKyeWL2K5UAlyp6WonmB8m7Jd0Hn type: style - - src: https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js - integrity: sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4 + - src: https://cdn.jsdelivr.net/npm/katex@0.13.13/dist/katex.min.js + integrity: sha384-pK1WpvzWVBQiP0/GjnvRxV4mOb0oxFuyRxJlk6vVw146n3egcN5C925NCP7a7BY8 type: script defer: true - - src: https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js - integrity: sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa + - src: https://cdn.jsdelivr.net/npm/katex@0.13.13/dist/contrib/auto-render.min.js + integrity: sha384-vZTG03m+2yp6N6BNi5iM4rW4oIwk5DfcNdFfxkk9ZWpDriOkXX8voJBFrAO7MpVl type: script defer: true From 8d0c65c374bba25861930125b58b2675cdade32d Mon Sep 17 00:00:00 2001 From: Farrel Franqois Date: Tue, 27 Jul 2021 15:16:54 +0700 Subject: [PATCH 046/119] feat(i18n): Add Indonesian translation for `readingTime` (#279) --- i18n/id.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/i18n/id.yaml b/i18n/id.yaml index 35a7fab..2af893a 100644 --- a/i18n/id.yaml +++ b/i18n/id.yaml @@ -29,6 +29,10 @@ article: lastUpdatedOn: other: Terakhir diperbarui pada + readingTime: + one: "Waktu Membaca: {{ .Count }} menit" + other: "Waktu Membaca: {{ .Count }} menit" + notFound: title: other: Tidak ditemukan From 99c4c89f0afcb22b62523e6c18d317d695aabde0 Mon Sep 17 00:00:00 2001 From: zhixuan <59254886+zhixuan666@users.noreply.github.com> Date: Tue, 27 Jul 2021 17:42:06 +0900 Subject: [PATCH 047/119] feat(article): add video shortcode (#280) --- assets/scss/partials/layout/article.scss | 2 +- layouts/shortcodes/video.html | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 layouts/shortcodes/video.html diff --git a/assets/scss/partials/layout/article.scss b/assets/scss/partials/layout/article.scss index 5331a61..4309039 100644 --- a/assets/scss/partials/layout/article.scss +++ b/assets/scss/partials/layout/article.scss @@ -385,7 +385,7 @@ padding-bottom: 56.25%; overflow: hidden; - & > iframe { + & > iframe, & > video { position: absolute; width: 100%; height: 100%; diff --git a/layouts/shortcodes/video.html b/layouts/shortcodes/video.html new file mode 100644 index 0000000..733761a --- /dev/null +++ b/layouts/shortcodes/video.html @@ -0,0 +1,13 @@ +
    + +
    From 910d93b4ceb8a74e223fb4f34ab2021f67246eaf Mon Sep 17 00:00:00 2001 From: giacomocarrozzo <6900557+giacomocarrozzo@users.noreply.github.com> Date: Thu, 29 Jul 2021 15:59:15 +0200 Subject: [PATCH 048/119] feat(i18n): Italian translation (#281) --- exampleSite/config.yaml | 2 +- i18n/it.yaml | 69 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 i18n/it.yaml diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 2ff6a1e..ac30c01 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -11,7 +11,7 @@ disqusShortname: hugo-theme-stack googleAnalytics: # Theme i18n support -# Available values: en, fr, id, ja, ko, pt-br, zh-cn, es, de, nl +# Available values: en, fr, id, ja, ko, pt-br, zh-cn, es, de, nl, it DefaultContentLanguage: en permalinks: diff --git a/i18n/it.yaml b/i18n/it.yaml new file mode 100644 index 0000000..6c4114c --- /dev/null +++ b/i18n/it.yaml @@ -0,0 +1,69 @@ +toggleMenu: + other: Toggle Menu + +darkMode: + other: Dark Mode + +list: + page: + one: "{{ .Count }} pagina" + other: "{{ .Count }} pagine" + + section: + other: Sezione + + subsection: + one: Sottosezione + other: Sottosezioni + +article: + back: + other: Indietro + + tableOfContents: + other: Indice + + relatedContents: + other: Contenuti correlati + + lastUpdatedOn: + other: Aggiornato il + + readingTime: + one: "{{ .Count }} min per leggere" + other: "{{ .Count }} min per leggere" + +notFound: + title: + other: Non trovato + subtitle: + other: Questa pagina non esiste. + +widget: + archives: + title: + other: Archivi + + more: + other: Di più + + tagCloud: + title: + other: Tags + +search: + title: + other: Cerca + + placeholder: + other: Scrivi qualcosa... + + resultTitle: + other: "#PAGES_COUNT pagine (#TIME_SECONDS secondi)" + +footer: + builtWith: + other: Realizzato con {{ .Generator }} + + designedBy: + other: Tema {{ .Theme }} realizzato da {{ .DesignedBy }} From 5f1a5ab83f5f706f2472701a7f32fbc1dda42eeb Mon Sep 17 00:00:00 2001 From: zhixuan <59254886+zhixuan666@users.noreply.github.com> Date: Thu, 5 Aug 2021 03:39:01 +0900 Subject: [PATCH 049/119] feat(i18n): add translation for `.readingTime` in Chinese & Japanese (#285) --- i18n/ja.yaml | 3 +++ i18n/zh-CN.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/i18n/ja.yaml b/i18n/ja.yaml index 1331fb1..3f9978d 100644 --- a/i18n/ja.yaml +++ b/i18n/ja.yaml @@ -17,6 +17,9 @@ article: lastUpdatedOn: other: 最終更新 + readingTime: + other: "読了時間: {{ .Count }}分" + notFound: title: other: 404 Not Found diff --git a/i18n/zh-CN.yaml b/i18n/zh-CN.yaml index 551e0a3..0f08310 100644 --- a/i18n/zh-CN.yaml +++ b/i18n/zh-CN.yaml @@ -17,6 +17,9 @@ article: lastUpdatedOn: other: 最后更新于 + readingTime: + other: "阅读时长: {{ .Count }} 分钟" + notFound: title: other: 404 错误 From 7b51bea912eeb0a1abf6feb0d81479dd202814f5 Mon Sep 17 00:00:00 2001 From: zhixuan <59254886+zhixuan666@users.noreply.github.com> Date: Thu, 5 Aug 2021 03:49:21 +0900 Subject: [PATCH 050/119] feat(comment): add `Twikoo` support (#286) * Create twikoo.html * Upgrade to Twikoo 1.4.3 and add `lang` param * Add twikoo section in config.yaml Co-authored-by: Jimmy Cai --- exampleSite/config.yaml | 8 +++- .../partials/comments/provider/twikoo.html | 42 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 layouts/partials/comments/provider/twikoo.html diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index ac30c01..4046887 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -44,7 +44,7 @@ params: article: math: false toc: true - readingTime: true + readingTime: true license: enabled: true default: Licensed under CC BY-NC-SA 4.0 @@ -87,6 +87,12 @@ params: locale: admin: Admin + twikoo: + envId: + region: + path: + lang: + widgets: enabled: - search diff --git a/layouts/partials/comments/provider/twikoo.html b/layouts/partials/comments/provider/twikoo.html new file mode 100644 index 0000000..00016b4 --- /dev/null +++ b/layouts/partials/comments/provider/twikoo.html @@ -0,0 +1,42 @@ + +
    + + +{{- with .Site.Params.comments.twikoo -}} + +{{- end -}} From 2fd3bde9a40790bf98893b0c5062a2f4c0ac9d8f Mon Sep 17 00:00:00 2001 From: zhixuan <59254886+zhixuan666@users.noreply.github.com> Date: Thu, 5 Aug 2021 18:20:03 +0900 Subject: [PATCH 051/119] fix(comment/twikoo): submit button color (#288) --- layouts/partials/comments/provider/twikoo.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layouts/partials/comments/provider/twikoo.html b/layouts/partials/comments/provider/twikoo.html index 00016b4..bf1de6c 100644 --- a/layouts/partials/comments/provider/twikoo.html +++ b/layouts/partials/comments/provider/twikoo.html @@ -18,7 +18,8 @@ .twikoo .el-textarea__inner, .twikoo .tk-preview-container, .twikoo .tk-content, - .twikoo .tk-nick { + .twikoo .tk-nick, + .twikoo .tk-send { color: var(--card-text-color-main); } From 61c021dae2e60668103d4d0ec93e82135810a3df Mon Sep 17 00:00:00 2001 From: zhixuan <59254886+zhixuan666@users.noreply.github.com> Date: Sun, 8 Aug 2021 00:29:01 +0900 Subject: [PATCH 052/119] fix(comments): improve Twikoo style (#289) --- layouts/partials/comments/provider/twikoo.html | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/layouts/partials/comments/provider/twikoo.html b/layouts/partials/comments/provider/twikoo.html index bf1de6c..4dbf976 100644 --- a/layouts/partials/comments/provider/twikoo.html +++ b/layouts/partials/comments/provider/twikoo.html @@ -7,12 +7,15 @@ box-shadow: var(--shadow-l1); padding: var(--card-padding); } + :root[data-scheme="dark"] { + --twikoo-body-text-color-main: rgba(255, 255, 255, 0.9); + --twikoo-body-text-color: rgba(255, 255, 255, 0.7); + } .twikoo .el-input-group__prepend, .twikoo .tk-action-icon, .twikoo .tk-time, - .twikoo .tk-comments-count, - .twikoo .el-button { - color: var(--body-text-color); + .twikoo .tk-comments-count { + color: var(--twikoo-body-text-color); } .twikoo .el-input__inner, .twikoo .el-textarea__inner, @@ -20,7 +23,10 @@ .twikoo .tk-content, .twikoo .tk-nick, .twikoo .tk-send { - color: var(--card-text-color-main); + color: var(--twikoo-body-text-color-main); + } + .twikoo .el-button{ + color: var(--twikoo-body-text-color)!important; } From 5539a42b3015cb822ee86d03c1478c8845abd546 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 8 Aug 2021 16:47:58 +0200 Subject: [PATCH 053/119] fix(article): unordered TOC style (#292) closes https://github.com/CaiJimmy/hugo-theme-stack/issues/283 --- assets/scss/partials/layout/article.scss | 37 ++++++++++++++---------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/assets/scss/partials/layout/article.scss b/assets/scss/partials/layout/article.scss index 4309039..1d22fb9 100644 --- a/assets/scss/partials/layout/article.scss +++ b/assets/scss/partials/layout/article.scss @@ -193,30 +193,34 @@ color: var(--card-text-color-main); #TableOfContents { - ol { - counter-reset: item; - list-style-type: none; - padding: 0; + ol, + ul { margin: 0; + padding: 0; } - & > li { - padding: 0; - margin: 0; + ol { + list-style-type: none; + counter-reset: item; + + li:before { + counter-increment: item; + content: counters(item, ".") ". "; + font-weight: bold; + margin-right: 5px; + } + } + + & > ul { + padding: 0 1em; } li { margin: 15px 20px; padding: 5px; - &::before { - counter-increment: item; - content: counters(item, ".") ". "; - font-weight: bold; - margin-right: 5px; - } - - & > ol { + & > ol, + & > ul { margin-top: 10px; padding-left: 10px; margin-bottom: -5px; @@ -385,7 +389,8 @@ padding-bottom: 56.25%; overflow: hidden; - & > iframe, & > video { + & > iframe, + & > video { position: absolute; width: 100%; height: 100%; From 3b9e248bfdfdea051680665666d140d7324b58d0 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 8 Aug 2021 17:03:48 +0200 Subject: [PATCH 054/119] feat(article): add scrollbar to TOC (#293) closes https://github.com/CaiJimmy/hugo-theme-stack/issues/236 --- assets/scss/partials/layout/article.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/scss/partials/layout/article.scss b/assets/scss/partials/layout/article.scss index 1d22fb9..ef64da9 100644 --- a/assets/scss/partials/layout/article.scss +++ b/assets/scss/partials/layout/article.scss @@ -191,8 +191,12 @@ display: flex; flex-direction: column; color: var(--card-text-color-main); + overflow: hidden; #TableOfContents { + overflow-x: auto; + max-height: 75vh; + ol, ul { margin: 0; From a052245f28125fe7c8890e30dccf301fb5a8efa0 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 8 Aug 2021 17:14:36 +0200 Subject: [PATCH 055/119] refactor!: Drop support for non-extended version of Hugo (#261) closes https://github.com/CaiJimmy/hugo-theme-stack/issues/255 --- ...style.scss_b95b077eb505d5c0aff8055eaced30ad.content | 10 ---------- .../style.scss_b95b077eb505d5c0aff8055eaced30ad.json | 1 - 2 files changed, 11 deletions(-) delete mode 100644 resources/_gen/assets/scss/scss/style.scss_b95b077eb505d5c0aff8055eaced30ad.content delete mode 100644 resources/_gen/assets/scss/scss/style.scss_b95b077eb505d5c0aff8055eaced30ad.json diff --git a/resources/_gen/assets/scss/scss/style.scss_b95b077eb505d5c0aff8055eaced30ad.content b/resources/_gen/assets/scss/scss/style.scss_b95b077eb505d5c0aff8055eaced30ad.content deleted file mode 100644 index 8c2e394..0000000 --- a/resources/_gen/assets/scss/scss/style.scss_b95b077eb505d5c0aff8055eaced30ad.content +++ /dev/null @@ -1,10 +0,0 @@ -/*!* Hugo Theme Stack -* -* @author: Jimmy Cai -* @website: https://jimmycai.com -* @link: https://github.com/CaiJimmy/hugo-theme-stack*/[data-scheme=light]{--pre-text-color:#272822;--pre-background-color:#fafafa}[data-scheme=light] .chroma{color:#272822;background-color:#fafafa}[data-scheme=light] .chroma .err{color:#960050}[data-scheme=light] .chroma .lntd{vertical-align:top;padding:0;margin:0;border:0}[data-scheme=light] .chroma .lntable{border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block}[data-scheme=light] .chroma .hl{display:block;width:100%;background-color:#ffc}[data-scheme=light] .chroma .lnt{margin-right:.4em;padding:0 .4em;color:#7f7f7f}[data-scheme=light] .chroma .ln{margin-right:.4em;padding:0 .4em;color:#7f7f7f}[data-scheme=light] .chroma .k{color:#00a8c8}[data-scheme=light] .chroma .kc{color:#00a8c8}[data-scheme=light] .chroma .kd{color:#00a8c8}[data-scheme=light] .chroma .kn{color:#f92672}[data-scheme=light] .chroma .kp{color:#00a8c8}[data-scheme=light] .chroma .kr{color:#00a8c8}[data-scheme=light] .chroma .kt{color:#00a8c8}[data-scheme=light] .chroma .n{color:#111}[data-scheme=light] .chroma .na{color:#75af00}[data-scheme=light] .chroma .nb{color:#111}[data-scheme=light] .chroma .bp{color:#111}[data-scheme=light] .chroma .nc{color:#75af00}[data-scheme=light] .chroma .no{color:#00a8c8}[data-scheme=light] .chroma .nd{color:#75af00}[data-scheme=light] .chroma .ni{color:#111}[data-scheme=light] .chroma .ne{color:#75af00}[data-scheme=light] .chroma .nf{color:#75af00}[data-scheme=light] .chroma .fm{color:#111}[data-scheme=light] .chroma .nl{color:#111}[data-scheme=light] .chroma .nn{color:#111}[data-scheme=light] .chroma .nx{color:#75af00}[data-scheme=light] .chroma .py{color:#111}[data-scheme=light] .chroma .nt{color:#f92672}[data-scheme=light] .chroma .nv{color:#111}[data-scheme=light] .chroma .vc{color:#111}[data-scheme=light] .chroma .vg{color:#111}[data-scheme=light] .chroma .vi{color:#111}[data-scheme=light] .chroma .vm{color:#111}[data-scheme=light] .chroma .l{color:#ae81ff}[data-scheme=light] .chroma .ld{color:#d88200}[data-scheme=light] .chroma .s{color:#d88200}[data-scheme=light] .chroma .sa{color:#d88200}[data-scheme=light] .chroma .sb{color:#d88200}[data-scheme=light] .chroma .sc{color:#d88200}[data-scheme=light] .chroma .dl{color:#d88200}[data-scheme=light] .chroma .sd{color:#d88200}[data-scheme=light] .chroma .s2{color:#d88200}[data-scheme=light] .chroma .se{color:#8045ff}[data-scheme=light] .chroma .sh{color:#d88200}[data-scheme=light] .chroma .si{color:#d88200}[data-scheme=light] .chroma .sx{color:#d88200}[data-scheme=light] .chroma .sr{color:#d88200}[data-scheme=light] .chroma .s1{color:#d88200}[data-scheme=light] .chroma .ss{color:#d88200}[data-scheme=light] .chroma .m{color:#ae81ff}[data-scheme=light] .chroma .mb{color:#ae81ff}[data-scheme=light] .chroma .mf{color:#ae81ff}[data-scheme=light] .chroma .mh{color:#ae81ff}[data-scheme=light] .chroma .mi{color:#ae81ff}[data-scheme=light] .chroma .il{color:#ae81ff}[data-scheme=light] .chroma .mo{color:#ae81ff}[data-scheme=light] .chroma .o{color:#f92672}[data-scheme=light] .chroma .ow{color:#f92672}[data-scheme=light] .chroma .p{color:#111}[data-scheme=light] .chroma .c{color:#75715e}[data-scheme=light] .chroma .ch{color:#75715e}[data-scheme=light] .chroma .cm{color:#75715e}[data-scheme=light] .chroma .c1{color:#75715e}[data-scheme=light] .chroma .cs{color:#75715e}[data-scheme=light] .chroma .cp{color:#75715e}[data-scheme=light] .chroma .cpf{color:#75715e}[data-scheme=light] .chroma .ge{font-style:italic}[data-scheme=light] .chroma .gs{font-weight:700}[data-scheme=dark]{--pre-text-color:#f8f8f2;--pre-background-color:#272822}[data-scheme=dark] .chroma{color:#f8f8f2;background-color:#272822}[data-scheme=dark] .chroma .err{color:#bb0064}[data-scheme=dark] .chroma .lntd{vertical-align:top;padding:0;margin:0;border:0}[data-scheme=dark] .chroma .lntable{border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block}[data-scheme=dark] .chroma .hl{display:block;width:100%;background-color:#ffc}[data-scheme=dark] .chroma .lnt{margin-right:.4em;padding:0 .4em;color:#7f7f7f}[data-scheme=dark] .chroma .ln{margin-right:.4em;padding:0 .4em;color:#7f7f7f}[data-scheme=dark] .chroma .k{color:#66d9ef}[data-scheme=dark] .chroma .kc{color:#66d9ef}[data-scheme=dark] .chroma .kd{color:#66d9ef}[data-scheme=dark] .chroma .kn{color:#f92672}[data-scheme=dark] .chroma .kp{color:#66d9ef}[data-scheme=dark] .chroma .kr{color:#66d9ef}[data-scheme=dark] .chroma .kt{color:#66d9ef}[data-scheme=dark] .chroma .na{color:#a6e22e}[data-scheme=dark] .chroma .nc{color:#a6e22e}[data-scheme=dark] .chroma .no{color:#66d9ef}[data-scheme=dark] .chroma .nd{color:#a6e22e}[data-scheme=dark] .chroma .ne{color:#a6e22e}[data-scheme=dark] .chroma .nf{color:#a6e22e}[data-scheme=dark] .chroma .nx{color:#a6e22e}[data-scheme=dark] .chroma .nt{color:#f92672}[data-scheme=dark] .chroma .l{color:#ae81ff}[data-scheme=dark] .chroma .ld{color:#e6db74}[data-scheme=dark] .chroma .s{color:#e6db74}[data-scheme=dark] .chroma .sa{color:#e6db74}[data-scheme=dark] .chroma .sb{color:#e6db74}[data-scheme=dark] .chroma .sc{color:#e6db74}[data-scheme=dark] .chroma .dl{color:#e6db74}[data-scheme=dark] .chroma .sd{color:#e6db74}[data-scheme=dark] .chroma .s2{color:#e6db74}[data-scheme=dark] .chroma .se{color:#ae81ff}[data-scheme=dark] .chroma .sh{color:#e6db74}[data-scheme=dark] .chroma .si{color:#e6db74}[data-scheme=dark] .chroma .sx{color:#e6db74}[data-scheme=dark] .chroma .sr{color:#e6db74}[data-scheme=dark] .chroma .s1{color:#e6db74}[data-scheme=dark] .chroma .ss{color:#e6db74}[data-scheme=dark] .chroma .m{color:#ae81ff}[data-scheme=dark] .chroma .mb{color:#ae81ff}[data-scheme=dark] .chroma .mf{color:#ae81ff}[data-scheme=dark] .chroma .mh{color:#ae81ff}[data-scheme=dark] .chroma .mi{color:#ae81ff}[data-scheme=dark] .chroma .il{color:#ae81ff}[data-scheme=dark] .chroma .mo{color:#ae81ff}[data-scheme=dark] .chroma .o{color:#f92672}[data-scheme=dark] .chroma .ow{color:#f92672}[data-scheme=dark] .chroma .c{color:#75715e}[data-scheme=dark] .chroma .ch{color:#75715e}[data-scheme=dark] .chroma .cm{color:#75715e}[data-scheme=dark] .chroma .c1{color:#75715e}[data-scheme=dark] .chroma .cs{color:#75715e}[data-scheme=dark] .chroma .cp{color:#75715e}[data-scheme=dark] .chroma .cpf{color:#75715e}[data-scheme=dark] .chroma .gd{color:#f92672}[data-scheme=dark] .chroma .ge{font-style:italic}[data-scheme=dark] .chroma .gi{color:#a6e22e}[data-scheme=dark] .chroma .gs{font-weight:700}[data-scheme=dark] .chroma .gu{color:#75715e}:root{--body-background:#f5f5fa;--accent-color:#34495e;--accent-color-darker:#2c3e50;--accent-color-text:#fff;--body-text-color:#bababa;--tag-border-radius:4px;--section-separation:40px;--scrollbar-thumb:hsl(0, 0%, 85%);--scrollbar-track:var(--body-background)}@media(min-width:768px){:root{--main-top-padding:35px}}@media(min-width:1280px){:root{--main-top-padding:50px}}:root[data-scheme=dark]{--body-background:#303030;--accent-color:#ecf0f1;--accent-color-darker:#bdc3c7;--accent-color-text:#000;--body-text-color:rgba(255, 255, 255, 0.7);--scrollbar-thumb:#424242;--scrollbar-track:var(--body-background)}:root{--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), sans-serif;--code-font-family:Menlo, Monaco, Consolas, "Courier New", monospace}:root{--card-background:#fff;--card-background-selected:#eaeaea;--card-text-color-main:#000;--card-text-color-secondary:#747474;--card-text-color-tertiary:#bababa;--card-separator-color:rgba(218, 218, 218, 0.5);--card-border-radius:10px;--card-padding:20px;--small-card-padding:25px 20px}@media(min-width:768px){:root{--card-padding:25px}}@media(min-width:1280px){:root{--card-padding:30px}}@media(min-width:768px){:root{--small-card-padding:25px}}:root[data-scheme=dark]{--card-background:#424242;--card-background-selected:rgba(255, 255, 255, 0.16);--card-text-color-main:rgba(255, 255, 255, 0.9);--card-text-color-secondary:rgba(255, 255, 255, 0.7);--card-text-color-tertiary:rgba(255, 255, 255, 0.5);--card-separator-color:rgba(255, 255, 255, 0.12)}:root{--article-font-family:var(--base-font-family);--article-font-size:1.6rem;--article-line-height:1.85}@media(min-width:768px){:root{--article-font-size:1.7rem}}:root{--blockquote-border-size:4px;--blockquote-background-color:rgb(248 248 248);--heading-border-size:4px;--link-background-color:189, 195, 199;--link-background-opacity:0.5;--link-background-opacity-hover:0.7;--pre-background-color:#272822;--pre-text-color:#f8f8f2;--code-background-color:rgba(0, 0, 0, 0.12);--code-text-color:#808080;--table-border-color:#dadada;--tr-even-background-color:#efefee}:root[data-scheme=dark]{--code-background-color:#272822;--code-text-color:rgba(255, 255, 255, 0.9);--table-border-color:#717171;--tr-even-background-color:#545454;--blockquote-background-color:rgb(75 75 75)}:root{--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);--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);--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);--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), - 0px 0px 1px rgba(0, 0, 0, 0.04)}.container{margin-left:auto;margin-right:auto}.container .left-sidebar{max-width:var(--left-sidebar-max-width)}.container .right-sidebar{max-width:var(--right-sidebar-max-width)}@media(min-width:1024px){.container .right-sidebar{display:block}}@media(min-width:768px){.container.extended{max-width:1024px;--left-sidebar-max-width:25%;--right-sidebar-max-width:30%}}@media(min-width:1024px){.container.extended{max-width:1280px;--left-sidebar-max-width:20%;--right-sidebar-max-width:30%}}@media(min-width:1280px){.container.extended{max-width:1536px;--left-sidebar-max-width:15%;--right-sidebar-max-width:25%}}@media(min-width:768px){.container.compact{--left-sidebar-max-width:25%;max-width:768px}}@media(min-width:1024px){.container.compact{max-width:1024px;--left-sidebar-max-width:20%}}@media(min-width:1280px){.container.compact{max-width:1280px}}.flex{display:flex;flex-direction:row}.flex.column{flex-direction:column}.flex.on-phone--column{flex-direction:column}@media(min-width:768px){.flex.on-phone--column{flex-direction:unset}}.flex.align-items--flex-start{align-items:flex-start}.flex .grow{flex-grow:1}.flex .do-not-shrink{flex-shrink:0}.flex .do-not-overflow{min-width:0;flex-shrink:1;max-width:100%}.flex .full-width{width:100%}main.main{min-width:0;max-width:100%;flex-grow:1;padding-top:var(--main-top-padding)}.main-container{min-height:100vh;align-items:flex-start;padding:0 15px;column-gap:var(--section-separation)}@media(min-width:768px){.main-container{padding:0 20px}}/*!normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css*/html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}/*!* Hamburgers -* @description Tasty CSS-animated hamburgers -* @author Jonathan Suh @jonsuh -* @site https://jonsuh.com/hamburgers -* @link https://github.com/jonsuh/hamburgers*/.hamburger{padding-top:10px;display:inline-block;cursor:pointer;transition-property:opacity,filter;transition-duration:.15s;transition-timing-function:linear;font:inherit;color:inherit;text-transform:none;background-color:transparent;border:0;margin:0;overflow:visible}.hamburger:hover{opacity:.7}.hamburger.is-active:hover{opacity:.7}.hamburger.is-active .hamburger-inner,.hamburger.is-active .hamburger-inner::before,.hamburger.is-active .hamburger-inner::after{background-color:#000}.hamburger-box{width:30px;height:24px;display:inline-block;position:relative}.hamburger-inner{display:block;top:50%;margin-top:-2px}.hamburger-inner,.hamburger-inner::before,.hamburger-inner::after{width:30px;height:2px;background-color:var(--card-text-color-main);border-radius:4px;position:absolute;transition-property:transform;transition-duration:.15s;transition-timing-function:ease}.hamburger-inner::before,.hamburger-inner::after{content:"";display:block}.hamburger-inner::before{top:-10px}.hamburger-inner::after{bottom:-10px}.hamburger--spin .hamburger-inner{transition-duration:.22s;transition-timing-function:cubic-bezier(.55,.055,.675,.19)}.hamburger--spin .hamburger-inner::before{transition:top .1s .25s ease-in,opacity .1s ease-in}.hamburger--spin .hamburger-inner::after{transition:bottom .1s .25s ease-in,transform .22s cubic-bezier(.55,.055,.675,.19)}.hamburger--spin.is-active .hamburger-inner{transform:rotate(225deg);transition-delay:.12s;transition-timing-function:cubic-bezier(.215,.61,.355,1)}.hamburger--spin.is-active .hamburger-inner::before{top:0;opacity:0;transition:top .1s ease-out,opacity .1s .12s ease-out}.hamburger--spin.is-active .hamburger-inner::after{bottom:0;transform:rotate(-90deg);transition:bottom .1s ease-out,transform .22s .12s cubic-bezier(.215,.61,.355,1)}#toggle-menu{background:0 0;border:none;position:absolute;right:30px;top:30px;z-index:2;cursor:pointer;outline:none}@media(min-width:768px){#toggle-menu{display:none}}#toggle-menu.is-active .hamburger-inner,#toggle-menu.is-active .hamburger-inner::before,#toggle-menu.is-active .hamburger-inner::after{background-color:var(--accent-color)}.menu{padding-left:0;list-style:none;display:flex;flex-direction:column;margin-bottom:0;overflow-y:auto;flex-grow:1;font-size:1.4rem;background-color:var(--card-background);margin-top:0;padding:15px 0;box-shadow:var(--shadow-l1);display:none}.menu.show{display:block}@media(min-width:768px){.menu{align-items:flex-end;display:flex;background-color:transparent;padding:0;box-shadow:none;margin-top:var(--sidebar-element-separation)}}@media(min-width:1280px){.menu{margin-top:30px}}.menu li{position:relative;vertical-align:middle;padding:10px 30px}.menu li:not(:last-of-type){margin-bottom:15px}@media(min-width:1280px){.menu li:not(:last-of-type){margin-bottom:20px}}@media(min-width:768px){.menu li{width:100%;padding:10px 0}}.menu li svg{stroke-width:1.33;margin-right:40px;width:20px;height:20px}.menu li a{height:100%;display:inline-flex;align-items:center;color:var(--body-text-color)}.menu li span{flex:1}.menu li.current a{color:var(--accent-color);font-weight:700}.article-list{display:flex;flex-direction:column}.article-list article{display:flex;flex-direction:column;background-color:var(--card-background);box-shadow:var(--shadow-l1);border-radius:var(--card-border-radius);overflow:hidden;transition:box-shadow .3s ease}.article-list article:hover{box-shadow:var(--shadow-l2)}.article-list article:not(:last-of-type){margin-bottom:var(--section-separation)}.article-list article .article-image img{width:100%;height:150px;object-fit:cover}@media(min-width:768px){.article-list article .article-image img{height:200px}}@media(min-width:1280px){.article-list article .article-image img{height:250px}}.article-list article:nth-child(5n+1) .article-category a{background:#8ea885;color:#fff}.article-list article:nth-child(5n+2) .article-category a{background:#df7988;color:#fff}.article-list article:nth-child(5n+3) .article-category a{background:#0177b8;color:#fff}.article-list article:nth-child(5n+4) .article-category a{background:#ffb900;color:#fff}.article-list article:nth-child(5n+5) .article-category a{background:#6b69d6;color:#fff}.article-details{display:flex;flex-direction:column;justify-content:center;padding:var(--card-padding)}.article-title{font-weight:600;margin:10px 0;color:var(--card-text-color-main);font-size:2.2rem}@media(min-width:1280px){.article-title{font-size:2.4rem}}.article-title a{color:var(--card-text-color-main)}.article-title a:hover{color:var(--card-text-color-main)}.article-title+.article-subtitle{margin-top:0}.article-subtitle{font-weight:400;color:var(--card-text-color-secondary);margin:5px 0;line-height:1.5;font-size:1.75rem}@media(min-width:1280px){.article-subtitle{font-size:2rem}}.article-time{display:flex;align-items:center;color:var(--card-text-color-tertiary);margin-top:10px}.article-time svg{vertical-align:middle;margin-right:15px;width:20px;height:20px;stroke-width:1.33}.article-time time{font-size:1.4rem}.article-category a,.article-tags a{color:var(--accent-color-text);background-color:var(--accent-color);padding:8px 16px;border-radius:var(--tag-border-radius);display:inline-block;font-size:1.4rem;margin-right:10px;margin-bottom:10px;transition:background-color .5s ease}.article-category a:hover,.article-tags a:hover{color:var(--accent-color-text);background-color:var(--accent-color-darker)}.article-list--compact{border-radius:var(--card-border-radius);box-shadow:var(--shadow-l1);background-color:var(--card-background);--image-size:50px}@media(min-width:768px){.article-list--compact{--image-size:60px}}.article-list--compact+.pagination{margin-top:var(--section-separation)}.article-list--compact article>a{display:flex;align-items:center;padding:var(--small-card-padding)}.article-list--compact article:not(:last-of-type){border-bottom:1.5px solid var(--card-separator-color)}.article-list--compact article .article-details{flex-grow:1;padding:0;padding-right:15px;min-height:var(--image-size)}.article-list--compact article .article-title{margin:0;font-size:1.6rem}@media(min-width:768px){.article-list--compact article .article-title{font-size:1.8rem}}.article-list--compact article .article-image img{width:var(--image-size);height:var(--image-size);object-fit:cover}.article-list--compact article .article-time{font-size:1.4rem}.article-list--compact article .article-preview{font-size:1.4rem;color:var(--card-text-color-tertiary);margin-top:10px;line-height:1.5}.article-list--tile article{border-radius:var(--card-border-radius);overflow:hidden;position:relative;height:350px;width:250px;box-shadow:var(--shadow-l1);transition:box-shadow .3s ease;background-color:var(--card-background)}.article-list--tile article:hover{box-shadow:var(--shadow-l2)}.article-list--tile article.has-image .article-details{background-color:rgba(0,0,0,.25)}.article-list--tile article.has-image .article-title{color:#fff}.article-list--tile article .article-image{position:absolute;top:0;left:0;width:100%;height:100%}.article-list--tile article .article-image img{width:100%;height:100%;object-fit:cover}.article-list--tile article .article-details{border-radius:var(--card-border-radius);position:relative;height:100%;width:100%;display:flex;flex-direction:column;justify-content:flex-end;z-index:2;padding:15px}@media(min-width:640px){.article-list--tile article .article-details{padding:20px}}.article-list--tile article .article-title{font-size:2rem;font-weight:500;color:var(--card-text-color-main)}@media(min-width:640px){.article-list--tile article .article-title{font-size:2.2rem}}.widget .widget-icon svg{width:32px;height:32px;stroke-width:1.6;color:var(--body-text-color)}.tagCloud .tagCloud-tags{display:flex;flex-wrap:wrap}.tagCloud .tagCloud-tags a{background:var(--card-background);box-shadow:var(--shadow-l1);border-radius:var(--tag-border-radius);padding:8px 20px;color:var(--card-text-color-main);margin-bottom:10px;margin-right:5px;font-size:1.4rem;transition:box-shadow .3s ease}.tagCloud .tagCloud-tags a:hover{box-shadow:var(--shadow-l2)}.widget.archives .widget-archive--list{border-radius:var(--card-border-radius);box-shadow:var(--shadow-l1);background-color:var(--card-background)}.widget.archives .archives-year:not(:last-of-type){border-bottom:1.5px solid var(--card-separator-color)}.widget.archives .archives-year a{font-size:1.4rem;padding:18px 25px;display:flex}.widget.archives .archives-year a span.year{flex:1;color:var(--card-text-color-main);font-weight:700}.widget.archives .archives-year a span.count{color:var(--card-text-color-tertiary)}footer.site-footer{padding:20px 0 var(--section-separation);font-size:1.4rem;line-height:1.75;margin-top:var(--section-separation)}footer.site-footer:before{content:"";display:block;height:3px;width:50px;background:var(--body-text-color);margin-bottom:20px}footer.site-footer .copyright{color:var(--accent-color);font-weight:700;margin-bottom:5px}footer.site-footer .powerby{color:var(--body-text-color);font-weight:400;font-size:1.2rem}footer.site-footer .powerby a{color:var(--body-text-color)}.pagination{display:flex;background-color:var(--card-background);box-shadow:var(--shadow-l1);border-radius:var(--card-border-radius);overflow:hidden;flex-wrap:wrap;margin:var(--section-separation)0}.pagination .page-link{padding:16px 32px;display:inline-flex;color:var(--card-text-color-secondary)}.pagination .page-link.current{font-weight:700;background-color:var(--card-background-selected);color:var(--card-text-color-main)}@media(min-width:768px){.sidebar.sticky{position:sticky}}.left-sidebar{display:flex;flex-direction:column;flex-shrink:0;align-self:stretch;width:100%;padding:30px 0 15px;max-width:none;--sidebar-avatar-size:120px;--sidebar-element-separation:20px}@media(min-width:768px){.left-sidebar{width:auto;padding-top:var(--main-top-padding);padding-bottom:var(--main-top-padding);max-height:100vh}}@media(min-width:1536px){.left-sidebar{--sidebar-avatar-size:140px;--sidebar-element-separation:25px}}.left-sidebar.sticky{top:0}.right-sidebar{flex-shrink:0;display:none}.right-sidebar.sticky{top:0}@media(min-width:1024px){.right-sidebar{padding-top:var(--main-top-padding)}}.site-info{z-index:1;transition:box-shadow .5s ease;padding:15px}@media(min-width:768px){.site-info{padding:0}}.site-info .site-avatar{position:relative;margin:0;width:var(--sidebar-avatar-size);height:var(--sidebar-avatar-size);margin-bottom:var(--sidebar-element-separation)}.site-info .site-avatar .site-logo{width:100%;height:100%;border-radius:100%;box-shadow:var(--shadow-l1)}.site-info .site-avatar .emoji{position:absolute;width:40px;height:40px;line-height:40px;border-radius:100%;bottom:0;right:0;text-align:center;font-size:20px;background-color:var(--card-background);box-shadow:var(--shadow-l2)}@media(min-width:1536px){.site-info .site-avatar .emoji{width:50px;height:50px;line-height:50px}}.site-info .site-name{color:var(--accent-color);margin:0;font-size:1.8rem}@media(min-width:1536px){.site-info .site-name{font-size:2rem}}.site-info .site-description{color:var(--body-text-color);font-weight:400;margin:10px 0;font-size:1.6rem}@media(min-width:1536px){.site-info .site-description{font-size:1.8rem}}.sidebar .widget{margin-bottom:var(--section-separation)}.sidebar .widget:not(:last-of-type):after{content:"";width:100px;height:2px;background-color:var(--body-text-color);display:block;margin-top:var(--section-separation)}[data-scheme=dark] #dark-mode-toggle{color:var(--accent-color);font-weight:700}[data-scheme=dark] #dark-mode-toggle .icon-tabler-toggle-left{display:none}[data-scheme=dark] #dark-mode-toggle .icon-tabler-toggle-right{display:unset}#dark-mode-toggle{margin-top:auto;color:var(--body-text-color);display:flex;align-items:center;cursor:pointer}#dark-mode-toggle .icon-tabler-toggle-right{display:none}html{font-size:62.5%;overflow-y:scroll;scroll-behavior:smooth}*{box-sizing:border-box}body{background:var(--body-background);margin:0;font-family:var(--base-font-family);font-size:1.6rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*{scrollbar-width:auto;scrollbar-color:var(--scrollbar-thumb)transparent}::-webkit-scrollbar{height:auto}::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb)}::-webkit-scrollbar-track{background-color:transparent}.archives-group{margin-bottom:var(--section-separation)}.article-page.hide-sidebar-sm .left-sidebar{display:none}@media(min-width:768px){.article-page.hide-sidebar-sm .left-sidebar{display:inherit}}.article-page .main-article{background:var(--card-background);border-radius:var(--card-border-radius);box-shadow:var(--shadow-l1);overflow:hidden}.article-page .main-article.main-article{margin-bottom:var(--section-separation)}.article-page .main-article .article-header .article-image img{height:auto;width:100%;max-height:50vh;object-fit:cover}.article-page .main-article .article-header .article-details{padding:var(--card-padding);padding-bottom:0}.article-page .main-article .article-content{margin:var(--card-padding)0;color:var(--card-text-color-main)}.article-page .main-article .article-content img{max-width:100%;height:auto}.article-page .main-article .article-footer{margin:var(--card-padding);margin-top:0}.article-page .main-article .article-footer section:not(:first-child){margin-top:var(--card-padding)}.article-page .main-article .article-footer section{color:var(--card-text-color-tertiary);text-transform:uppercase;display:flex;align-items:center;font-size:1.4rem}.article-page .main-article .article-footer section svg{width:20px;height:20px;margin-right:15px;stroke-width:1.33}.article-page .main-article .article-footer .article-tags{flex-wrap:wrap;text-transform:unset}#article-toolbar{display:flex;align-items:center;margin:20px 0}@media(min-width:768px){#article-toolbar{display:none}}#article-toolbar .back-home{background:var(--card-background);border-radius:var(--tag-border-radius);color:var(--card-text-color-tertiary);margin-right:30px;display:inline-flex;align-items:center;font-size:1.4rem;text-transform:uppercase;padding:10px 20px 10px 15px;transition:box-shadow .3s ease;box-shadow:var(--shadow-l1)}#article-toolbar .back-home:hover{box-shadow:var(--shadow-l2)}#article-toolbar .back-home svg{margin-right:5px;width:20px;height:20px}#article-toolbar .back-home span{font-weight:500;white-space:nowrap}.article-page.has-toc{scroll-behavior:smooth}.article-page.has-toc .left-sidebar{display:none}.article-page.has-toc .right-sidebar{width:100%;padding:0;display:none}@media(min-width:1280px){.article-page.has-toc .right-sidebar{display:block;top:var(--main-top-padding)}}.article-page.has-toc #article-toolbar{display:block}@media(min-width:768px){.article-page.has-toc #article-toolbar{padding:0}}@media(min-width:1280px){.article-page.has-toc #article-toolbar{margin-top:0;position:sticky;top:var(--main-top-padding);flex-shrink:1}.article-page.has-toc #article-toolbar a{background:0 0;box-shadow:none;border:1px solid var(--body-text-color);width:100%;margin-right:0}.article-page.has-toc #article-toolbar a svg{flex-shrink:0}}.article-page.has-toc .main-container{align-items:start;flex-direction:column}@media(min-width:1280px){.article-page.has-toc .main-container{flex-direction:row}}.article-page.has-toc .main{padding-top:0}@media(min-width:1280px){.article-page.has-toc .main{padding-top:var(--main-top-padding)}}.widget--toc{background-color:var(--card-background);border-radius:var(--card-border-radius);box-shadow:var(--shadow-l1);display:flex;flex-direction:column;color:var(--card-text-color-main)}.widget--toc #TableOfContents ol{counter-reset:item;list-style-type:none;padding:0;margin:0}.widget--toc #TableOfContents>li{padding:0;margin:0}.widget--toc #TableOfContents li{margin:15px 20px;padding:5px}.widget--toc #TableOfContents li::before{counter-increment:item;content:counters(item,".")". ";font-weight:700;margin-right:5px}.widget--toc #TableOfContents li>ol{margin-top:10px;padding-left:10px;margin-bottom:-5px}.widget--toc #TableOfContents li>ol>li:last-child{margin-bottom:0}.related-contents--wrapper{margin-bottom:var(--section-separation)}.related-contents{overflow-x:auto;padding-bottom:15px}.related-contents>.flex{float:left}.related-contents article{margin-right:15px;flex-shrink:0;overflow:hidden;width:250px;height:150px}.related-contents article .article-title{font-size:1.8rem;margin:0}.related-contents article.has-image .article-details{padding:20px;background:linear-gradient(0deg,rgba(0,0,0,.25) 0%,rgba(0,0,0,.75) 100%)}.article-content{font-family:var(--article-font-family);font-size:var(--article-font-size);padding:0 var(--card-padding);line-height:var(--article-line-height)}.article-content>p{margin:1.5em 0}.article-content h1,.article-content h2,.article-content h3,.article-content h4,.article-content h5,.article-content h6{margin-left:calc((var(--card-padding)) * -1);padding-left:calc(var(--card-padding) - var(--heading-border-size));border-left:var(--heading-border-size)solid var(--accent-color)}.article-content figure{text-align:center}.article-content figure figcaption{font-size:1.4rem;color:var(--card-text-color-secondary)}.article-content blockquote{position:relative;margin:1.5em 0;border-left:var(--blockquote-border-size)solid var(--card-separator-color);padding:15px calc(var(--card-padding) - var(--blockquote-border-size));background-color:var(--blockquote-background-color)}.article-content hr{width:100px;margin:40px auto;background:var(--card-text-color-tertiary);height:2px;border:0;opacity:.55}.article-content code{color:var(--code-text-color);background-color:var(--code-background-color);padding:2px 4px;border-radius:var(--tag-border-radius);font-family:var(--code-font-family)}.article-content .gallery{position:relative;display:flex;flex-direction:row;justify-content:center;margin:1.5em 0}.article-content .gallery figure{margin:0}.article-content .gallery figure+figure{margin-left:10px}.article-content pre{overflow-x:auto;display:block;background-color:var(--pre-background-color);color:var(--pre-text-color);font-family:var(--code-font-family);line-height:1.428571429;word-break:break-all;padding:var(--card-padding)}.article-content pre code{color:unset;border:none;background:0 0;padding:0}.article-content table{width:100%;border-collapse:collapse;border-spacing:0;margin-bottom:1.5em;font-size:.96em}.article-content th,.article-content td{text-align:left;padding:4px 8px 4px 10px;border:1px solid var(--table-border-color)}.article-content td{vertical-align:top}.article-content tr:nth-child(even){background-color:var(--tr-even-background-color)}.article-content .twitter-tweet{color:var(--card-text-color-main)}.article-content .video-wrapper{position:relative;width:100%;height:0;padding-bottom:56.25%;overflow:hidden}.article-content .video-wrapper>iframe{position:absolute;width:100%;height:100%;left:0;top:0;border:0}.article-content blockquote,.article-content figure,.article-content .gallery,.article-content pre,.article-content .video-wrapper,.article-content .s_video_simple{margin-left:calc((var(--card-padding)) * -1);margin-right:calc((var(--card-padding)) * -1);width:calc(100% + var(--card-padding) * 2)}.section-card{border-radius:var(--card-border-radius);background-color:var(--card-background);padding:var(--small-card-padding);box-shadow:var(--shadow-l1);margin-bottom:var(--section-separation);display:flex;align-items:center;--separation:15px}.section-card .section-term{font-size:2.2rem;margin:0;margin-top:calc(var(--separation)/2);color:var(--card-text-color-main)}.section-card .section-term+.section-description{margin-top:var(--separation)}.section-card .section-description{font-weight:400;color:var(--card-text-color-secondary);font-size:1.6rem;margin:0}.section-card .section-details{flex-grow:1;margin-right:20px}.section-card .section-image img{width:60px;height:60px}.section-card .section-count{color:var(--card-text-color-tertiary);font-size:1.4rem;margin:0;font-weight:700;text-transform:uppercase}.subsection-list{margin-bottom:var(--section-separation);overflow-x:auto}.subsection-list .article-list--tile{display:flex;padding-bottom:15px}.subsection-list .article-list--tile article{width:250px;height:150px;margin-right:20px;flex-shrink:0}.subsection-list .article-list--tile article .article-title{margin:0;font-size:1.8rem}.subsection-list .article-list--tile article .article-details{padding:20px}.not-found-card{background-color:var(--card-background);box-shadow:var(--shadow-l1);border-radius:var(--card-border-radius);padding:var(--card-padding)}.search-form{margin-bottom:var(--section-separation);position:relative;--button-size:80px}.search-form.widget{--button-size:60px}.search-form.widget label{font-size:1.3rem;top:10px}.search-form.widget input{font-size:1.5rem;padding:30px 20px 15px}.search-form p{position:relative;margin:0}.search-form label{position:absolute;top:15px;left:20px;font-size:1.4rem;color:var(--card-text-color-tertiary)}.search-form input{padding:40px 20px 20px;border-radius:var(--card-border-radius);background-color:var(--card-background);box-shadow:var(--shadow-l1);color:var(--card-text-color-main);width:100%;border:0;-webkit-appearance:none;transition:box-shadow .3s ease;font-size:1.8rem}.search-form input:focus{outline:0;box-shadow:var(--shadow-l2)}.search-form button{position:absolute;right:0;top:0;height:100%;width:var(--button-size);cursor:pointer;background-color:transparent;border:0;padding:0 10px}.search-form button:focus{outline:0}.search-form button:focus svg{stroke-width:2;color:var(--accent-color)}.search-form button svg{color:var(--card-text-color-secondary);stroke-width:1.33;transition:all .3s ease;width:20px;height:20px}a{text-decoration:none;color:var(--accent-color)}a:hover{color:var(--accent-color-darker)}a.link{box-shadow:0 -2px rgba(var(--link-background-color),var(--link-background-opacity))inset;transition:all .3s ease}a.link:hover{box-shadow:0 -10px rgba(var(--link-background-color),var(--link-background-opacity-hover))inset}.section-title{text-transform:uppercase;margin-top:0;margin-bottom:10px;display:block;font-size:1.6rem;font-weight:700;color:var(--body-text-color)}.section-title a{color:var(--body-text-color)} \ No newline at end of file diff --git a/resources/_gen/assets/scss/scss/style.scss_b95b077eb505d5c0aff8055eaced30ad.json b/resources/_gen/assets/scss/scss/style.scss_b95b077eb505d5c0aff8055eaced30ad.json deleted file mode 100644 index 57e7918..0000000 --- a/resources/_gen/assets/scss/scss/style.scss_b95b077eb505d5c0aff8055eaced30ad.json +++ /dev/null @@ -1 +0,0 @@ -{"Target":"scss/style.min.css","MediaType":"text/css","Data":{}} \ No newline at end of file From 4a0cbac23457070a46a798c6ae4e0c9d3122e7f3 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 8 Aug 2021 17:39:33 +0200 Subject: [PATCH 056/119] feat(menu): support open an entry in new tab (#294) * feat(menu): support open an entry in new tab closes https://github.com/CaiJimmy/hugo-theme-stack/issues/230 * Revert change in markup.tableOfContents.ordered * Upgrade Netlify Hugo version * doc: require Hugo Extended >= 0.87.0 --- README.md | 2 +- exampleSite/config.yaml | 3 +++ layouts/partials/sidebar/left.html | 2 +- netlify.toml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c1157a2..ddacf82 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Stack is a simple card-style Hugo theme designed for bloggers, some of its featu ## Requirements -It's necessary to use **Hugo Extended ≥ 0.78.0**. +It's necessary to use **Hugo Extended ≥ 0.87.0**. ## Installation diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 4046887..ac67c62 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -142,6 +142,9 @@ menu: url: / weight: -100 pre: home + params: + ### For demonstration purpose, the home link will be open in a new tab + newTab: true related: includeNewer: true diff --git a/layouts/partials/sidebar/left.html b/layouts/partials/sidebar/left.html index af483e3..c14092f 100644 --- a/layouts/partials/sidebar/left.html +++ b/layouts/partials/sidebar/left.html @@ -39,7 +39,7 @@ {{ $active := or (eq $currentPage.Title .Name) (or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .)) }}
  • - + {{ if .Pre }} {{ partial "helper/icon" .Pre }} {{ end }} diff --git a/netlify.toml b/netlify.toml index e221fd8..2a5b2a8 100644 --- a/netlify.toml +++ b/netlify.toml @@ -2,7 +2,7 @@ publish = "exampleSite/public" [build.environment] - HUGO_VERSION = "0.85.0" + HUGO_VERSION = "0.87.0" HUGO_THEME = "repo" [context.production] From 24915a912f23e8c0a21aa156714ea7f071469fdb Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 8 Aug 2021 18:15:27 +0200 Subject: [PATCH 057/119] feat(article): copy button for highlight block (#295) This button only shows on highlighted code blocks, because it uses the wrapper div.highlight --- assets/scss/partials/layout/article.scss | 26 +++++++++++++++++++ assets/ts/main.ts | 32 ++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/assets/scss/partials/layout/article.scss b/assets/scss/partials/layout/article.scss index ef64da9..4fd3118 100644 --- a/assets/scss/partials/layout/article.scss +++ b/assets/scss/partials/layout/article.scss @@ -415,4 +415,30 @@ margin-right: calc((var(--card-padding)) * -1); width: calc(100% + var(--card-padding) * 2); } + + .highlight { + position: relative; + + &:hover { + .copyCodeButton { + opacity: 1; + } + } + } + + .copyCodeButton { + position: absolute; + top: calc(var(--card-padding)); + right: 0; + background: var(--card-background); + border: none; + box-shadow: var(--shadow-l2); + border-radius: var(--tag-border-radius); + padding: 8px 16px; + color: var(--card-text-color-main); + cursor: pointer; + font-size: 14px; + opacity: 0; + transition: opacity 0.3s ease; + } } diff --git a/assets/ts/main.ts b/assets/ts/main.ts index 2fcc152..d79c127 100644 --- a/assets/ts/main.ts +++ b/assets/ts/main.ts @@ -54,6 +54,38 @@ let Stack = { observer.observe(articleTile) } + + /** + * Add copy button to code block + */ + const codeBlocks = document.querySelectorAll('.article-content .highlight'); + const copyText = `Copy`, + copiedText = `Copied!`; + codeBlocks.forEach(codeBlock => { + const copyButton = document.createElement('button'); + copyButton.innerHTML = copyText; + copyButton.classList.add('copyCodeButton'); + codeBlock.appendChild(copyButton); + + const pre = codeBlock.getElementsByTagName('pre'); + const code = pre[0].textContent; + + copyButton.addEventListener('click', () => { + navigator.clipboard.writeText(code) + .then(() => { + copyButton.textContent = copiedText; + + setTimeout(() => { + copyButton.textContent = copyText; + }, 1000); + }) + .catch(err => { + alert(err) + console.log('Something went wrong', err); + }); + }); + }); + new StackColorScheme(document.getElementById('dark-mode-toggle')); } } From 1055adf4982358c7cbbdda5e68a0b9c4356384d0 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 8 Aug 2021 16:24:02 +0000 Subject: [PATCH 058/119] release: 3.0.0 --- layouts/partials/footer/footer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/footer/footer.html b/layouts/partials/footer/footer.html index ecc22c5..6284349 100644 --- a/layouts/partials/footer/footer.html +++ b/layouts/partials/footer/footer.html @@ -1,4 +1,4 @@ -{{- $ThemeVersion := "2.5.0" -}} +{{- $ThemeVersion := "3.0.0" -}}
    From 9f734a064703eab8c31f2b1bbc4a434be7574961 Mon Sep 17 00:00:00 2001 From: SSpirits Date: Mon, 16 Aug 2021 01:19:51 +0800 Subject: [PATCH 063/119] feat(comments): DisqusJS integration (#307) * add comment provider: DisqusJS * Simplify `if` condition, and format code * Load disqusjs.scss only when it's enabled * Use `let` instead of `var` Co-authored-by: sspirits Co-authored-by: Jimmy Cai --- assets/scss/partials/comments/disqusjs.scss | 394 ++++++++++++++++++ exampleSite/config.yaml | 7 + .../partials/comments/provider/disqusjs.html | 61 +++ 3 files changed, 462 insertions(+) create mode 100644 assets/scss/partials/comments/disqusjs.scss create mode 100644 layouts/partials/comments/provider/disqusjs.html diff --git a/assets/scss/partials/comments/disqusjs.scss b/assets/scss/partials/comments/disqusjs.scss new file mode 100644 index 0000000..eb270e3 --- /dev/null +++ b/assets/scss/partials/comments/disqusjs.scss @@ -0,0 +1,394 @@ +.disqus-container { + background-color: var(--card-background); + border-radius: var(--card-border-radius); + box-shadow: var(--shadow-l1); + padding: var(--card-padding); +} + +#dsqjs * { + margin: 0; + padding: 0 +} + +#dsqjs a { + text-decoration: none; + color: #076dd0 +} + +#dsqjs .dsqjs-hide { + display: none!important +} + +#dsqjs .dsqjs-disabled { + cursor: not-allowed; + opacity: .5 +} + +#dsqjs #dsqjs-msg { + text-align: center; + margin-top: 4px; + margin-bottom: 4px; + font-size: 14px +} + +#dsqjs #dsqjs-msg .dsqjs-msg-btn { + cursor: pointer +} + +#dsqjs .dsqjs-bullet { + line-height: 1.4; + margin: 0 2px +} + +#dsqjs .dsqjs-bullet:after { + color: #c2c6cc; + content: "·"; + font-weight: 700 +} + +#dsqjs .dsqjs-clearfix:after,#dsqjs .dsqjs-clearfix:before { + display: table; + content: ""; + line-height: 0; + clear: both +} + +#dsqjs .dsqjs-nav { + position: relative; + margin: 0 0 20px; + border-bottom: 2px solid #e7e9ee +} + +#dsqjs ol,#dsqjs ul { + list-style: none; + list-style-type: none +} + +#dsqjs .dsqjs-no-comment { + text-align: center; + font-size: 16px; + line-height: 1.5; + word-wrap: break-word; + overflow: hidden; + color: #2a2e2e; + margin-bottom: 6px +} + +#dsqjs .dsqjs-nav-tab { + float: left; + text-transform: capitalize; + font-size: 15px; + padding: 12px 8px; + color: #656c7a; + display: block; + margin: 0 15px 0 0; + font-weight: 700; + line-height: 1; + position: relative; + transition: all .2s ease-in-out +} + +#dsqjs .dsqjs-nav-tab:last-child { + margin: 0 +} + +#dsqjs .dsqjs-tab-active { + color: #2a2e2e +} + +#dsqjs .dsqjs-tab-active>span:after { + content: " "; + display: block; + height: 2px; + background-color: #076dd0!important; + position: absolute; + bottom: -5px; + left: 0; + right: 0 +} + +#dsqjs .dsqjs-post-list .dsqjs-post-item { + position: relative; + margin-bottom: 16px +} + +#dsqjs .dsqjs-post-list .dsqjs-post-avatar { + float: left; + margin-right: 10px; + position: relative; + background: #dbdfe4; + padding: 0; + display: block; + border-radius: 4px +} + +#dsqjs .dsqjs-post-list .dsqjs-post-avatar img { + width: 44px; + height: 44px; + display: block; + border-radius: 4px +} + +#dsqjs .dsqjs-post-list .dsqjs-post-header { + line-height: 1; + font-size: 14px; + margin-bottom: 3px +} + +#dsqjs .dsqjs-post-list .dsqjs-post-header .dsqjs-post-author { + color: #656c7a; + font-weight: 700 +} + +#dsqjs .dsqjs-post-list .dsqjs-post-header .dsqjs-admin-badge { + color: #fff; + background: #687a86; + padding: 1px 3px; + margin-left: 4px; + font-size: 12px; + line-height: 1; + font-weight: 700; + border-radius: 3px; + display: inline-block; + position: relative; + top: -1px; + left: 1px +} + +#dsqjs .dsqjs-post-list .dsqjs-post-header .dsqjs-meta { + display: inline-block; + font-size: 12px; + color: #656c7a +} + +#dsqjs .dsqjs-post-body { + font-size: 15px; + line-height: 1.5; + word-wrap: break-word; + overflow: hidden; + color: #2a2e2e +} + +#dsqjs .dsqjs-post-body code { + padding: .2em .4em; + margin: 0; + font-size: 85%; + background: #f5f5f5; + color: inherit; + border-radius: 3px +} + +#dsqjs .dsqjs-post-body pre { + padding: .5em; + overflow: auto; + font-size: 85%; + line-height: 1.45; + border-radius: 3px; + background: #f5f5f5; + margin: .5em 0 +} + +#dsqjs .dsqjs-post-body blockquote { + padding: 0 .8em; + margin: .5em 0; + color: #6a737d; + border-left: .25em solid #dfe2e5 +} + +#dsqjs .dsqjs-post-body p:last-child { + margin: 0 +} + +#dsqjs .dsqjs-post-list.dsqjs-children>li { + margin-left: 30px +} + +#dsqjs .dsqjs-post-list.dsqjs-children .dsqjs-post-avatar img { + width: 38px; + height: 38px +} + +#dsqjs .dsqjs-load-more { + font-size: 14px; + font-weight: 400; + display: block; + text-align: center; + padding: 11px 14px; + margin: 0 0 24px; + background: #687a86; + color: #fff; + cursor: pointer +} + +#dsqjs .dsqjs-load-more:hover { + opacity: .8 +} + +#dsqjs footer { + text-align: right; + line-height: 1.5; + padding-top: 10px; + padding-right: 10px; + border-top: 2px solid #e7e9ee; + margin-top: 12px; + font-weight: 700; + font-size: 16px; + color: #555 +} + +#dsqjs .dsqjs-disqus-logo { + background-image: url(https://c.disquscdn.com/next/embed/assets/img/sprite.654110a9206fd22f08cca0798e34a65e.png); + background-repeat: no-repeat; + display: inline-block; + background-size: 86px 40.5px; + height: 16.5px; + width: 86px; +} + +#dsqjs .dsqjs-order { + display: flex; + float: right; + align-items: center; + margin-top: 10px; + margin-bottom: 12px +} + +#dsqjs .dsqjs-order-radio { + display: none +} + +#dsqjs .dsqjs-order-radio:checked+.dsqjs-order-label { + color: #fff; + background-color: #888 +} + +#dsqjs .dsqjs-order-label { + display: block; + height: 20px; + line-height: 20px; + margin-right: 10px; + font-size: 12px; + border-radius: 2px; + padding: 0 5px; + background-color: #dcdcdc; + cursor: pointer +} + +#dsqjs p.dsqjs-has-more { + margin-bottom: 24px; + margin-left: 48px; + font-size: 13px; + line-height: 15px +} + +#dsqjs p.dsqjs-has-more a.dsqjs-has-more-btn { + color: #656c7a; + text-decoration: underline; + cursor: pointer +} + +@media (min-width: 768px) { + #dsqjs .dsqjs-post-list.dsqjs-children>li { + margin-left:48px + } + + #dsqjs .dsqjs-post-list .dsqjs-post-avatar { + margin-right: 12px + } + + #dsqjs .dsqjs-post-list .dsqjs-post-item { + margin-bottom: 20px + } +} + +@media (min-width: 1024px) { + #dsqjs .dsqjs-post-list.dsqjs-children>li { + margin-left:60px + } +} + +:root[data-scheme="light"] { + #dsqjs .dsqjs-disqus-logo { + background-position: 0 -7px; + } +} + +:root[data-scheme="dark"] { + #dsqjs { + --t-s: rgba(255,255,255,0.9); + --alt: #3e4b5e; + --link-hover: #47a2e0; + --hover-bg: #3e4b5e; + --tag: #3e4b5e; + --border: #435266; + --pre: #3c495b; + --c-bg: #2f3947; + --code: #c3c7cb; + --kbd: #4e5f77; + --hl: #abb2bf; + --hlc: #808895; + --hlk: #c678dd; + --hln: #e06c75; + --hll: #56b6c2; + --hls: #98c379; + --hlt: #e6c07b; + --hlv: #d19a66; + --bg: #181c27; + --main: #252d38; + --t: rgba(255,255,255,0.86); + --t-l: rgba(255,255,255,0.66); + --logo: #fff; + --link: #38a3fd; + --title: rgba(255,255,255,0.92); + --fab: #364151; + --shadow: none; + } + + #disqus_thread { + color: var(--body-text-color) + } + + #dsqjs #dsqjs-msg { + color: var(--t) + } + + #dsqjs a { + color:var(--link) + } + + #dsqjs a:focus,#dsqjs a:hover { + color: var(--link-hover) + } + + #dsqjs .dsqjs-disqus-logo { + background-position: 0 -24px; + } + + #dsqjs .dsqjs-nav,#dsqjs footer { + border-color: var(--hlc) + } + + #dsqjs .dsqjs-load-more,#dsqjs .dsqjs-load-more:hover,#dsqjs .dsqjs-nav-tab,#dsqjs .dsqjs-no-comment,#dsqjs .dsqjs-post-content { + color: var(--t) + } + + #dsqjs .dsqjs-order-label { + background-color: var(--hlc) + } + + #dsqjs .dsqjs-order-radio:checked+.dsqjs-order-label { + background-color: var(--kbd) + } + + #dsqjs .dsqjs-tab-active>span:after { + background-color: #2e9fff + } + + #dsqjs .dsqjs-footer,#dsqjs .dsqjs-meta { + color: var(--t-l) + } + + #dsqjs .dsqjs-post-body blockquote { + border-color: var(--border) + } +} diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 425a142..b602ff2 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -53,6 +53,13 @@ params: enabled: true provider: disqus + disqusjs: + shortname: + apiUrl: + apiKey: + admin: + adminLabel: + utterances: repo: issueTerm: pathname diff --git a/layouts/partials/comments/provider/disqusjs.html b/layouts/partials/comments/provider/disqusjs.html new file mode 100644 index 0000000..8dbcc13 --- /dev/null +++ b/layouts/partials/comments/provider/disqusjs.html @@ -0,0 +1,61 @@ +{{- $pc := .Site.Config.Privacy.Disqus -}} +{{- $disqusjs := .Site.Params.Comments.disqusjs -}} +{{- if and (not $pc.Disable) (and $disqusjs.Shortname $disqusjs.ApiKey) -}} + +{{- $style := resources.Get "scss/partials/comments/disqusjs.scss" | resources.ToCSS | minify -}} + + +
    +
    + +
    +
    +{{- end -}} \ No newline at end of file From fe94466ec4df74533fa29944ca56417d6d9f0c5d Mon Sep 17 00:00:00 2001 From: Franziskus Kiefer Date: Tue, 24 Aug 2021 12:16:27 +0200 Subject: [PATCH 064/119] fix(config): doc link (#323) --- exampleSite/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index b602ff2..37e9f97 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -151,7 +151,7 @@ params: enabled: true ### Custom menu -### See https://docs.stack.jimmycai.com/configuration/custom-menu +### See https://docs.stack.jimmycai.com/configuration/custom-menu.html ### To remove about, archive and search page menu item, remove `menu` field from their FrontMatter menu: main: From 626265bcfd3ebfe4a528cd367964a34b3ed9c5ab Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Wed, 25 Aug 2021 12:20:15 +0200 Subject: [PATCH 065/119] refactor(article): better support for svg and external images (#326) --- assets/ts/gallery.ts | 4 +- layouts/_default/_markup/render-image.html | 72 +++++++++++++--------- 2 files changed, 46 insertions(+), 30 deletions(-) diff --git a/assets/ts/gallery.ts b/assets/ts/gallery.ts index 8bce5a9..5de13a2 100644 --- a/assets/ts/gallery.ts +++ b/assets/ts/gallery.ts @@ -34,7 +34,7 @@ class StackGallery { private loadItems(container: HTMLElement) { this.items = []; - const figures = container.querySelectorAll('figure'); + const figures = container.querySelectorAll('figure.gallery-image'); for (const el of figures) { const figcaption = el.querySelector('figcaption'), @@ -57,7 +57,7 @@ class StackGallery { } public static createGallery(container: HTMLElement) { - const figuresEl = container.querySelectorAll('figure'); + const figuresEl = container.querySelectorAll('figure.gallery-image'); let currentGallery = []; diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index fbaba27..0325458 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -1,30 +1,46 @@ {{- $image := .Page.Resources.GetMatch (printf "%s" (.Destination | safeURL)) -}} -{{- if and $image (ne (path.Ext .Destination) ".svg") -}} - {{- $alt := .PlainText | safeHTML -}} -
    - - {{- $Permalink := $image.RelPermalink -}} - {{- $Width := $image.Width -}} - {{- $Height := $image.Height -}} - {{- $Srcset := "" -}} +{{- $Permalink := .Destination | relURL | safeURL -}} +{{- $alt := .PlainText | safeHTML -}} +{{- $Width := 0 -}} +{{- $Height := 0 -}} +{{- $Srcset := "" -}} - {{- if (default true .Page.Site.Params.imageProcessing.content.enabled) -}} - {{- $small := $image.Resize "480x" -}} - {{- $big := $image.Resize "1024x" -}} - {{- $Srcset = printf "%s 480w, %s 1024w" $small.RelPermalink $big.RelPermalink -}} - {{- end -}} - - - - {{ with $alt }} -
    {{ . | markdownify }}
    - {{ end }} -
    -{{- else -}} - {{ .Text }} -{{- end -}} \ No newline at end of file +{{/* SVG and external images won't work with gallery layout, because their width and height attributes are unknown */}} +{{- $galleryImage := false -}} + +{{- if $image -}} + {{- $notSVG := ne (path.Ext .Destination) ".svg" -}} + {{- $Permalink = $image.RelPermalink -}} + + {{- if $notSVG -}} + {{- $Width = $image.Width -}} + {{- $Height = $image.Height -}} + {{- $galleryImage = true -}} + + {{- if (default true .Page.Site.Params.imageProcessing.content.enabled) -}} + {{- $small := $image.Resize `480x` -}} + {{- $big := $image.Resize `1024x` -}} + {{- $Srcset = printf `%s 480w, %s 1024w` $small.RelPermalink $big.RelPermalink -}} + {{- end -}} + {{- end -}} +{{- end -}} + + \ No newline at end of file From 2013c50abe6c4ce15ae553d2a9bb17dd73be1d45 Mon Sep 17 00:00:00 2001 From: MikDal002 Date: Wed, 25 Aug 2021 12:23:50 +0200 Subject: [PATCH 066/119] feat(i18n): add PL translation for reading time (#325) --- i18n/pl.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/i18n/pl.yaml b/i18n/pl.yaml index 455e682..f261f86 100644 --- a/i18n/pl.yaml +++ b/i18n/pl.yaml @@ -28,6 +28,10 @@ article: lastUpdatedOn: other: Ostatnio zaktualizowany + + readingTime: + one: "Przeczytasz w {{ .Count }} minutę" + other: "Przeczytasz w {{ .Count }} minut" notFound: title: From e24f5672c3bf9680fbc529b43562a94a05c90333 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Wed, 25 Aug 2021 12:25:11 +0200 Subject: [PATCH 067/119] release: 3.2.0 --- layouts/partials/footer/footer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/footer/footer.html b/layouts/partials/footer/footer.html index 51ef29d..9174dd1 100644 --- a/layouts/partials/footer/footer.html +++ b/layouts/partials/footer/footer.html @@ -1,4 +1,4 @@ -{{- $ThemeVersion := "3.1.0" -}} +{{- $ThemeVersion := "3.2.0" -}}