From 99418f1056dd83f95ee84a57315d43327a94c86e Mon Sep 17 00:00:00 2001 From: SOT-TECH <41361221+sot-tech@users.noreply.github.com> Date: Sun, 11 Jul 2021 12:23:52 +0300 Subject: [PATCH 01/15] feat(i18n): add russian translation for back and TOC (#262) --- i18n/ru.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/i18n/ru.yaml b/i18n/ru.yaml index f0c562f..863642e 100644 --- a/i18n/ru.yaml +++ b/i18n/ru.yaml @@ -21,10 +21,14 @@ list: other: Подразделы article: + back: + other: Назад relatedContents: other: Также рекомендуем lastUpdatedOn: other: Обновлено + tableOfContents: + other: Содержание notFound: title: From 8cb11d721f550932b3851bc7fa595d55b44faa7c Mon Sep 17 00:00:00 2001 From: Farrel Franqois Date: Mon, 19 Jul 2021 17:21:49 +0700 Subject: [PATCH 02/15] feat(i18n): Improve Indonesian translation (#265) --- i18n/id.yaml | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/i18n/id.yaml b/i18n/id.yaml index 31cea39..35a7fab 100644 --- a/i18n/id.yaml +++ b/i18n/id.yaml @@ -1,24 +1,48 @@ toggleMenu: other: Tampilkan Menu +darkMode: + other: Mode Gelap + +list: + page: + one: "{{ .Count }} halaman" + other: "{{ .Count }} halaman" + + section: + other: Bagian + + subsection: + one: Subbagian + other: Subbagian + article: + back: + other: Kembali + + tableOfContents: + other: Daftar Isi + relatedContents: other: Konten terkait + lastUpdatedOn: other: Terakhir diperbarui pada notFound: title: - other: Not Found + other: Tidak ditemukan subtitle: - other: Halaman ini tidak ada. + other: Halaman yang Anda akses tidak ditemukan. widget: archives: title: other: Arsip + more: other: Lebih + tagCloud: title: other: Tag @@ -26,13 +50,16 @@ widget: search: title: other: Cari + placeholder: other: Ketik sesuatu... + resultTitle: other: "#PAGES_COUNT halaman (#TIME_SECONDS detik)" footer: builtWith: other: Dibangun dengan {{ .Generator }} + designedBy: other: Tema {{ .Theme }} dirancang oleh {{ .DesignedBy }} From a25e6463bdc9900e5f999d276a0e5d92ee1f8d9a Mon Sep 17 00:00:00 2001 From: Hendra Manudinata <87532060+manudinath@users.noreply.github.com> Date: Fri, 23 Jul 2021 16:56:52 +0800 Subject: [PATCH 03/15] feat(sidebar): add option to disable avatar in left sidebar (#268) * Allow to disable logo image in left sidebar * Enable sidebar avatar by default for backward compatibility Co-authored-by: Jimmy Cai --- exampleSite/config.yaml | 1 + layouts/partials/sidebar/left.html | 2 ++ 2 files changed, 3 insertions(+) diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 578c574..de5d951 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -37,6 +37,7 @@ params: emoji: 🍥 subtitle: Lorem ipsum dolor sit amet, consectetur adipiscing elit. avatar: + enabled: true local: true src: img/avatar.png diff --git a/layouts/partials/sidebar/left.html b/layouts/partials/sidebar/left.html index c7158bb..af483e3 100644 --- a/layouts/partials/sidebar/left.html +++ b/layouts/partials/sidebar/left.html @@ -7,6 +7,7 @@
{{ with .Site.Params.sidebar.avatar }} + {{ if (default true .enabled) }}
{{ if not .local }} @@ -26,6 +27,7 @@ {{ . }} {{ end }}
+ {{ end }} {{ end }}

{{ .Site.Title }}

{{ .Site.Params.sidebar.subtitle }}

From dcfc7b55895146380eabb511b5aaf9835f1f5e36 Mon Sep 17 00:00:00 2001 From: Bachrul uluum <49960993+uluumbch@users.noreply.github.com> Date: Fri, 23 Jul 2021 23:37:30 +0700 Subject: [PATCH 04/15] feat(article): reading time (#204) * add reading time feature * Revert change in jsconfig.json * feat: add article.readingTime param, and improve style * Revert change in jsconfig.json x2 * Remove reading time in compact layout It doesn't look right to me for now * feat: add i18n support to reading time string * Hide footer.article-time when there's not content Co-authored-by: Jimmy Cai --- assets/icons/date.svg | 9 +++++++ assets/scss/partials/article.scss | 7 ++++++ exampleSite/config.yaml | 1 + i18n/en.yaml | 5 ++++ .../partials/article/components/details.html | 25 ++++++++++++++----- 5 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 assets/icons/date.svg diff --git a/assets/icons/date.svg b/assets/icons/date.svg new file mode 100644 index 0000000..ed92a90 --- /dev/null +++ b/assets/icons/date.svg @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/assets/scss/partials/article.scss b/assets/scss/partials/article.scss index c71cab4..459c22f 100644 --- a/assets/scss/partials/article.scss +++ b/assets/scss/partials/article.scss @@ -95,7 +95,9 @@ display: flex; align-items: center; color: var(--card-text-color-tertiary); + gap: 15px; margin-top: 10px; + flex-wrap: wrap; svg { vertical-align: middle; @@ -108,6 +110,11 @@ time { font-size: 1.4rem; } + + & > div { + display: inline-flex; + align-items: center; + } } .article-category, diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index de5d951..2ff6a1e 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -44,6 +44,7 @@ params: article: math: false toc: true + readingTime: true license: enabled: true default: Licensed under CC BY-NC-SA 4.0 diff --git a/i18n/en.yaml b/i18n/en.yaml index 21b1310..e279278 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -29,6 +29,11 @@ article: lastUpdatedOn: other: Last updated on + readingTime: + one: "{{ .Count }} min read" + ### Seems that there's no need to add 's' even if it's plural in English + other: "{{ .Count }} min read" + notFound: title: other: Not Found diff --git a/layouts/partials/article/components/details.html b/layouts/partials/article/components/details.html index 5c5397b..64d6c6e 100644 --- a/layouts/partials/article/components/details.html +++ b/layouts/partials/article/components/details.html @@ -21,12 +21,25 @@ {{ end }} - {{- if not .Date.IsZero -}} + {{ if or (not .Date.IsZero) (.Site.Params.article.readingTime) }}
- {{ partial "helper/icon" "clock" }} - + {{ if not .Date.IsZero }} +
+ {{ partial "helper/icon" "date" }} + +
+ {{ end }} + + {{ if .Site.Params.article.readingTime }} +
+ {{ partial "helper/icon" "clock" }} + +
+ {{ end }}
- {{- end -}} + {{ end }} \ No newline at end of file From 44e3d20bad845a515657308d38692e7f431b4d05 Mon Sep 17 00:00:00 2001 From: Simon Guest Date: Mon, 26 Jul 2021 05:50:52 +1200 Subject: [PATCH 05/15] feat(article): use `markdownify` for licence in article (#273) * Use markdownify for licence in article So we can use links, e.g. to credits for main photo. * refactor: move .article-copyright style to partials/layout/article Co-authored-by: Jimmy Cai --- assets/scss/partials/layout/article.scss | 6 ++++++ layouts/partials/article/components/footer.html | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/assets/scss/partials/layout/article.scss b/assets/scss/partials/layout/article.scss index ebf94a7..5331a61 100644 --- a/assets/scss/partials/layout/article.scss +++ b/assets/scss/partials/layout/article.scss @@ -70,6 +70,12 @@ flex-wrap: wrap; text-transform: unset; } + + .article-copyright { + a { + color: var(--body-text-color); + } + } } } } diff --git a/layouts/partials/article/components/footer.html b/layouts/partials/article/components/footer.html index f518d76..c6a7662 100644 --- a/layouts/partials/article/components/footer.html +++ b/layouts/partials/article/components/footer.html @@ -4,7 +4,7 @@ {{ if and (.Site.Params.article.license.enabled) (not (eq .Params.license false)) }}
{{ partial "helper/icon" "copyright" }} - {{ default .Site.Params.article.license.default .Params.license }} + {{ default .Site.Params.article.license.default .Params.license | markdownify }}
{{ end }} @@ -16,4 +16,4 @@ {{- end -}} - \ 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 06/15] 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 07/15] 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 08/15] 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 09/15] 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 10/15] 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 11/15] 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 12/15] 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 13/15] 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 14/15] 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 15/15] 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;