diff --git a/config.yaml b/config.yaml index f6e5d21..54a7e77 100644 --- a/config.yaml +++ b/config.yaml @@ -2,7 +2,8 @@ baseURL: https://blog.mitsea.com/ languageCode: zh-cn title: Mitsea Blog theme: hugo-theme-stack -paginate: 10 +pagination: + pagerSize: 10 languages: zh-cn: diff --git a/themes/hugo-theme-stack/assets/icons/chevron-left.svg b/themes/hugo-theme-stack/assets/icons/chevron-left.svg new file mode 100644 index 0000000..4480a0a --- /dev/null +++ b/themes/hugo-theme-stack/assets/icons/chevron-left.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/themes/hugo-theme-stack/assets/icons/chevron-right.svg b/themes/hugo-theme-stack/assets/icons/chevron-right.svg new file mode 100644 index 0000000..2be2e9c --- /dev/null +++ b/themes/hugo-theme-stack/assets/icons/chevron-right.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/themes/hugo-theme-stack/assets/icons/dots.svg b/themes/hugo-theme-stack/assets/icons/dots.svg new file mode 100644 index 0000000..0e7be05 --- /dev/null +++ b/themes/hugo-theme-stack/assets/icons/dots.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/themes/hugo-theme-stack/assets/scss/partials/article.scss b/themes/hugo-theme-stack/assets/scss/partials/article.scss index e2c05a4..6c2feb1 100644 --- a/themes/hugo-theme-stack/assets/scss/partials/article.scss +++ b/themes/hugo-theme-stack/assets/scss/partials/article.scss @@ -131,6 +131,7 @@ .article-tags { display: flex; gap: 10px; + flex-wrap: wrap; a { color: var(--accent-color-text); diff --git a/themes/hugo-theme-stack/assets/scss/partials/base.scss b/themes/hugo-theme-stack/assets/scss/partials/base.scss index efb4b8f..c6d750a 100644 --- a/themes/hugo-theme-stack/assets/scss/partials/base.scss +++ b/themes/hugo-theme-stack/assets/scss/partials/base.scss @@ -12,6 +12,9 @@ body { margin: 0; font-family: var(--base-font-family); font-size: 1.6rem; + text-autospace: ideograph-alpha ideograph-numeric punctuation insert; + text-spacing-trim: trim-start allow-end; + -ms-text-autospace: ideograph-alpha; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } @@ -35,4 +38,4 @@ body { ::-webkit-scrollbar-track { background-color: transparent; } -/**/ \ No newline at end of file +/**/ diff --git a/themes/hugo-theme-stack/assets/scss/partials/layout/article.scss b/themes/hugo-theme-stack/assets/scss/partials/layout/article.scss index 2a61423..10e2706 100644 --- a/themes/hugo-theme-stack/assets/scss/partials/layout/article.scss +++ b/themes/hugo-theme-stack/assets/scss/partials/layout/article.scss @@ -67,7 +67,6 @@ } .article-tags { - flex-wrap: wrap; text-transform: unset; } diff --git a/themes/hugo-theme-stack/assets/scss/partials/layout/list.scss b/themes/hugo-theme-stack/assets/scss/partials/layout/list.scss index d7815ca..b97e1d2 100644 --- a/themes/hugo-theme-stack/assets/scss/partials/layout/list.scss +++ b/themes/hugo-theme-stack/assets/scss/partials/layout/list.scss @@ -33,6 +33,7 @@ img { width: 60px; height: 60px; + object-fit: cover; } } @@ -47,10 +48,12 @@ .subsection-list { overflow-x: auto; + margin-left: -24px; .article-list--tile { display: flex; - padding-bottom: 15px; + padding: 8px 0 34px 24px; + width: max-content; article { width: 250px; @@ -68,4 +71,4 @@ } } } -} +} \ No newline at end of file diff --git a/themes/hugo-theme-stack/assets/scss/partials/pagination.scss b/themes/hugo-theme-stack/assets/scss/partials/pagination.scss index ca46780..32fc9bb 100644 --- a/themes/hugo-theme-stack/assets/scss/partials/pagination.scss +++ b/themes/hugo-theme-stack/assets/scss/partials/pagination.scss @@ -4,18 +4,47 @@ box-shadow: var(--shadow-l1); border-radius: var(--card-border-radius); overflow: hidden; - flex-wrap: wrap; .page-link { - padding: 16px 32px; - display: inline-flex; + padding: 16px 0; + margin: 0; + border-radius: 0; + display: flex; + align-items: center; + justify-content: center; + flex: 1 1 auto; + min-width: 48px; + color: var(--card-text-color-secondary); + text-decoration: none; - &.current { - font-weight: bold; - background-color: var(--card-background-selected); - color: var(--card-text-color-main); + &:first-child, + &:last-child { + flex: 0 0 48px; + padding: 16px; } - color: var(--card-text-color-secondary); + &:hover:not(.current):not(.disabled) { + background-color: var(--card-background-selected); + opacity: 0.8; + } + + &.current { + background-color: var(--card-background-selected); + color: var(--card-text-color-main); + font-weight: bold; + cursor: default; + } + + &.disabled { + opacity: 0.3; + cursor: not-allowed; + pointer-events: none; + color: var(--card-text-color-secondary); + } + + svg { + width: 20px; + height: 20px; + } } -} +} \ No newline at end of file diff --git a/themes/hugo-theme-stack/assets/scss/variables.scss b/themes/hugo-theme-stack/assets/scss/variables.scss index 97810a1..2fb69be 100644 --- a/themes/hugo-theme-stack/assets/scss/variables.scss +++ b/themes/hugo-theme-stack/assets/scss/variables.scss @@ -41,10 +41,8 @@ $defaultTagColors: #fff, #fff, #fff, #fff, #fff; */ :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", var(--zh-font-family), monospace; + --base-font-family: "Lato", var(--sys-font-family), sans-serif; + --code-font-family: Menlo, Monaco, Consolas, "Courier New", monospace; } /* diff --git a/themes/hugo-theme-stack/assets/ts/colorScheme.ts b/themes/hugo-theme-stack/assets/ts/colorScheme.ts index 8cb8a20..978e98e 100644 --- a/themes/hugo-theme-stack/assets/ts/colorScheme.ts +++ b/themes/hugo-theme-stack/assets/ts/colorScheme.ts @@ -8,6 +8,10 @@ class StackColorScheme { constructor(toggleEl: HTMLElement) { this.bindMatchMedia(); this.currentScheme = this.getSavedScheme(); + if (window.matchMedia('(prefers-color-scheme: dark)').matches === true) + this.systemPreferScheme = 'dark' + else + this.systemPreferScheme = 'light'; this.dispatchEvent(document.documentElement.dataset.scheme as colorScheme); diff --git a/themes/hugo-theme-stack/assets/ts/scrollspy.ts b/themes/hugo-theme-stack/assets/ts/scrollspy.ts index 8a14085..7cf416e 100644 --- a/themes/hugo-theme-stack/assets/ts/scrollspy.ts +++ b/themes/hugo-theme-stack/assets/ts/scrollspy.ts @@ -32,9 +32,11 @@ function buildIdToNavigationElementMap(navigation: NodeListOf): IdToEle const sectionLinkRef: IdToElementMap = {}; navigation.forEach((navigationElement: HTMLElement) => { const link = navigationElement.querySelector("a"); - const href = link.getAttribute("href"); - if (href.startsWith("#")) { - sectionLinkRef[href.slice(1)] = navigationElement; + if (link) { + const href = link.getAttribute("href"); + if (href.startsWith("#")) { + sectionLinkRef[href.slice(1)] = navigationElement; + } } }); @@ -125,7 +127,14 @@ function setupScrollspy() { scrollHandler(); } + // Use ResizeObserver to detect changes in the size of .article-content + const articleContent = document.querySelector(".article-content"); + if (articleContent) { + const resizeObserver = new ResizeObserver(debounced(resizeHandler)); + resizeObserver.observe(articleContent); + } + window.addEventListener("resize", debounced(resizeHandler)); } -export { setupScrollspy }; \ No newline at end of file +export { setupScrollspy }; diff --git a/themes/hugo-theme-stack/assets/ts/search.tsx b/themes/hugo-theme-stack/assets/ts/search.tsx index 856b48d..1c81dd1 100644 --- a/themes/hugo-theme-stack/assets/ts/search.tsx +++ b/themes/hugo-theme-stack/assets/ts/search.tsx @@ -53,7 +53,14 @@ class Search { this.resultTitle = resultTitle; this.resultTitleTemplate = resultTitleTemplate; - this.handleQueryString(); + /// Check if there's already value in the search input + if (this.input.value.trim() !== '') { + this.doSearch(this.input.value.split(' ')); + } + else { + this.handleQueryString(); + } + this.bindQueryStringChange(); this.bindSearchForm(); } diff --git a/themes/hugo-theme-stack/exampleSite/content/_index.ja.md b/themes/hugo-theme-stack/exampleSite/content/_index.ja.md new file mode 100644 index 0000000..7b6ff06 --- /dev/null +++ b/themes/hugo-theme-stack/exampleSite/content/_index.ja.md @@ -0,0 +1,8 @@ +--- +menu: + main: + name: ホーム + weight: -100 + params: + icon: home +--- \ No newline at end of file diff --git a/themes/hugo-theme-stack/exampleSite/content/_index.zh-tw.md b/themes/hugo-theme-stack/exampleSite/content/_index.zh-tw.md new file mode 100644 index 0000000..65e177b --- /dev/null +++ b/themes/hugo-theme-stack/exampleSite/content/_index.zh-tw.md @@ -0,0 +1,8 @@ +--- +menu: + main: + name: 主頁 + weight: -100 + params: + icon: home +--- \ No newline at end of file diff --git a/themes/hugo-theme-stack/exampleSite/content/post/chinese-test/index.ja.md b/themes/hugo-theme-stack/exampleSite/content/post/chinese-test/index.ja.md new file mode 100644 index 0000000..28135e3 --- /dev/null +++ b/themes/hugo-theme-stack/exampleSite/content/post/chinese-test/index.ja.md @@ -0,0 +1,26 @@ +--- +title: Japanese Test +description: これはサブタイトル +date: 2020-09-09 +slug: test-chinese +image: helena-hertz-wWZzXlDpMog-unsplash.jpg +categories: + - Test + - テスト +--- + +## 本文テスト(フォント) + +返扇花週認契適違込遷雇述請曜藤突扉直角 + +## 引用 + +> 国破れて山河在り\ +> 城春にして草木深し\ +> 時に感じては花にも涙を濺ぎ\ +> 別れを恨んでは鳥にも心を驚かす +> +> 烽火三月に連なり\ +> 家書万金に抵たる\ +> 白頭掻けば更に短く\ +> 渾べて簪に勝へざらんと欲す diff --git a/themes/hugo-theme-stack/exampleSite/content/post/chinese-test/index.zh-cn.md b/themes/hugo-theme-stack/exampleSite/content/post/chinese-test/index.zh-cn.md index 5249ef8..c319b58 100644 --- a/themes/hugo-theme-stack/exampleSite/content/post/chinese-test/index.zh-cn.md +++ b/themes/hugo-theme-stack/exampleSite/content/post/chinese-test/index.zh-cn.md @@ -36,4 +36,8 @@ categories: ![Photo by Helena Hertz on Unsplash](helena-hertz-wWZzXlDpMog-unsplash.jpg) ![Photo by Hudai Gayiran on Unsplash](hudai-gayiran-3Od_VKcDEAA-unsplash.jpg) ``` -相册语法来自 [Typlog](https://typlog.com/) \ No newline at end of file +相册语法来自 [Typlog](https://typlog.com/) + +## 字体 + +返扇花週認契適違込遷雇述請曜藤突扉直角 diff --git a/themes/hugo-theme-stack/exampleSite/content/post/chinese-test/index.zh-tw.md b/themes/hugo-theme-stack/exampleSite/content/post/chinese-test/index.zh-tw.md new file mode 100644 index 0000000..09087af --- /dev/null +++ b/themes/hugo-theme-stack/exampleSite/content/post/chinese-test/index.zh-tw.md @@ -0,0 +1,14 @@ +--- +title: Chinese Test +description: 這是一個副標題 +date: 2020-09-09 +slug: test-chinese +image: helena-hertz-wWZzXlDpMog-unsplash.jpg +categories: + - Test + - 測試 +--- + +## 正文測試(字體) + +返扇花週認契適違込遷雇述請曜藤突扉直角 diff --git a/themes/hugo-theme-stack/exampleSite/content/post/emoji-support/index.md b/themes/hugo-theme-stack/exampleSite/content/post/emoji-support/index.md index bc3e348..824cec5 100644 --- a/themes/hugo-theme-stack/exampleSite/content/post/emoji-support/index.md +++ b/themes/hugo-theme-stack/exampleSite/content/post/emoji-support/index.md @@ -21,7 +21,7 @@ To enable emoji globally, set `enableEmoji` to `true` in your site's [configurat

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


-The [Emoji cheat sheet](http://www.emoji-cheat-sheet.com/) is a useful reference for emoji shorthand codes. +The [Emoji cheat sheet](https://www.webfx.com/tools/emoji-cheat-sheet/) is a useful reference for emoji shorthand codes. *** diff --git a/themes/hugo-theme-stack/exampleSite/content/post/rich-content/index.md b/themes/hugo-theme-stack/exampleSite/content/post/rich-content/index.md index 1ebb564..db37334 100644 --- a/themes/hugo-theme-stack/exampleSite/content/post/rich-content/index.md +++ b/themes/hugo-theme-stack/exampleSite/content/post/rich-content/index.md @@ -21,9 +21,9 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme --- -## Twitter Simple Shortcode +## X Simple Shortcode -{{< twitter_simple user="DesignReviewed" id="1085870671291310081" >}} +{{< x user="DesignReviewed" id="1085870671291310081" >}}
@@ -37,10 +37,6 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme {{< bilibili av498363026 >}} -## Gist Shortcode - -{{< gist spf13 7896402 >}} - ## Gitlab Snippets Shortcode {{< gitlab 2349278 >}} diff --git a/themes/hugo-theme-stack/exampleSite/hugo.yaml b/themes/hugo-theme-stack/exampleSite/hugo.yaml index a1e3829..0ec4ed0 100644 --- a/themes/hugo-theme-stack/exampleSite/hugo.yaml +++ b/themes/hugo-theme-stack/exampleSite/hugo.yaml @@ -1,7 +1,6 @@ -baseurl: https://example.com +baseurl: https://example.com/ languageCode: en-us theme: hugo-theme-stack -paginate: 3 title: Example Site copyright: Example Person @@ -19,20 +18,39 @@ languages: title: Example Site weight: 1 params: - description: Example description + sidebar: + subtitle: Example description zh-cn: - languageName: 中文 + languageName: 简体中文 title: 演示站点 weight: 2 params: - description: 演示说明 + sidebar: + subtitle: 演示说明 + + zh-tw: + languageName: 正體中文 + title: 演示站點 + weight: 2 + params: + sidebar: + subtitle: 演示說明 + + ja: + languageName: 日本語 + title: サンプルサイト + weight: 2 + params: + sidebar: + subtitle: サンプル説明 ar: languageName: عربي languagedirection: rtl title: موقع تجريبي weight: 3 params: - description: وصف تجريبي + sidebar: + subtitle: وصف تجريبي services: # Change it to your Disqus shortname before using @@ -42,6 +60,9 @@ services: googleAnalytics: id: +pagination: + pagerSize: 3 + permalinks: post: /p/:slug/ page: /:slug/ @@ -97,7 +118,7 @@ params: repo: issueTerm: pathname label: - theme: + theme: remark42: host: @@ -156,6 +177,7 @@ params: repo: clientID: clientSecret: + proxy: cusdis: host: @@ -234,6 +256,18 @@ related: markup: goldmark: + extensions: + passthrough: + enable: true + delimiters: + block: + - - \[ + - \] + - - $$ + - $$ + inline: + - - \( + - \) renderer: ## Set to true if you have HTML content inside Markdown unsafe: true diff --git a/themes/hugo-theme-stack/config.yaml b/themes/hugo-theme-stack/hugo.yaml similarity index 95% rename from themes/hugo-theme-stack/config.yaml rename to themes/hugo-theme-stack/hugo.yaml index e6c489a..b1a0bff 100644 --- a/themes/hugo-theme-stack/config.yaml +++ b/themes/hugo-theme-stack/hugo.yaml @@ -11,8 +11,8 @@ params: favicon: footer: - since: 2018 - customText: 皖ICP备19023860号 + since: + customText: dateFormat: published: Jan 02, 2006 @@ -25,7 +25,7 @@ params: avatar: enabled: true local: true - src: img/avatar.jpeg + src: img/avatar.png article: headingAnchor: false diff --git a/themes/hugo-theme-stack/i18n/ar.yaml b/themes/hugo-theme-stack/i18n/ar.yaml index 63101aa..45fd749 100644 --- a/themes/hugo-theme-stack/i18n/ar.yaml +++ b/themes/hugo-theme-stack/i18n/ar.yaml @@ -68,7 +68,7 @@ search: footer: builtWith: - other: "مبني بستخدام {{ .Generator }}" + other: "مبني باستخدام {{ .Generator }}" designedBy: other: "قالب {{ .Theme }} مصمم من {{ .DesignedBy }}" diff --git a/themes/hugo-theme-stack/i18n/bg.yaml b/themes/hugo-theme-stack/i18n/bg.yaml new file mode 100644 index 0000000..cf64a56 --- /dev/null +++ b/themes/hugo-theme-stack/i18n/bg.yaml @@ -0,0 +1,73 @@ +toggleMenu: + other: Покажи Меню + +darkMode: + other: Тъмен Режим + +list: + page: + one: "{{ .Count }} страница" + other: "{{ .Count }} страници" + + section: + other: Секция + + subsection: + one: Подсекция + other: Подсекции + +article: + back: + other: Назад + + tableOfContents: + other: Съдържание + + relatedContent: + other: Свързано Съдържание + + lastUpdatedOn: + other: Последна промяна на + + readingTime: + one: "{{ .Count }} minute read" + other: "{{ .Count }} minute read" + +notFound: + title: + other: Не е намерено + + subtitle: + other: Страницата която търсите не е открита + +widget: + archives: + title: + other: Архиви + + more: + other: Повече + + tagCloud: + title: + other: Тагове + categoriesCloud: + title: + other: Категории + +search: + title: + other: Търсене + + placeholder: + other: Напишете нещо... + + resultTitle: + other: "#PAGES_COUNT страници (#TIME_SECONDS секунди)" + +footer: + builtWith: + other: Създадено с {{ .Generator }} + + designedBy: + other: Тема {{ .Theme }} създадена от {{ .DesignedBy }} diff --git a/themes/hugo-theme-stack/i18n/fr.yaml b/themes/hugo-theme-stack/i18n/fr.yaml index c3feb1d..4e6e1f8 100644 --- a/themes/hugo-theme-stack/i18n/fr.yaml +++ b/themes/hugo-theme-stack/i18n/fr.yaml @@ -50,6 +50,9 @@ widget: tagCloud: title: other: Mots clés + categoriesCloud: + title: + other: Catégories search: title: diff --git a/themes/hugo-theme-stack/i18n/it.yaml b/themes/hugo-theme-stack/i18n/it.yaml index 0cbeeab..57eb4d5 100644 --- a/themes/hugo-theme-stack/i18n/it.yaml +++ b/themes/hugo-theme-stack/i18n/it.yaml @@ -2,7 +2,7 @@ toggleMenu: other: Toggle Menu darkMode: - other: Dark Mode + other: Modalità scura list: page: @@ -49,7 +49,7 @@ widget: tagCloud: title: - other: Tags + other: Tag categoriesCloud: title: diff --git a/themes/hugo-theme-stack/i18n/oc.yaml b/themes/hugo-theme-stack/i18n/oc.yaml new file mode 100644 index 0000000..1415350 --- /dev/null +++ b/themes/hugo-theme-stack/i18n/oc.yaml @@ -0,0 +1,72 @@ +toggleMenu: + other: Alternar menú + +darkMode: + other: Mòde fosc + +list: + page: + one: "{{ .Count }} pagina" + other: "{{ .Count }} paginas" + + section: + other: Seccion + + subsection: + one: Josseccion + other: Josseccions + +article: + back: + other: Tornar + + tableOfContents: + other: Taula de contengut + + relatedContent: + other: Contenguts relacionats + + lastUpdatedOn: + other: Darrièra actualizacion + readingTime: + one: "{{ .Count }} minuta de lectura" + other: "{{ .Count }} minutas de lectura" + +notFound: + title: + other: Non trobat + + subtitle: + other: Aquesta pagina existís pas + +widget: + archives: + title: + other: Archiu + + more: + other: Mai + + tagCloud: + title: + other: Etiquetas + categoriesCloud: + title: + other: Categorias + +search: + title: + other: Cercar + + placeholder: + other: Picatz quicòm... + + resultTitle: + other: "#PAGES_COUNT paginas dins (#TIME_SECONDS segons)" + +footer: + builtWith: + other: Creat amb {{ .Generator }} + + designedBy: + other: Tàma {{ .Theme }} concebut per {{ .DesignedBy }} diff --git a/themes/hugo-theme-stack/i18n/ru.yaml b/themes/hugo-theme-stack/i18n/ru.yaml index b1f1e51..2dc72d5 100644 --- a/themes/hugo-theme-stack/i18n/ru.yaml +++ b/themes/hugo-theme-stack/i18n/ru.yaml @@ -47,6 +47,9 @@ widget: tagCloud: title: other: Теги + categoriesCloud: + title: + other: Категории search: title: diff --git a/themes/hugo-theme-stack/i18n/tr.yaml b/themes/hugo-theme-stack/i18n/tr.yaml index 2dbb9d5..edba7e3 100644 --- a/themes/hugo-theme-stack/i18n/tr.yaml +++ b/themes/hugo-theme-stack/i18n/tr.yaml @@ -17,11 +17,22 @@ list: other: Alt bölümler article: + back: + other: Geri + + tableOfContents: + other: İçindekiler + relatedContent: - other: Alakalı içerikler + other: Benzer içerikler + lastUpdatedOn: other: Son güncelleme + readingTime: + one: "{{ .Count }} dakika okuma süresi" + other: "{{ .Count }} dakika okuma süresi" + notFound: title: other: Bulunamadı @@ -37,6 +48,9 @@ widget: tagCloud: title: other: Etiketler + categoriesCloud: + title: + other: Kategoriler search: title: diff --git a/themes/hugo-theme-stack/i18n/uk.yaml b/themes/hugo-theme-stack/i18n/uk.yaml index 3bd4f71..98d310e 100644 --- a/themes/hugo-theme-stack/i18n/uk.yaml +++ b/themes/hugo-theme-stack/i18n/uk.yaml @@ -52,6 +52,9 @@ widget: tagCloud: title: other: Теґи + categoriesCloud: + title: + other: Категорії search: title: diff --git a/themes/hugo-theme-stack/i18n/zh-cn.yaml b/themes/hugo-theme-stack/i18n/zh-cn.yaml index 39b187a..da39c8f 100644 --- a/themes/hugo-theme-stack/i18n/zh-cn.yaml +++ b/themes/hugo-theme-stack/i18n/zh-cn.yaml @@ -31,7 +31,7 @@ notFound: title: other: 404 错误 subtitle: - other: 页面不存在。你可以尝试将链接中的 https://blog.mitsea.com/ 替换为 https://www.notion.so/flintylemming/ 查看原档。 + other: 页面不存在 widget: archives: diff --git a/themes/hugo-theme-stack/layouts/404.html b/themes/hugo-theme-stack/layouts/404.html index b89d2b6..d81000e 100644 --- a/themes/hugo-theme-stack/layouts/404.html +++ b/themes/hugo-theme-stack/layouts/404.html @@ -3,5 +3,43 @@

{{ T "notFound.title" }}

{{ T "notFound.subtitle" }}

+ + {{- $query := first 1 (where .Site.Pages "Layout" "==" "search") -}} + {{- $searchPage := index $query 0 -}} + + {{- with $searchPage -}} +
+

+ + + + +

+
+ +
+

+
+
+ + + + {{- $opts := dict "minify" hugo.IsProduction "JSXFactory" "createElement" -}} + {{- $searchScript := resources.Get "ts/search.tsx" | js.Build $opts -}} + + + + {{- end -}} {{ partialCached "footer/footer" . }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/themes/hugo-theme-stack/layouts/_default/_markup/render-codeblock-mermaid.html b/themes/hugo-theme-stack/layouts/_default/_markup/render-codeblock-mermaid.html new file mode 100644 index 0000000..42e8abf --- /dev/null +++ b/themes/hugo-theme-stack/layouts/_default/_markup/render-codeblock-mermaid.html @@ -0,0 +1,4 @@ +
+  {{ .Inner | htmlEscape | safeHTML }}
+
+{{ .Page.Store.Set "hasMermaid" true }} diff --git a/themes/hugo-theme-stack/layouts/_default/archives.html b/themes/hugo-theme-stack/layouts/_default/archives.html index 5d5243c..ce77f47 100644 --- a/themes/hugo-theme-stack/layouts/_default/archives.html +++ b/themes/hugo-theme-stack/layouts/_default/archives.html @@ -4,7 +4,7 @@ {{- $taxonomy := $.Site.GetPage "taxonomyTerm" "categories" -}} {{- $terms := $taxonomy.Pages -}} {{ if $terms }} -

{{ $taxonomy.Title }}

+

{{ T "widget.categoriesCloud.title" }}

{{ range $terms }} @@ -16,8 +16,7 @@ {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} - {{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }} - {{ $filtered := ($pages | intersect $notHidden) }} + {{ $filtered := where $pages "Params.hidden" "!=" true }} {{ range $filtered.GroupByDate "2006" }} {{ $id := lower (replace .Key " " "-") }} diff --git a/themes/hugo-theme-stack/layouts/_default/rss.xml b/themes/hugo-theme-stack/layouts/_default/rss.xml index 5874559..3d2e592 100644 --- a/themes/hugo-theme-stack/layouts/_default/rss.xml +++ b/themes/hugo-theme-stack/layouts/_default/rss.xml @@ -22,7 +22,7 @@ {{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Params.Author.email }} {{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} {{.}}{{end}}{{ if not .Date.IsZero }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} {{- with .OutputFormats.Get "RSS" -}} {{ printf "" .Permalink .MediaType | safeHTML }} {{- end -}} diff --git a/themes/hugo-theme-stack/layouts/_default/single.html b/themes/hugo-theme-stack/layouts/_default/single.html index 5f300bf..0e8d980 100644 --- a/themes/hugo-theme-stack/layouts/_default/single.html +++ b/themes/hugo-theme-stack/layouts/_default/single.html @@ -39,6 +39,7 @@ {{ partialCached "footer/footer" . }} {{ partialCached "article/components/photoswipe" . }} + {{ partialCached "article/components/mermaid" . }} {{ end }} {{ define "right-sidebar" }} diff --git a/themes/hugo-theme-stack/layouts/index.html b/themes/hugo-theme-stack/layouts/index.html index 0cd0b88..189daa6 100644 --- a/themes/hugo-theme-stack/layouts/index.html +++ b/themes/hugo-theme-stack/layouts/index.html @@ -1,7 +1,6 @@ {{ define "main" }} {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} - {{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }} - {{ $filtered := ($pages | intersect $notHidden) }} + {{ $filtered := where $pages "Params.hidden" "!=" true }} {{ $pag := .Paginate ($filtered) }}
diff --git a/themes/hugo-theme-stack/layouts/page/search.json b/themes/hugo-theme-stack/layouts/page/search.json index 5d4e627..4696d23 100644 --- a/themes/hugo-theme-stack/layouts/page/search.json +++ b/themes/hugo-theme-stack/layouts/page/search.json @@ -1,6 +1,5 @@ {{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}} -{{- $notHidden := where .Site.RegularPages "Params.hidden" "!=" true -}} -{{- $filtered := ($pages | intersect $notHidden) -}} +{{- $filtered := where $pages "Params.hidden" "!=" true -}} {{- $result := slice -}} diff --git a/themes/hugo-theme-stack/layouts/partials/article-list/compact.html b/themes/hugo-theme-stack/layouts/partials/article-list/compact.html index 376512a..f2784d6 100644 --- a/themes/hugo-theme-stack/layouts/partials/article-list/compact.html +++ b/themes/hugo-theme-stack/layouts/partials/article-list/compact.html @@ -6,7 +6,7 @@
diff --git a/themes/hugo-theme-stack/layouts/partials/article/components/details.html b/themes/hugo-theme-stack/layouts/partials/article/components/details.html index cc0a0fc..4d268e4 100644 --- a/themes/hugo-theme-stack/layouts/partials/article/components/details.html +++ b/themes/hugo-theme-stack/layouts/partials/article/components/details.html @@ -31,8 +31,8 @@ {{ if $showDate }}
{{ partial "helper/icon" "date" }} -
{{ end }} diff --git a/themes/hugo-theme-stack/layouts/partials/article/components/footer.html b/themes/hugo-theme-stack/layouts/partials/article/components/footer.html index 6853921..9795880 100644 --- a/themes/hugo-theme-stack/layouts/partials/article/components/footer.html +++ b/themes/hugo-theme-stack/layouts/partials/article/components/footer.html @@ -12,7 +12,7 @@
{{ partial "helper/icon" "clock" }} - {{ T "article.lastUpdatedOn" }} {{ .Lastmod.Format ( or .Site.Params.dateFormat.lastUpdated "Jan 02, 2006 15:04 MST" ) }} + {{ T "article.lastUpdatedOn" }} {{ .Lastmod | time.Format ( or .Site.Params.dateFormat.lastUpdated "Jan 02, 2006 15:04 MST" ) }}
{{- end -}} diff --git a/themes/hugo-theme-stack/layouts/partials/article/components/links.html b/themes/hugo-theme-stack/layouts/partials/article/components/links.html index a2ac26c..c526c0e 100644 --- a/themes/hugo-theme-stack/layouts/partials/article/components/links.html +++ b/themes/hugo-theme-stack/layouts/partials/article/components/links.html @@ -21,7 +21,7 @@ {{ $permalink = .RelPermalink }} {{ end }}
- + {{ . }}
{{ end }} diff --git a/themes/hugo-theme-stack/layouts/partials/article/components/math.html b/themes/hugo-theme-stack/layouts/partials/article/components/math.html index bd1a7f8..a7ce654 100644 --- a/themes/hugo-theme-stack/layouts/partials/article/components/math.html +++ b/themes/hugo-theme-stack/layouts/partials/article/components/math.html @@ -1,13 +1,21 @@ {{- partial "helper/external" (dict "Context" . "Namespace" "KaTeX") -}} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/article/components/mermaid.html b/themes/hugo-theme-stack/layouts/partials/article/components/mermaid.html new file mode 100644 index 0000000..826e2f0 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/article/components/mermaid.html @@ -0,0 +1,9 @@ +{{ if .Store.Get "hasMermaid" }} + +{{ end }} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/cusdis.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/cusdis.html index a89746c..968302d 100644 --- a/themes/hugo-theme-stack/layouts/partials/comments/provider/cusdis.html +++ b/themes/hugo-theme-stack/layouts/partials/comments/provider/cusdis.html @@ -1,21 +1,27 @@ {{- $host := default "https://cusdis.com" .Site.Params.comments.cusdis.host -}} -
+
+ \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/disqus.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/disqus.html index fb17b77..32e6197 100644 --- a/themes/hugo-theme-stack/layouts/partials/comments/provider/disqus.html +++ b/themes/hugo-theme-stack/layouts/partials/comments/provider/disqus.html @@ -1,5 +1,5 @@
- {{ template "_internal/disqus.html" . }} + {{ partial "disqus.html" . }}