diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d298be1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +public/ \ No newline at end of file diff --git a/Features.md b/Features.md new file mode 100644 index 0000000..a06fee2 --- /dev/null +++ b/Features.md @@ -0,0 +1,32 @@ +# Features + +1. Automatic Dark/Light mode based on system settings +2. Dark/Light mode switcher +3. Automatic Diagram dark/light switch +4. Automatic Giscus dark/light switch + +| Feature (light/dark mode) | Anubis2 | +| ---------------------------------------------------------------------- | ------- | +| Line Number (table) and Hilight Lines | ✅ | +| Line Number (true) and Hilight Lines | ✅ | +| Line Number (inline) and Hilight Lines | ✅ | +| Line Number (false) and Hilight Lines | ✅ | +| Line Number (table) and Hilight Lines and Anchor Line | ✅ | +| Line Number (table) and Hilight Inline | ✅ | +| Highlight Shortcode, Line Number (table) and Hilight Lines and Anchor | ✅ | +| Highlight Shortcode, Line Number (inline) and Hilight Lines and Anchor | ✅ | +| Highlight Shortcode, Line Number (false) and Hilight Lines and Anchor | ✅ | +| Mermaid Support (No Config, Lazy Load, Dark/Light Auto Switch) | ✅ | +| MathJax Support (No Config, Lazy Load, Dark/Light Auto Switch) | ✅ | +| Giscus Support (Dark/Light Auto Switch) | ✅ | +| Umami Support (Dark/Light Auto Switch) | ✅ | +| Multi-Author Support | ✅ | +| Multi-Language Support | ✅ | +| Support for \ tag | ✅ | +| Support for \ tag | ✅ | +| Support for \ tag | ✅ | +| Support for \ tag | ✅ | +| Passed CodePreKbdMark test | ✅ | +| Passed All 8 Summary Rendering Tests | ✅ 8/8 | +| Mermaid dark/light manual switch | ✅ | +| Mermaid dark/light auto switch | ✅ | diff --git a/LICENSE b/LICENSE index b76ea6d..00b76c4 100644 --- a/LICENSE +++ b/LICENSE @@ -17,4 +17,4 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index bfc5ed0..70be5e4 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,13 @@ Anubis2 is another simple minimalist theme for [Hugo blog engine](https://gohugo ## Highlighted Features - Multilingual -- Dark / Light mode +- Dark / Light mode (Automatic switch based on system settings) - Table of Contents - Comment Support (Giscus, Disque, ISSO, Utterances, GraphComment) - Analytics (Google, Umami) - RSS feeds - Mobile Support +- [Full Features](wiki/Full-Features) ## Installation diff --git a/archetypes/default.md b/archetypes/default.md index 00e77bd..26f317f 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -3,4 +3,3 @@ title: "{{ replace .Name "-" " " | title }}" date: {{ .Date }} draft: true --- - diff --git a/assets/css/dark.css b/assets/css/dark.css index e8a73cc..d01d145 100644 --- a/assets/css/dark.css +++ b/assets/css/dark.css @@ -74,4 +74,4 @@ html[data-theme='dark'] { --svg-color: #ccc; --svg-state-color: #ff5858; -} \ No newline at end of file +} diff --git a/assets/css/light.css b/assets/css/light.css index e5c0364..c1df0e4 100644 --- a/assets/css/light.css +++ b/assets/css/light.css @@ -58,7 +58,7 @@ html[data-theme="light"] { --pre-bg-color: #eff1f2; --pre-border-color: #e1e5e9; --kbd-bg-color: #f7f7f7; - + --bq-color: #ccc; --hr-color: #ccc; diff --git a/assets/css/main.css b/assets/css/main.css index 4298b41..da76a9c 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -179,7 +179,6 @@ kbd { line-height: 154%; border-radius: 6px; border: 1px solid var(--pre-border-color); - overflow: auto; } /* tag */ @@ -212,8 +211,68 @@ pre kbd kbd { margin-right: 0.2em; } -/* ```python``` like */ -pre code { +p code, +p kbd { + padding: 0.1em 0.3em; + /* top, bottom */ + /* margin-right: 4px; */ +} + +td pre { + border: none; + /* padding: 0px; */ + border-radius: 0px; +} + +td:first-child pre { + padding-right: 0; +} + +td:last-child pre { + padding-left: 0; +} + +td pre code { + /* when there is a line number grid */ + padding: 0px; + display: flex; + flex-direction: column; + border-radius: 0px; + /* padding-top: 4px; */ + /* padding-bottom: 4px; */ +} + +div.highlight { + border-radius: 6px; + border: 1px solid var(--pre-border-color); + margin-bottom: 14px; +} + +div.highlight pre { + border: none; + display: grid; + margin: 0px; + overflow: auto; /* Have to add this line, otherwise the "pre" and "code" will have different width */ + /* padding-left: 10px; */ + /* padding-right: 10px; */ + /* padding-top: 10px; */ + /* padding-bottom: 10px; */ +} + +div.highlight code { + padding-left: 0px; + padding-right: 0px; +} + +div.highlight code a:hover, +div.highlight code a:focus { + color: white; + border-bottom: 1px solid white; + /*for markup.highlight.anchorLineNos = true*/ +} + +pre code, +pre kbd { color: inherit; background-color: inherit; border: none; @@ -679,6 +738,8 @@ code.has-jax { .post-translations>li:not(:last-child)::after { content: "|"; display: inline-block; + margin-left: 4px; + margin-right: 4px; } .post-translations>li a { @@ -794,33 +855,30 @@ ul.footer-menu>li { /* Copy code */ .highlight { position: relative; - overflow: auto; -} - -.highlight pre { - padding-right: 75px; + overflow: hidden; } .highlight:hover .highlight-copy-btn { display: inline-block; - border: 1px solid rgba(255, 255, 255, 0.1); + border: 1px solid rgba(0, 0, 0, 0.5); } .highlight-copy-btn { display: none; position: absolute; - top: 18px; - right: 2px; - border: 0; + top: 0px; + right: 0px; + border: 1px solid rgba(0, 0, 0, 0.5); border-radius: 6px; padding: 1px; font-size: 0.7em; line-height: 1.8; color: #fff; background-color: rgba(255, 255, 255, 0.1); - min-width: 25px; + min-width: 22px; text-align: center; transition: border 0.3s; + transition: background-color 0.3s; } .highlight-copy-btn:hover { @@ -888,23 +946,4 @@ ul.footer-menu>li { .post-pagination .pagination-item { max-width: 10em; } -} - -{{ range site.Params.customCSS }} - {{ $custom := resources.Get . }} - - {{ $custom.Content }} -{{ end }} - -{{ if site.Params.isso.enabled }} - -#isso-thread .textarea { - color: #000; -} - -#isso-thread .isso-feedlink { - position: relative; - z-index: 1; -} - -{{ end }} +} \ No newline at end of file diff --git a/assets/images/link.svg b/assets/images/link.svg index 17830a4..28c8af8 100644 --- a/assets/images/link.svg +++ b/assets/images/link.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/assets/js/copy-code.js b/assets/js/copy-code.js index d23b0cf..64aec0c 100644 --- a/assets/js/copy-code.js +++ b/assets/js/copy-code.js @@ -61,4 +61,4 @@ document.addEventListener("DOMContentLoaded", function(event) { // Add copy button to code blocks let highlightBlocks = document.getElementsByClassName('highlight'); Array.prototype.forEach.call(highlightBlocks, addCopyButton); -}, false); \ No newline at end of file +}, false); diff --git a/assets/js/load-mermaid.js b/assets/js/load-mermaid.js index 75b1df5..0c5f143 100644 --- a/assets/js/load-mermaid.js +++ b/assets/js/load-mermaid.js @@ -7,7 +7,7 @@ (function(window){ 'use strict' - + const elementCode = '.mermaid' const loadMermaid = function(theme) { window.mermaid.initialize({theme}) @@ -26,7 +26,7 @@ } }); } catch (error) { - reject(error) + reject(error) } }) } @@ -46,11 +46,11 @@ } }); } catch (error) { - reject(error) + reject(error) } }) - } - + } + const init = ()=>{ saveOriginalData() .catch( console.error ) @@ -66,4 +66,4 @@ }) } window.initMermaid = init - })(window); \ No newline at end of file + })(window); diff --git a/data/social.yaml b/data/social.yaml index 4c8461b..65e0ba3 100644 --- a/data/social.yaml +++ b/data/social.yaml @@ -35,4 +35,4 @@ social_icons: tumblr: weibo: x: https://twitter.com/%s - zhihu: https://www.zhihu.com/people/%s \ No newline at end of file + zhihu: https://www.zhihu.com/people/%s diff --git a/exampleSiteMultilingual/.gitignore b/exampleSiteMultilingual/.gitignore index df410c6..21730f3 100644 --- a/exampleSiteMultilingual/.gitignore +++ b/exampleSiteMultilingual/.gitignore @@ -1,3 +1,3 @@ .hugo_build.lock public/ -resources/ \ No newline at end of file +resources/ diff --git a/exampleSiteMultilingual/.pre-commit-config.yaml b/exampleSiteMultilingual/.pre-commit-config.yaml new file mode 100644 index 0000000..3619705 --- /dev/null +++ b/exampleSiteMultilingual/.pre-commit-config.yaml @@ -0,0 +1,11 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: trailing-whitespace + # - id: end-of-file-fixer + - id: check-yaml + - id: check-toml + - id: check-added-large-files diff --git a/exampleSiteMultilingual/assets/custom-css/custom1.scss b/exampleSiteMultilingual/assets/custom-css/custom1.scss new file mode 100644 index 0000000..caa28e5 --- /dev/null +++ b/exampleSiteMultilingual/assets/custom-css/custom1.scss @@ -0,0 +1,9 @@ +@import 'foundation/vars'; + +junyi { + display: block; + font: 100% $font-stack; + color: $primary-color; + background-color: $background-color; + margin-top: 1em; +} diff --git a/exampleSiteMultilingual/assets/custom-css/custom2.css b/exampleSiteMultilingual/assets/custom-css/custom2.css new file mode 100644 index 0000000..3dbe013 --- /dev/null +++ b/exampleSiteMultilingual/assets/custom-css/custom2.css @@ -0,0 +1,7 @@ +.anubis-custom-style { + background-color: pink; + color: black; + padding: 1em; + border-radius: 0.3em; + border: 1px solid black; +} diff --git a/exampleSiteMultilingual/assets/custom-css/foundation/_vars.scss b/exampleSiteMultilingual/assets/custom-css/foundation/_vars.scss new file mode 100644 index 0000000..bd810d0 --- /dev/null +++ b/exampleSiteMultilingual/assets/custom-css/foundation/_vars.scss @@ -0,0 +1,3 @@ +$font-stack: Helvetica, sans-serif; +$primary-color: rgb(255, 255, 168); +$background-color: rgb(85, 85, 85); diff --git a/exampleSiteMultilingual/content/_index.md b/exampleSiteMultilingual/content/_index.md index 6abc75e..ed6494b 100644 --- a/exampleSiteMultilingual/content/_index.md +++ b/exampleSiteMultilingual/content/_index.md @@ -1,4 +1,3 @@ +++ author = "Hugo Authors" +++ - diff --git a/exampleSiteMultilingual/content/about-subpage.md b/exampleSiteMultilingual/content/about-subpage.md deleted file mode 100644 index 413f0ea..0000000 --- a/exampleSiteMultilingual/content/about-subpage.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "About Subpage" -description: "About Subpage" -date: "2019-02-28" -author: "Hugo Authors" -slug: /about/subpage -menu: - subpage: - identifier: about-subpage-s - parent: about - name: About Subpage - title: About Subpage - url: /about/subpage/ - weight: 1 - subpage2: - identifier: about-subpage2-s - parent: about - name: Second About Subpage - title: Second About Subpage - url: /about/subpage2/ - weight: 10 ---- - -About subpage diff --git a/exampleSiteMultilingual/content/about-subpage.pl.md b/exampleSiteMultilingual/content/about-subpage.pl.md deleted file mode 100644 index 413f0ea..0000000 --- a/exampleSiteMultilingual/content/about-subpage.pl.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "About Subpage" -description: "About Subpage" -date: "2019-02-28" -author: "Hugo Authors" -slug: /about/subpage -menu: - subpage: - identifier: about-subpage-s - parent: about - name: About Subpage - title: About Subpage - url: /about/subpage/ - weight: 1 - subpage2: - identifier: about-subpage2-s - parent: about - name: Second About Subpage - title: Second About Subpage - url: /about/subpage2/ - weight: 10 ---- - -About subpage diff --git a/exampleSiteMultilingual/content/about-subpage2.md b/exampleSiteMultilingual/content/about-subpage2.md deleted file mode 100644 index 372dced..0000000 --- a/exampleSiteMultilingual/content/about-subpage2.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "Second About Subpage" -description: "Second About Subpage" -date: "2019-02-28" -author: "Hugo Authors" -slug: /about/subpage2 -menu: - subpage: - identifier: about-subpage-s2 - parent: about - name: About Subpage - title: About Subpage - url: /about/subpage/ - weight: 1 - subpage2: - identifier: about-subpage2-s2 - parent: about - name: Second About Subpage - title: Second About Subpage - url: /about/subpage2/ - weight: 10 ---- - -Second About subpage diff --git a/exampleSiteMultilingual/content/about-subpage2.pl.md b/exampleSiteMultilingual/content/about-subpage2.pl.md deleted file mode 100644 index 372dced..0000000 --- a/exampleSiteMultilingual/content/about-subpage2.pl.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "Second About Subpage" -description: "Second About Subpage" -date: "2019-02-28" -author: "Hugo Authors" -slug: /about/subpage2 -menu: - subpage: - identifier: about-subpage-s2 - parent: about - name: About Subpage - title: About Subpage - url: /about/subpage/ - weight: 1 - subpage2: - identifier: about-subpage2-s2 - parent: about - name: Second About Subpage - title: Second About Subpage - url: /about/subpage2/ - weight: 10 ---- - -Second About subpage diff --git a/exampleSiteMultilingual/content/about.md b/exampleSiteMultilingual/content/about.md index 438c830..76b72b6 100644 --- a/exampleSiteMultilingual/content/about.md +++ b/exampleSiteMultilingual/content/about.md @@ -1,35 +1,22 @@ ---- -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" -menu: - subpage: - identifier: about-subpage - parent: about - name: About Subpage - title: About Subpage - url: /about/subpage/ - weight: 1 - subpage2: - identifier: about-subpage2 - parent: about - name: Second About Subpage - title: Second About Subpage - url: /about/subpage2/ - weight: 10 ---- ++++ +title = "About" +description = "Hugo, the world’s fastest framework for building websites" +date = "2024-04-09" +aliases = ["about-us", "about-hugo"] +author = ["Hugo Authors", "Junyi"] ++++ + +[Anubis2](https://github.com/Junyi-99/hugo-theme-anubis2) is another simple minimalist theme for Hugo blog engine. Written in Go, Hugo is an open source static site generator available under the [Apache License 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. Hugo makes use of a variety of open source projects including: -* https://github.com/yuin/goldmark -* https://github.com/alecthomas/chroma -* https://github.com/muesli/smartcrop -* https://github.com/spf13/cobra -* https://github.com/spf13/viper +* +* +* +* +* Hugo is ideal for blogs, corporate websites, creative portfolios, online magazines, single page applications or even a website with thousands of pages. @@ -38,6 +25,3 @@ Hugo is for people who want to hand code their own website without worrying abou Websites built with Hugo are extremely fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider. Learn more and contribute on [GitHub](https://github.com/gohugoio). - - - diff --git a/exampleSiteMultilingual/content/about.pl.md b/exampleSiteMultilingual/content/about.pl.md index 438c830..947d982 100644 --- a/exampleSiteMultilingual/content/about.pl.md +++ b/exampleSiteMultilingual/content/about.pl.md @@ -1,43 +1,29 @@ ---- -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" -menu: - subpage: - identifier: about-subpage - parent: about - name: About Subpage - title: About Subpage - url: /about/subpage/ - weight: 1 - subpage2: - identifier: about-subpage2 - parent: about - name: Second About Subpage - title: Second About Subpage - url: /about/subpage2/ - weight: 10 ---- ++++ +title = "About" +description = "Hugo, the world’s fastest framework for building websites" +date = "2024-04-09" +aliases = ["about-us", "about-hugo"] +author = ["Hugo Authors", "Junyi"] ++++ -Written in Go, Hugo is an open source static site generator available under the [Apache License 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. +[Anubis2](https://github.com/Junyi-99/hugo-theme-anubis2) to kolejny prosty, minimalistyczny motyw dla silnika blogowego Hugo. -Hugo makes use of a variety of open source projects including: +Napisany w języku Go, Hugo jest statycznym generatorem stron o otwartym kodzie źródłowym dostępnym na licencji [Apache License 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE). Hugo obsługuje typy plików danych TOML, YAML i JSON, pliki treści Markdown i HTML oraz wykorzystuje skróty do dodawania bogatej zawartości. Inne godne uwagi funkcje to taksonomie, tryb wielojęzyczny, przetwarzanie obrazów, niestandardowe formaty wyjściowe, minifikacja HTML/CSS/JS i obsługa przepływów pracy Sass SCSS. -* https://github.com/yuin/goldmark -* https://github.com/alecthomas/chroma -* https://github.com/muesli/smartcrop -* https://github.com/spf13/cobra -* https://github.com/spf13/viper +Hugo korzysta z różnych projektów open source, w tym: -Hugo is ideal for blogs, corporate websites, creative portfolios, online magazines, single page applications or even a website with thousands of pages. +* +* +* +* +* -Hugo is for people who want to hand code their own website without worrying about setting up complicated runtimes, dependencies and databases. +Hugo jest idealny dla blogów, stron korporacyjnych, kreatywnych portfolio, magazynów online, aplikacji jednostronicowych, a nawet witryn z tysiącami stron. -Websites built with Hugo are extremely fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider. - -Learn more and contribute on [GitHub](https://github.com/gohugoio). +Hugo jest przeznaczony dla osób, które chcą ręcznie zakodować własną stronę internetową, nie martwiąc się o konfigurowanie skomplikowanych środowisk uruchomieniowych, zależności i baz danych. +Strony internetowe zbudowane za pomocą Hugo są niezwykle szybkie, bezpieczne i mogą być wdrażane w dowolnym miejscu, w tym w AWS, GitHub Pages, Heroku, Netlify i u dowolnego innego dostawcy usług hostingowych. +Dowiedz się więcej i wnieś swój wkład na [GitHub](https://github.com/gohugoio). +Przetłumaczono z DeepL.com (wersja darmowa) diff --git a/exampleSiteMultilingual/content/about.zh.md b/exampleSiteMultilingual/content/about.zh.md index 438c830..c336fde 100644 --- a/exampleSiteMultilingual/content/about.zh.md +++ b/exampleSiteMultilingual/content/about.zh.md @@ -1,43 +1,27 @@ ---- -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" -menu: - subpage: - identifier: about-subpage - parent: about - name: About Subpage - title: About Subpage - url: /about/subpage/ - weight: 1 - subpage2: - identifier: about-subpage2 - parent: about - name: Second About Subpage - title: Second About Subpage - url: /about/subpage2/ - weight: 10 ---- ++++ +title = "About" +description = "Hugo, the world’s fastest framework for building websites" +date = "2024-04-09" +aliases = ["about-us", "about-hugo"] +author = ["Hugo Authors", "Junyi"] ++++ -Written in Go, Hugo is an open source static site generator available under the [Apache License 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. +[Anubis2](https://github.com/Junyi-99/hugo-theme-anubis2) 是另一个适用于 Hugo 博客引擎的简约主题。 -Hugo makes use of a variety of open source projects including: +Hugo 是用 Go 语言编写的,是一个开源的静态站点生成器,可在 Apache License 2.0 下获得。Hugo 支持 TOML、YAML 和 JSON 数据文件类型,Markdown 和 HTML 内容文件,并使用短代码添加丰富内容。其他显著特性包括分类法、多语言模式、图像处理、自定义输出格式、HTML/CSS/JS 压缩以及对 Sass SCSS 工作流的支持。 -* https://github.com/yuin/goldmark -* https://github.com/alecthomas/chroma -* https://github.com/muesli/smartcrop -* https://github.com/spf13/cobra -* https://github.com/spf13/viper +Hugo 利用了多个开源项目,包括: -Hugo is ideal for blogs, corporate websites, creative portfolios, online magazines, single page applications or even a website with thousands of pages. +* +* +* +* +* -Hugo is for people who want to hand code their own website without worrying about setting up complicated runtimes, dependencies and databases. - -Websites built with Hugo are extremely fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider. - -Learn more and contribute on [GitHub](https://github.com/gohugoio). +Hugo 非常适合博客、企业网站、创意作品集、在线杂志、单页应用程序,甚至是拥有数千页的网站。 +Hugo 适用于那些想要亲手编码自己网站的人,而不用担心设置复杂的运行时、依赖和数据库。 +使用 Hugo 构建的网站非常快速、安全,并且可以部署在任何地方,包括 AWS、GitHub Pages、Heroku、Netlify 和任何其他托管提供商。 +在 GitHub 上了解更多并贡献。 diff --git a/exampleSiteMultilingual/content/archives.md b/exampleSiteMultilingual/content/archives.md deleted file mode 100644 index 98a1ee9..0000000 --- a/exampleSiteMultilingual/content/archives.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -date: 2019-05-28 -type: section -layout: "archives" ---- \ No newline at end of file diff --git a/exampleSiteMultilingual/content/homepage/about.md b/exampleSiteMultilingual/content/homepage/about.md index c2ba680..7b4bc91 100644 --- a/exampleSiteMultilingual/content/homepage/about.md +++ b/exampleSiteMultilingual/content/homepage/about.md @@ -4,4 +4,4 @@ button: 'About us' weight: 2 --- -Lorem ipsum dolor sit amet, et essent mediocritatem quo, choro volumus oporteat an mei. ipsum dolor sit amet, et essent mediocritatem quo, \ No newline at end of file +Lorem ipsum dolor sit amet, et essent mediocritatem quo, choro volumus oporteat an mei. ipsum dolor sit amet, et essent mediocritatem quo, diff --git a/exampleSiteMultilingual/content/homepage/work.md b/exampleSiteMultilingual/content/homepage/work.md index f2fee73..f99bc99 100644 --- a/exampleSiteMultilingual/content/homepage/work.md +++ b/exampleSiteMultilingual/content/homepage/work.md @@ -4,4 +4,4 @@ button: 'Our Work' weight: 1 --- -Lorem ipsum dolor sit amet, et essent mediocritatem quo, choro volumus oporteat an mei. Numquam dolores mel eu, mea docendi omittantur et, mea ea duis erat. Elit melius cu ius. Per ex novum tantas putant, ei his nullam aliquam apeirian. Aeterno quaestio constituto sea an, no eum intellegat assueverit. \ No newline at end of file +Lorem ipsum dolor sit amet, et essent mediocritatem quo, choro volumus oporteat an mei. Numquam dolores mel eu, mea docendi omittantur et, mea ea duis erat. Elit melius cu ius. Per ex novum tantas putant, ei his nullam aliquam apeirian. Aeterno quaestio constituto sea an, no eum intellegat assueverit. diff --git a/exampleSiteMultilingual/content/post/markdown-syntax.pl.md b/exampleSiteMultilingual/content/post/markdown-syntax.pl.md deleted file mode 100644 index 49114db..0000000 --- a/exampleSiteMultilingual/content/post/markdown-syntax.pl.md +++ /dev/null @@ -1,146 +0,0 @@ -+++ -author = "Hugo Authors" -title = "Markdown Syntax Guide" -date = "2019-03-11" -description = "Sample article showcasing basic Markdown syntax and formatting for HTML elements." -tags = [ - "markdown", - "css", - "html", - "themes", -] -categories = [ - "themes", - "syntax", -] -aliases = ["migrate-from-jekyl"] -favorite = true -+++ - -This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme. - - -## Headings - -The following HTML `

`—`

` elements represent six levels of section headings. `

` is the highest section level while `

` is the lowest. - -# H1 -## H2 -### H3 -#### H4 -##### H5 -###### H6 - -## Paragraph - -Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat. - -Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat. - -## Blockquotes - -The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations. - -#### Blockquote without attribution - -> Tiam, ad mint andaepu dandae nostion secatur sequo quae. -> **Note** that you can use *Markdown syntax* within a blockquote. - -#### Blockquote with attribution - -> Don't communicate by sharing memory, share memory by communicating.

-> — Rob Pike[^1] - - -[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. - -## Tables - -Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box. - - Name | Age ---------|------ - Bob | 27 - Alice | 23 - -#### Inline Markdown within tables - -| Inline    | Markdown    | In    | Table | -| ---------- | --------- | ----------------- | ---------- | -| *italics* | **bold** | ~~strikethrough~~    | `code` | - -## Code Blocks - -#### Code block with backticks - -```html - - - - - Example HTML5 Document - - -

Test

- - -``` -#### Code block indented with four spaces - - - - - - Example HTML5 Document - - -

Test

- - - -#### Code block with Hugo's internal highlight shortcode -{{< highlight html >}} - - - - - Example HTML5 Document - - -

Test

- - -{{< /highlight >}} - -## List Types - -#### Ordered List - -1. First item -2. Second item -3. Third item - -#### Unordered List - -* List item -* Another item -* And another item - -#### Nested list - -* Item -1. First Sub-item -2. Second Sub-item - -## Other Elements — abbr, sub, sup, kbd, mark - -GIF is a bitmap image format. - -H2O - -Xn + Yn = Zn - -Press CTRL+ALT+Delete to end the session. - -Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. - diff --git a/exampleSiteMultilingual/content/post/math-typesetting.pl.md b/exampleSiteMultilingual/content/post/math-typesetting.pl.md deleted file mode 100644 index a1467e3..0000000 --- a/exampleSiteMultilingual/content/post/math-typesetting.pl.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -author: Hugo Authors -title: Math Typesetting -date: 2019-03-08 -description: A brief guide to setup KaTeX -math: true ---- - -Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries. - - -In this example we will be using [KaTeX](https://katex.org/) - -- Create a partial under `/layouts/partials/math.html` -- Within this partial reference the [Auto-render Extension](https://katex.org/docs/autorender.html) or host these scripts locally. -- Include the partial in your templates like so: - -``` -{{ if or .Params.math .Site.Params.math }} -{{ partial "math.html" . }} -{{ end }} -``` -- To enable KaTex globally set the parameter `math` to `true` in a project's configuration -- To enable KaTex on a per page basis include the parameter `math: true` in content files. - -**Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html) -{{< math.inline >}} -{{ if or .Page.Params.math .Site.Params.math }} - - - - -{{ end }} -{{}} - -### Examples - -Inline math: $$ \varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887… $$ - -Block math: - -$$ - \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } -$$ - diff --git a/exampleSiteMultilingual/content/post/placeholder-text.pl.md b/exampleSiteMultilingual/content/post/placeholder-text.pl.md deleted file mode 100644 index 29ff09f..0000000 --- a/exampleSiteMultilingual/content/post/placeholder-text.pl.md +++ /dev/null @@ -1,58 +0,0 @@ -+++ -author = "Hugo Authors" -title = "Placeholder Text" -date = "2019-03-09" -description = "Lorem Ipsum Dolor Si Amet" -tags = [ - "markdown", - "text", -] -+++ - -Lorem est tota propiore conpellat pectoribus de -pectora summo. Redit teque digerit hominumque toris verebor lumina non cervice -subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc -caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis -lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum. - -1. Exierant elisi ambit vivere dedere -2. Duce pollice -3. Eris modo -4. Spargitque ferrea quos palude - -Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus -silentia flumen, sustinet placuit petis in dilapsa erat sunt. Atria -tractus malis. - -1. Comas hunc haec pietate fetum procerum dixit -2. Post torum vates letum Tiresia -3. Flumen querellas -4. Arcanaque montibus omnes -5. Quidem et - -# Vagus elidunt - - - -[The Van de Graaf Canon](https://en.wikipedia.org/wiki/Canons_of_page_construction#Van_de_Graaf_canon) - -## Mane refeci capiebant unda mulcebat - -Victa caducifer, malo vulnere contra -dicere aurato, ludit regale, voca! Retorsit colit est profanae esse virescere -furit nec; iaculi matertera et visa est, viribus. Divesque creatis, tecta novat collumque vulnus est, parvas. **Faces illo pepulere** tempus adest. Tendit flamma, ab opes virum sustinet, sidus sequendo urbis. - -Iubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli -Lelegas tu lux. Verbis obstitit intus oblectamina fixis linguisque ausus sperare -Echionides cornuaque tenent clausit possit. Omnia putatur. Praeteritae refert -ausus; ferebant e primus lora nutat, vici quae mea ipse. Et iter nil spectatae -vulnus haerentia iuste et exercebat, sui et. - -Eurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel **mitis temploque** vocatus, inque alis, *oculos nomen* non silvis corpore coniunx ne displicet illa. Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem -Propoetides **parte**. - -{{< css.inline >}} - -{{< /css.inline >}} diff --git a/exampleSiteMultilingual/content/post/rich-content.pl.md b/exampleSiteMultilingual/content/post/rich-content.pl.md deleted file mode 100644 index 71a36e1..0000000 --- a/exampleSiteMultilingual/content/post/rich-content.pl.md +++ /dev/null @@ -1,34 +0,0 @@ -+++ -author = "Hugo Authors" -title = "Rich Content" -date = "2019-03-10" -description = "A brief description of Hugo Shortcodes" -tags = [ - "shortcodes", - "privacy", -] -+++ - -Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-management/shortcodes/#use-hugo-s-built-in-shortcodes) for rich content, along with a [Privacy Config](https://gohugo.io/about/hugo-and-gdpr/) and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds. - ---- - -## YouTube Privacy Enhanced Shortcode - -{{< youtube ZJthWmvUzzc >}} - -
- ---- - -## Twitter Simple Shortcode - -{{< tweet user="DesignReviewed" id="1085870671291310081" >}} - -
- ---- - -## Vimeo Simple Shortcode - -{{< vimeo_simple 48912912 >}} diff --git a/exampleSiteMultilingual/content/post/_index.md b/exampleSiteMultilingual/content/posts/_index.md similarity index 100% rename from exampleSiteMultilingual/content/post/_index.md rename to exampleSiteMultilingual/content/posts/_index.md diff --git a/exampleSiteMultilingual/content/post/_index.pl.md b/exampleSiteMultilingual/content/posts/_index.pl.md similarity index 100% rename from exampleSiteMultilingual/content/post/_index.pl.md rename to exampleSiteMultilingual/content/posts/_index.pl.md diff --git a/exampleSiteMultilingual/content/posts/advanced copy.md b/exampleSiteMultilingual/content/posts/advanced copy.md deleted file mode 100644 index 5e7db92..0000000 --- a/exampleSiteMultilingual/content/posts/advanced copy.md +++ /dev/null @@ -1,58 +0,0 @@ -+++ -author = "Hugo Authors" -title = "Usage of code, pre, kbd" -date = "2024-04-09" -description = "Guide to advanced usage of Anubis2" -tags = [ - "emoji", -] -+++ - - -## \ - -Direct Code - -`A verrrrrryyyyy llloooonnnggg coooodeeee` - -`code` `is` `here` - -```plain -multiline -code -here -``` - -```typescript -interface User { - id: number - firstName: string - lastName: string - role: string -} - -function updateUser(id: number, update: Partial) { - const user = getUser(id) - const newUser = { ...user, ...update } - saveUser(id, newUser) -} -``` - -## \ - -
pre text
-
pre text
-
pre text
- -## \ - - -

Press CTRL + C to copy text (Windows).

- -

Press CMD + C to copy text (Mac OS).

- -Press CTRL+ALT+Delete to end the session. - -Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. - -
Press CTRL+ALT+Delete to end the session.
\ No newline at end of file diff --git a/exampleSiteMultilingual/content/posts/advancedstyle/index.md b/exampleSiteMultilingual/content/posts/advancedstyle/index.md new file mode 100644 index 0000000..40e522a --- /dev/null +++ b/exampleSiteMultilingual/content/posts/advancedstyle/index.md @@ -0,0 +1,66 @@ ++++ +author = "Hugo Authors" +title = "Advanced Style" +date = "2024-04-09" +description = "Guide to advanced usage of Anubis2" +tags = [ + "emoji", +] ++++ + +There are examples of how to use custom `global-wise style` or `page-wise style`. + + + +
+The custom .css .scss .sass file should be placed in assets/ folder. (instead of static/) +
+ + +This page is affected by assets/css/custom1.scss and assets/css/custom2.css and advanced-style/style.css + + +advanced-style/style.css affects only the current page. + +```html + +``` + + + +assets/css/custom1.scss and assets/css/custom2.scss will have global effect. + +```scss +// assets/css/custom2.css +.anubis-custom-style { + background-color: pink; + color: black; + padding: 1em; + border-radius: 0.3em; + border: 1px solid black; +} +``` + +```scss +// assets/css/foundation/_vars.scss +$font-stack: Helvetica, sans-serif; +$primary-color: rgb(255, 255, 168); +$background-color: rgb(85, 85, 85); +``` + +```scss +// assets/css/custom1.scss +@import 'foundation/vars'; + +junyi { + display: block; + font: 100% $font-stack; + color: $primary-color; + background-color: $background-color; + margin-top: 1em; +} +``` \ No newline at end of file diff --git a/exampleSiteMultilingual/content/posts/advancedstyle/style.css b/exampleSiteMultilingual/content/posts/advancedstyle/style.css new file mode 100644 index 0000000..6937f22 --- /dev/null +++ b/exampleSiteMultilingual/content/posts/advancedstyle/style.css @@ -0,0 +1,8 @@ +@import 'subfolder/hello.scss'; + +.container { + max-width: none; + padding-left: 5em; + padding-right: 5em; + background-color: white; +} \ No newline at end of file diff --git a/exampleSiteMultilingual/content/posts/demo-code-pre-kbd-mark.md b/exampleSiteMultilingual/content/posts/demo-code-pre-kbd-mark.md new file mode 100644 index 0000000..7e024a4 --- /dev/null +++ b/exampleSiteMultilingual/content/posts/demo-code-pre-kbd-mark.md @@ -0,0 +1,120 @@ ++++ +author = "Hugo Authors" +title = "Demo - Support for code, pre, kbd, mark" +date = "2024-04-22" +description = "Guide to advanced usage of Anubis2" +tags = [ + "emoji", +] ++++ + +## Individual support for code, pre, kbd, mark + +`code`
pre
+ +CRTL + K + B + D + + + +Feel free to switch between the light and dark themes to see the rendering differences. + +### Support for \ tag + +Direct Code + +`A verrrrrryyyyy llloooonnnggg coooodeeee` + +`code` `is` `here` + +```plain +multiline +code +here +``` + +```typescript +// ```typescript +interface User { + id: number + firstName: string + lastName: string + role: string +} +``` + +```typescript {linenos=inline} +// ```typescript {linenos=inline} +function updateUser(id: number, update: Partial) { + const user = getUser(id) + const newUser = { ...user, ...update } + saveUser(id, newUser) +} +``` + +```typescript {linenos=true} +// ```typescript {linenos=true} +function updateUser(id: number, update: Partial) { + const user = getUser(id) + const newUser = { ...user, ...update } + saveUser(id, newUser) +} +``` + +### Support for \ tag + +
pre text
+
pre text
+
pre text
+ +### Support for \ tag + + +

Press CTRL + C to copy text (Windows).

+ +

Press CMD + C to copy text (Mac OS).

+ +Press CTRL+ALT+Delete to end the session. + + +### Support for \ tag + +Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. +Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. + +Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. + +### Support for \ in \ + +
This is a KBD inside a pre. 
+ +### Support for \ in \ (❌ Should not be used) + +This is a KBD inside a code. + +### Support for \ in \ (❌ Should not be used) + +
This is a CODE inside a pre. 
+ +### Support for \ in \ (❌ Should not be used) + +This is a CODE inside a kbd. + +### Support for \ in \ (❌ Should not be used) + +This is a
PRE
inside a kbd.
+ +### Support for \ in \ (❌ Should not be used) + +This is a
PRE
inside a code.
+ +### Support for \ in \ + +This is a MARK inside a kbd. + +### Support for \ in \ + +This is a MARK inside a code. + +### Support for \ in \ + +
This is a MARK inside a pre. 
\ No newline at end of file diff --git a/exampleSiteMultilingual/content/posts/advanced.md b/exampleSiteMultilingual/content/posts/demo-diagram.md similarity index 89% rename from exampleSiteMultilingual/content/posts/advanced.md rename to exampleSiteMultilingual/content/posts/demo-diagram.md index 1c8f723..47d9852 100644 --- a/exampleSiteMultilingual/content/posts/advanced.md +++ b/exampleSiteMultilingual/content/posts/demo-diagram.md @@ -1,29 +1,33 @@ +++ author = "Hugo Authors" -title = "Advanced Diagram Usage" -date = "2024-04-09" +title = "Demo - Support for Diagrams" +date = "2024-04-19" description = "Guide to advanced usage of Anubis2" tags = [ "emoji", ] +++ - -## GoAT - -```goat - . . . .--- 1 .-- 1 / 1 - / \ | | .---+ .-+ + - / \ .---+---. .--+--. | '--- 2 | '-- 2 / \ 2 - + + | | | | ---+ ---+ + - / \ / \ .-+-. .-+-. .+. .+. | .--- 3 | .-- 3 \ / 3 - / \ / \ | | | | | | | | '---+ '-+ + - 1 2 3 4 1 2 3 4 1 2 3 4 '--- 4 '-- 4 \ 4 -``` +Feel free to switch between the light and dark themes to see how the diagram adapts its colors accordingly. ## Mermaid Diagrams -Get more examples at [here](https://mermaid.js.org/intro/) +```mermaid +gantt + title A Gantt Diagram + dateFormat YYYY-MM-DD + section Section + A task :a1, 2014-01-01, 30d + Another task :after a1, 20d + section Another + Task in Another :2014-01-12, 12d + another task :24d + +``` + +Get more examples at [About Mermaid](https://mermaid.js.org/intro/) + + ```mermaid gitGraph: @@ -41,18 +45,7 @@ gitGraph: commit ``` -```mermaid -gantt - title A Gantt Diagram - dateFormat YYYY-MM-DD - section Section - A task :a1, 2014-01-01, 30d - Another task :after a1, 20d - section Another - Task in Another :2014-01-12, 12d - another task :24d -``` ```mermaid stateDiagram @@ -103,3 +96,15 @@ sequenceDiagram John->>Bob: How about you? Bob-->>John: Jolly good! ``` + +## GoAT + +```goat + . . . .--- 1 .-- 1 / 1 + / \ | | .---+ .-+ + + / \ .---+---. .--+--. | '--- 2 | '-- 2 / \ 2 + + + | | | | ---+ ---+ + + / \ / \ .-+-. .-+-. .+. .+. | .--- 3 | .-- 3 \ / 3 + / \ / \ | | | | | | | | '---+ '-+ + + 1 2 3 4 1 2 3 4 1 2 3 4 '--- 4 '-- 4 \ 4 +``` diff --git a/exampleSiteMultilingual/content/posts/demo-multiline-codes.md b/exampleSiteMultilingual/content/posts/demo-multiline-codes.md new file mode 100644 index 0000000..e3df562 --- /dev/null +++ b/exampleSiteMultilingual/content/posts/demo-multiline-codes.md @@ -0,0 +1,178 @@ ++++ +author = "Junyi" +title = "Demo - Multiline Codes" +date = "2024-04-23" +description = "Codes, Codefences, and Syntax Highlighting." +tags = [ + "icons", + "anubis2", + "hugo" +] ++++ + +There are 9 tests. + + + +## Line Numbers, Highlight Lines + +### Line Number (table) and Highlight Lines + +`linenos=table` will give copy-and-paste friendly code blocks. + + ```c {linenos=table, hl_lines=[1,"3-4",8], linenostart=199} + // codes ... + ``` + +```c {linenos=table, hl_lines=[1,"3-4",8], linenostart=199} +int main() { + int a = 1; + if (a == 999) + // This is a very long comment to test the `overflow` attribute defined in CSS. The `overflow` property in CSS deals with the content when it overflows the block-level container. It can take the following values: `visible` (default), `hidden`, `scroll`, `auto`, and `clip`. + // If `visible` is specified, the content is not clipped and can render outside the container. If `hidden` is specified, the content is clipped and the rest of the content will be invisible. If `scroll` is specified, the browser should provide a scrolling mechanism for the user to access the clipped content. + } + return 0; +} +``` + +### Line Number (true) and Highlight Lines + + ```c {linenos=true, hl_lines=[1,"3-4",8], linenostart=1} + // codes ... + ``` + +```c {linenos=true, hl_lines=[1,"3-4",8], linenostart=1} +int main() { + int a = 1; + if (a == 999) + // This is a very long comment to test the `overflow` attribute defined in CSS. The `overflow` property in CSS deals with the content when it overflows the block-level container. It can take the following values: `visible` (default), `hidden`, `scroll`, `auto`, and `clip`. + // If `visible` is specified, the content is not clipped and can render outside the container. If `hidden` is specified, the content is clipped and the rest of the content will be invisible. If `scroll` is specified, the browser should provide a scrolling mechanism for the user to access the clipped content. + } + return 0; +} +``` + +### Line Number (inline) and Highlight Lines + + ```c {linenos=inline, hl_lines=[1,"3-4",8], linenostart=1} + // codes ... + ``` + +```c {linenos=inline, hl_lines=[1,"3-4",8], linenostart=1} +int main() { + int a = 1; + if (a == 999) + // This is a very long comment to test the `overflow` attribute defined in CSS. The `overflow` property in CSS deals with the content when it overflows the block-level container. It can take the following values: `visible` (default), `hidden`, `scroll`, `auto`, and `clip`. + // If `visible` is specified, the content is not clipped and can render outside the container. If `hidden` is specified, the content is clipped and the rest of the content will be invisible. If `scroll` is specified, the browser should provide a scrolling mechanism for the user to access the clipped content. + } + return 0; +} +``` + +### Line Number (false) and Highlight Lines + +`linenos=false` will turn off line numbers if it’s configured to be on in site configuration. + + ```c {linenos=false, hl_lines=[1,"3-4",8]} + // codes ... + ``` + +```c {linenos=false, hl_lines=[1,"3-4",8]} +int main() { + int a = 1; + if (a == 999) + // This is a very long comment to test the `overflow` attribute defined in CSS. The `overflow` property in CSS deals with the content when it overflows the block-level container. It can take the following values: `visible` (default), `hidden`, `scroll`, `auto`, and `clip`. + // If `visible` is specified, the content is not clipped and can render outside the container. If `hidden` is specified, the content is clipped and the rest of the content will be invisible. If `scroll` is specified, the browser should provide a scrolling mechanism for the user to access the clipped content. + } + return 0; +} +``` + +## Anchor, Inline, Shortcode + +### Line Number (table) and Highlight Lines and Anchor + +Now you can click on the line number to get a link to that line. + + ```c {linenos=table, hl_lines=[1,"3-4",8], linenostart=199, anchorlinenos=true} + // codes ... + ``` + +```c {linenos=table, hl_lines=[1,"3-4",8], linenostart=199, anchorlinenos=true} +int main() { + int a = 1; + if (a == 999) + // This is a very long comment to test the `overflow` attribute defined in CSS. The `overflow` property in CSS deals with the content when it overflows the block-level container. It can take the following values: `visible` (default), `hidden`, `scroll`, `auto`, and `clip`. + // If `visible` is specified, the content is not clipped and can render outside the container. If `hidden` is specified, the content is clipped and the rest of the content will be invisible. If `scroll` is specified, the browser should provide a scrolling mechanism for the user to access the clipped content. + } + return 0; +} +``` + +### Line Number (table) and Highlight Inline (❌ Not supported by Anubis2) + + ```c {linenos=true,hl_lines=[1,"3-4",8], hl_inline=true} + // codes ... + ``` + +```c {linenos=true,hl_lines=[1,"3-4",8], hl_inline=true} +int main() { + int a = 1; + if (a == 999) + // This is a very long comment to test the `overflow` attribute defined in CSS. The `overflow` property in CSS deals with the content when it overflows the block-level container. It can take the following values: `visible` (default), `hidden`, `scroll`, `auto`, and `clip`. + // If `visible` is specified, the content is not clipped and can render outside the container. If `hidden` is specified, the content is clipped and the rest of the content will be invisible. If `scroll` is specified, the browser should provide a scrolling mechanism for the user to access the clipped content. + } + return 0; +} +``` + +### Highlight shortcode, with Line Number (table), with Highlight Lines and Anchor + + {{}} + // codes + {{}} + +{{< highlight c "linenos=table,hl_lines=1 3-4 8, anchorlinenos=true" >}} +int main() { +int a = 1; +if (a == 999) +// This is a very long comment to test the `overflow` attribute defined in CSS. The `overflow` property in CSS deals with the content when it overflows the block-level container. It can take the following values: `visible` (default), `hidden`, `scroll`, `auto`, and `clip`. +// If `visible` is specified, the content is not clipped and can render outside the container. If `hidden` is specified, the content is clipped and the rest of the content will be invisible. If `scroll` is specified, the browser should provide a scrolling mechanism for the user to access the clipped content. +} +return 0; +} +{{< / highlight >}} + +### Highlight shortcode, with Line Number (inline), with Highlight Lines and Anchor + + {{}} + // codes + {{}} + +{{< highlight c "linenos=inline,hl_lines=1 3-4 8, anchorlinenos=true" >}} +int main() { +int a = 1; +if (a == 999) +// This is a very long comment to test the `overflow` attribute defined in CSS. The `overflow` property in CSS deals with the content when it overflows the block-level container. It can take the following values: `visible` (default), `hidden`, `scroll`, `auto`, and `clip`. +// If `visible` is specified, the content is not clipped and can render outside the container. If `hidden` is specified, the content is clipped and the rest of the content will be invisible. If `scroll` is specified, the browser should provide a scrolling mechanism for the user to access the clipped content. +} +return 0; +} +{{< / highlight >}} + +### Highlight shortcode, No Line Number, With Highlight Lines and Anchor + + {{}} + // codes + {{}} + +{{< highlight c "linenos=false,hl_lines=1 3-4 8, anchorlinenos=true" >}} +int main() { +int a = 1; +if (a == 999) +// This is a very long comment to test the `overflow` attribute defined in CSS. The `overflow` property in CSS deals with the content when it overflows the block-level container. It can take the following values: `visible` (default), `hidden`, `scroll`, `auto`, and `clip`. +// If `visible` is specified, the content is not clipped and can render outside the container. If `hidden` is specified, the content is clipped and the rest of the content will be invisible. If `scroll` is specified, the browser should provide a scrolling mechanism for the user to access the clipped content. +} +return 0; +} +{{< / highlight >}} diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-1.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-1.md new file mode 100644 index 0000000..7670383 --- /dev/null +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-1.md @@ -0,0 +1,23 @@ +--- +title: "Demo - Summary Rendering Test 1 (😃 Easy)" +date: 2024-04-25T1:54:12+08:00 +draft: true +tags: [Hugo] +--- + +This is a summary rendering test. + +## Test Heading + + +`` is applied here. + +## Test Heading Again + +The content below should be hidden in the summary view. + + + +```html +Will cause a rendering issue? +``` diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-2.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-2.md new file mode 100644 index 0000000..6d051f4 --- /dev/null +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-2.md @@ -0,0 +1,20 @@ +--- +title: "Demo - Summary Rendering Test 2 (😏 Easy)" +date: 2024-04-25T1:54:13+08:00 +draft: true +tags: [Hugo] +--- + + + +You should not see this line in preview + +## Test Heading + +The content below should also be hidden in the summary view. + + + +```html +Will cause a rendering issue? +``` diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-3.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-3.md new file mode 100644 index 0000000..8b0b1e9 --- /dev/null +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-3.md @@ -0,0 +1,26 @@ +--- +title: "Demo - Summary Rendering Test 3 (🤔 Easy)" +date: 2024-04-25T1:54:14+08:00 +draft: true +tags: [Hugo] +--- + +```c +int main() { + return 0; // Only see this in the summary view +} +``` + + + +You MUST NOT see me in the preview + +## Test Heading + +The content below should also be hidden in the summary view. + + + +```html +Will cause a rendering issue? +``` diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-4.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-4.md new file mode 100644 index 0000000..1400d39 --- /dev/null +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-4.md @@ -0,0 +1,24 @@ +--- +title: "Demo - Summary Rendering Test 4 (😅 Easy?)" +date: 2024-04-25T1:54:15+08:00 +draft: true +tags: [Hugo] +--- + +## Hi, can you see "aaa" in the summary? + +aaa + + + +You MUST NOT see me in the preview + +## Test Heading + +The content below should also be hidden in the summary view. + + + +```html +Will cause a rendering issue? +``` diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-5.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-5.md new file mode 100644 index 0000000..7b9673f --- /dev/null +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-5.md @@ -0,0 +1,26 @@ +--- +title: "Demo - Summary Rendering Test 5 (😥 Medium)" +date: 2024-04-25T1:54:16+08:00 +draft: true +tags: [Hugo] +--- + +```c +int main() { + return 0; // Only see this in the summary view +} +``` + + + +You MUST NOT see me in the preview + +## Test Heading + +The content below should also be hidden in the summary view. + + + +```html +Will cause a rendering issue? +``` diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-6.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-6.md new file mode 100644 index 0000000..1ad288c --- /dev/null +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-6.md @@ -0,0 +1,28 @@ +--- +title: "Demo - Summary Rendering Test 6 (🤯 Hard)" +date: 2024-04-25T1:54:17+08:00 +draft: true +tags: [Hugo] +--- + +```c {linenos=inline} +int main() { + // Is your theme able to handle this? + // Are the content below rendered correctly? + return 0; // Only see this in the summary view +} +``` + + + +You MUST NOT see me in the preview + +## Test Heading + +The content below should also be hidden in the summary view. + + + +```html +Will cause a rendering issue? +``` diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-7.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-7.md new file mode 100644 index 0000000..add4a4d --- /dev/null +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-7.md @@ -0,0 +1,28 @@ +--- +title: "Demo - Summary Rendering Test 7 (😱 Bad Dream)" +date: 2024-04-25T1:54:18+08:00 +draft: true +tags: [Hugo] +--- + +```c {linenos=table} +int main() { + // Is your theme able to handle this? + // Are the content below rendered correctly? + return 0; // Only see this in the summary view +} +``` + + + +You MUST NOT see me in the preview + +## Test Heading + +The content below should also be hidden in the summary view. + + + +```html +Will cause a rendering issue? +``` diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-8.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-8.md new file mode 100644 index 0000000..27c02f7 --- /dev/null +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-8.md @@ -0,0 +1,28 @@ +--- +title: "Demo - Summary Rendering Test 8 (💀 Nightmare)" +date: 2024-04-25T1:54:19+08:00 +draft: true +tags: [Hugo] +--- + +```c {linenos=table} +int main() { + // Is your theme able to handle this? + // Are the content below rendered correctly? + return 0; // Only see this in the summary view +} +``` + + + +You MUST NOT see me in the preview + +## Test Heading + +The content below should also be hidden in the summary view. + + + +```html +Will cause a rendering issue? +``` diff --git a/exampleSiteMultilingual/content/post/emoji-support.md b/exampleSiteMultilingual/content/posts/emoji-support.md similarity index 91% rename from exampleSiteMultilingual/content/post/emoji-support.md rename to exampleSiteMultilingual/content/posts/emoji-support.md index ecf6c86..119346a 100644 --- a/exampleSiteMultilingual/content/post/emoji-support.md +++ b/exampleSiteMultilingual/content/posts/emoji-support.md @@ -8,9 +8,9 @@ tags = [ ] +++ -Emoji can be enabled in a Hugo project in a number of ways. +Emoji can be enabled in a Hugo project in a number of ways. -The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes). +The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes). To enable emoji globally, set `enableEmoji` to `true` in your site’s [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g. @@ -44,4 +44,4 @@ font-family: Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,And } } -{{< /css.inline >}} \ No newline at end of file +{{< /css.inline >}} diff --git a/exampleSiteMultilingual/content/post/emoji-support.pl.md b/exampleSiteMultilingual/content/posts/emoji-support.zh.md similarity index 79% rename from exampleSiteMultilingual/content/post/emoji-support.pl.md rename to exampleSiteMultilingual/content/posts/emoji-support.zh.md index ecf6c86..5c11cf4 100644 --- a/exampleSiteMultilingual/content/post/emoji-support.pl.md +++ b/exampleSiteMultilingual/content/posts/emoji-support.zh.md @@ -1,6 +1,6 @@ +++ author = "Hugo Authors" -title = "Emoji Support" +title = "Emoji 支持" date = "2019-03-05" description = "Guide to emoji usage in Hugo" tags = [ @@ -8,13 +8,14 @@ tags = [ ] +++ -Emoji can be enabled in a Hugo project in a number of ways. +在 Hugo 博客里,你可以用多种方式使用 Emoji: + -The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes). + +The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes). To enable emoji globally, set `enableEmoji` to `true` in your site’s [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g. -

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


@@ -33,15 +34,15 @@ font-family: Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,And {{< css.inline >}} -{{< /css.inline >}} \ No newline at end of file +{{< /css.inline >}} diff --git a/exampleSiteMultilingual/content/post/hidden-post.md b/exampleSiteMultilingual/content/posts/hidden-post.md similarity index 88% rename from exampleSiteMultilingual/content/post/hidden-post.md rename to exampleSiteMultilingual/content/posts/hidden-post.md index 96b33ed..7556132 100644 --- a/exampleSiteMultilingual/content/post/hidden-post.md +++ b/exampleSiteMultilingual/content/posts/hidden-post.md @@ -9,4 +9,4 @@ tags = [ hidden = true +++ -This is hidden post \ No newline at end of file +This is hidden post diff --git a/exampleSiteMultilingual/content/post/hidden-post.pl.md b/exampleSiteMultilingual/content/posts/hidden-post.pl.md similarity index 88% rename from exampleSiteMultilingual/content/post/hidden-post.pl.md rename to exampleSiteMultilingual/content/posts/hidden-post.pl.md index 96b33ed..7556132 100644 --- a/exampleSiteMultilingual/content/post/hidden-post.pl.md +++ b/exampleSiteMultilingual/content/posts/hidden-post.pl.md @@ -9,4 +9,4 @@ tags = [ hidden = true +++ -This is hidden post \ No newline at end of file +This is hidden post diff --git a/exampleSiteMultilingual/content/posts/icons.md b/exampleSiteMultilingual/content/posts/icons.md new file mode 100644 index 0000000..0f85c12 --- /dev/null +++ b/exampleSiteMultilingual/content/posts/icons.md @@ -0,0 +1,58 @@ ++++ +author = "Junyi" +title = "Demo - Social Icons" +date = "2024-04-23" +description = "Guide to using social icons supported by Anubis2." +tags = [ + "icons", + "anubis2", + "hugo" +] ++++ + +To use an icon, simply copy its shortcode and paste it into your content where you want the icon to appear. The shortcode must be enclosed in `{{}}`. + + + +Here is a list of available icons, their shortcodes, and what they look like when rendered: + + +| name | shortcode | icon | +| ---------- | ---------------------------------- | ---------------------------- | +| 4chan | `{{}}` | {{< icon "4chan" >}} | +| leetcode | `{{}}` | {{< icon "leetcode" >}} | +| qq | `{{}}` | {{< icon "qq" >}} | +| spotify | `{{}}` | {{< icon "spotify" >}} | +| tinder | `{{}}` | {{< icon "tinder" >}} | +| youtube | `{{}}` | {{< icon "youtube" >}} | +| docs | `{{}}` | {{< icon "docs" >}} | +| linkedin | `{{}}` | {{< icon "linkedin" >}} | +| reddit | `{{}}` | {{< icon "reddit" >}} | +| steam | `{{}}` | {{< icon "steam" >}} | +| tumblr | `{{}}` | {{< icon "tumblr" >}} | +| zhihu | `{{}}` | {{< icon "zhihu" >}} | +| email | `{{}}` | {{< icon "email" >}} | +| mastodon | `{{}}` | {{< icon "mastodon" >}} | +| rss | `{{}}` | {{< icon "rss" >}} | +| teams | `{{}}` | {{< icon "teams" >}} | +| twitch | `{{}}` | {{< icon "twitch" >}} | +| facebook | `{{}}` | {{< icon "facebook" >}} | +| medium | `{{}}` | {{< icon "medium" >}} | +| skype | `{{}}` | {{< icon "skype" >}} | +| telegram | `{{}}` | {{< icon "telegram" >}} | +| twitter | `{{}}` | {{< icon "twitter" >}} | +| github | `{{}}` | {{< icon "github" >}} | +| netease | `{{}}` | {{< icon "netease-music" >}} | +| slack | `{{}}` | {{< icon "slack" >}} | +| theme | `{{}}` | {{< icon "theme-dark" >}} | +| vk | `{{}}` | {{< icon "vk" >}} | +| gitlab | `{{}}` | {{< icon "gitlab" >}} | +| notion | `{{}}` | {{< icon "notion" >}} | +| snapchat | `{{}}` | {{< icon "snapchat" >}} | +| theme | `{{}}` | {{< icon "theme-light" >}} | +| weibo | `{{}}` | {{< icon "weibo" >}} | +| instagram | `{{}}` | {{< icon "instagram" >}} | +| patreon | `{{}}` | {{< icon "patreon" >}} | +| soundcloud | `{{}}` | {{< icon "soundcloud" >}} | +| tiktok | `{{}}` | {{< icon "tiktok" >}} | +| x | `{{}}` | {{< icon "x" >}} | \ No newline at end of file diff --git a/exampleSiteMultilingual/content/post/markdown-syntax.md b/exampleSiteMultilingual/content/posts/markdown-syntax.md similarity index 84% rename from exampleSiteMultilingual/content/post/markdown-syntax.md rename to exampleSiteMultilingual/content/posts/markdown-syntax.md index 534b67b..9524293 100644 --- a/exampleSiteMultilingual/content/post/markdown-syntax.md +++ b/exampleSiteMultilingual/content/posts/markdown-syntax.md @@ -26,10 +26,23 @@ This article offers a sample of basic Markdown syntax that can be used in Hugo c The following HTML `

`—`

` elements represent six levels of section headings. `

` is the highest section level while `

` is the lowest. # H1 + +You should not use `# H1` in your markdown file, since the title is `#H1`. + +If you use, you will get a warning from linter: + +```txt +MD025/single-title/single-h1: Multiple top-level headings in the same document +``` + ## H2 + ### H3 + #### H4 + ##### H5 + ###### H6 ## Paragraph @@ -42,9 +55,10 @@ Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sap The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations. -#### Blockquote without attribution +### Blockquote without attribution > Tiam, ad mint andaepu dandae nostion secatur sequo quae. +> > **Note** that you can use *Markdown syntax* within a blockquote. #### Blockquote with attribution @@ -52,7 +66,6 @@ The blockquote element represents content that is quoted from another source, op > Don't communicate by sharing memory, share memory by communicating.

> — Rob Pike[^1] - [^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. ## Tables @@ -61,18 +74,18 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou Name | Age --------|------ - Bob | 27 + Bob | 27 Alice | 23 -#### Inline Markdown within tables +### Inline Markdown within tables -| Inline    | Markdown    | In    | Table | -| ---------- | --------- | ----------------- | ---------- | -| *italics* | **bold** | ~~strikethrough~~    | `code` | + Inline | Markdown | In | Table +---------- | --------- | ----------------- | ---------- +*italics* | **bold** | ~~strikethrough~~ | `code` ## Code Blocks -#### Code block with backticks +### Code block with backticks ```html @@ -86,7 +99,8 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou ``` -#### Code block indented with four spaces + +### Code block indented with four spaces @@ -99,7 +113,8 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou -#### Code block with Hugo's internal highlight shortcode +### Code block with Hugo's internal highlight shortcode + {{< highlight html >}} @@ -115,22 +130,24 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou ## List Types -#### Ordered List +### Ordered List 1. First item 2. Second item 3. Third item -#### Unordered List +### Unordered List * List item * Another item * And another item -#### Nested list +### Nested list * Item + 1. First Sub-item + 2. Second Sub-item ## Other Elements — abbr, sub, sup, kbd, mark @@ -144,4 +161,3 @@ Xn + Yn = Zn Press CTRL+ALT+Delete to end the session. Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. - diff --git a/exampleSiteMultilingual/content/post/math-typesetting.md b/exampleSiteMultilingual/content/posts/math-typesetting.md similarity index 93% rename from exampleSiteMultilingual/content/post/math-typesetting.md rename to exampleSiteMultilingual/content/posts/math-typesetting.md index a1467e3..9d96925 100644 --- a/exampleSiteMultilingual/content/post/math-typesetting.md +++ b/exampleSiteMultilingual/content/posts/math-typesetting.md @@ -13,13 +13,13 @@ In this example we will be using [KaTeX](https://katex.org/) - Create a partial under `/layouts/partials/math.html` - Within this partial reference the [Auto-render Extension](https://katex.org/docs/autorender.html) or host these scripts locally. -- Include the partial in your templates like so: +- Include the partial in your templates like so: ``` {{ if or .Params.math .Site.Params.math }} {{ partial "math.html" . }} {{ end }} -``` +``` - To enable KaTex globally set the parameter `math` to `true` in a project's configuration - To enable KaTex on a per page basis include the parameter `math: true` in content files. @@ -40,6 +40,5 @@ Inline math: $$ \varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887… $$ Block math: $$ - \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } + \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } $$ - diff --git a/exampleSiteMultilingual/content/post/placeholder-text.md b/exampleSiteMultilingual/content/posts/placeholder-text.md similarity index 100% rename from exampleSiteMultilingual/content/post/placeholder-text.md rename to exampleSiteMultilingual/content/posts/placeholder-text.md diff --git a/exampleSiteMultilingual/content/post/rich-content.md b/exampleSiteMultilingual/content/posts/rich-content.md similarity index 100% rename from exampleSiteMultilingual/content/post/rich-content.md rename to exampleSiteMultilingual/content/posts/rich-content.md diff --git a/exampleSiteMultilingual/hugo.toml b/exampleSiteMultilingual/hugo.toml index a70f16d..14e1713 100644 --- a/exampleSiteMultilingual/hugo.toml +++ b/exampleSiteMultilingual/hugo.toml @@ -1,18 +1,18 @@ -baseURL = "https://hugo-theme-anubis2.netlify.app/" +baseURL = "/" languageCode = "en-us" defaultContentLanguage = "en" -title = "Anubis2" +title = "Anubis2 Demo Site" theme = "anubis2" -paginate = 3 +paginate = 5 disqusShortname = "" - [author] name = "Junyi" +email = "me@junyi.dev" +location = "Singapore" [params] -author = "Junyi" description = "Anubis2 is another simple minimalist theme for Hugo blog engine." dateFormat = "2006-01-02" paginationSinglePost = true @@ -25,7 +25,7 @@ readNextPosts = 2 copyCodeButton = true rssAsSocialIcon = true locale = "en-us" -mathjax = false +math = false # true: enable mathjax globally (default is false) toc = true # Graphcomment support @@ -38,48 +38,20 @@ GiscusCategoryId = "DIC_kwDOLEp76c4CcbPS" GiscusLazyLoad = false GiscusDataMapping = "pathname" -[[params.social]] -id = "docs" -url = "https://gohugo.io/documentation/" +customCSS = ["custom-css/custom1.scss", "custom-css/custom2.css"] -[[params.social]] -id = "github" -url = "https://github.com/Junyi-99/hugo-theme-anubis2" - -[[params.social]] -id = "linkedin" -url = "https://www.linkedin.com/" - -[[params.social]] -id = "email" -url = "example@example.com" - -[[params.social]] -id = "facebook" -url = "#" - -[[params.social]] -id = "instagram" -url = "#" - -[[params.social]] -id = "netease-music" -url = "#" - -[[params.social]] -id = "telegram" -url = "#" - -[[params.social]] -id = "x" -url = "#" - -[[params.social]] -id = "youtube" -url = "#" - -[languages.en] -languageName = "English" +social = [ + { id = "docs", url = "https://gohugo.io/documentation/" }, + { id = "github", url = "https://github.com/Junyi-99/hugo-theme-anubis2" }, + { id = "linkedin", url = "https://www.linkedin.com/" }, + { id = "email", url = "example@example.com" }, + { id = "facebook", url = "#" }, + { id = "instagram", url = "#" }, + { id = "netease-music", url = "#" }, + { id = "telegram", url = "#" }, + { id = "x", url = "#" }, + { id = "youtube", url = "#" } +] [[menu.main]] identifier = "home" @@ -105,10 +77,13 @@ identifier = "archive" url = "/posts/" weight = 4 +[languages] +[languages.en] +languageName = "English" + [languages.pl] languageName = "Polski" - [[languages.pl.menu.main]] identifier = "home" name = "Strona Główna" @@ -171,9 +146,18 @@ category = "categories" tag = "tags" author = "authors" +[markup] +defaultMarkdownHandler = 'goldmark' + [markup.goldmark.renderer] unsafe = true +[markup.highlight] +anchorLineNos = false +codeFences = true # tested with true and false. Both work. +noClasses = true # If you run with markup.highlight.noClasses=false in your site configuration, you need a style sheet. +style = 'base16-snazzy' +tabWidth = 4 [params.UmamiAnalytics] enabled = true @@ -182,3 +166,37 @@ id = "e4f661ff-9a8c-49d4-b3cc-2efe553e3973" datacache = false url = "https://eu.umami.is/script.js" shareUrl = "https://eu.umami.is/share/RIETUMwZn4IBMIr8/hugo-theme-anubis2.netlify.app" + + +# Experimental features +[params.analytics] + [params.analytics.umami] + enabled = true + dnt = false + id = "e4f661ff-9a8c-49d4-b3cc-2efe553e3973" # Website ID + datacache = false + url = "https://eu.umami.is/script.js" + shareUrl = "https://eu.umami.is/share/RIETUMwZn4IBMIr8/hugo-theme-anubis2.netlify.app" + + [params.analytics.google] + enabled = false + +[params.comments] + [params.comments.giscus] + enabled = true + repo = "Junyi-99/hugo-theme-anubis2" + repoId = "R_kgDOLEp76Q" + category = "General" + categoryId = "DIC_kwDOLEp76c4CcbPS" + lazyload = false + datamapping = "pathname" + [params.comments.disqus] + enabled = false + shortname = "" + [params.comments.utterances] + enabled = false + repo = "Junyi-99/hugo-theme-anubis2" + [params.comments.isso] + enabled = false + [params.comments.graphcommentId] + enabled = false \ No newline at end of file diff --git a/exampleSiteMultilingual/netlify.toml b/exampleSiteMultilingual/netlify.toml index 8b1ea78..d7db734 100644 --- a/exampleSiteMultilingual/netlify.toml +++ b/exampleSiteMultilingual/netlify.toml @@ -5,4 +5,4 @@ command = "hugo --gc --minify" [context.production.environment] HUGO_VERSION = "0.115.4" HUGO_ENV = "production" -HUGO_ENABLEGITINFO = "true" \ No newline at end of file +HUGO_ENABLEGITINFO = "true" diff --git a/exampleSiteMultilingual/static/fa-icons/docs.svg b/exampleSiteMultilingual/static/fa-icons/docs.svg index 5380074..a6bf4c5 100644 --- a/exampleSiteMultilingual/static/fa-icons/docs.svg +++ b/exampleSiteMultilingual/static/fa-icons/docs.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/i18n/bn.yaml b/i18n/bn.yaml index 5bdcb1a..e3603bc 100644 --- a/i18n/bn.yaml +++ b/i18n/bn.yaml @@ -38,4 +38,4 @@ skipToContent: other: "প্রচ্ছদে প্রবেশ করুন" readNext: - other: "পরের প্রচ্ছদ" \ No newline at end of file + other: "পরের প্রচ্ছদ" diff --git a/i18n/de.yaml b/i18n/de.yaml index 16108e1..ad0f652 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -38,4 +38,4 @@ skipToContent: other: "Zum Hauptinhalt springen" readNext: - other: "Weiter lesen" \ No newline at end of file + other: "Weiter lesen" diff --git a/i18n/en.yaml b/i18n/en.yaml index 4ca1dc5..47a60ff 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -56,4 +56,4 @@ toOldPost: other: "to old post" videoIsNotSupported: - other: "Your browser does not support video" \ No newline at end of file + other: "Your browser does not support video" diff --git a/i18n/fr.yaml b/i18n/fr.yaml index 018cb5f..3e456e1 100644 --- a/i18n/fr.yaml +++ b/i18n/fr.yaml @@ -38,4 +38,4 @@ skipToContent: other: "Aller au contenu" readNext: - other: "Lire la suite" \ No newline at end of file + other: "Lire la suite" diff --git a/i18n/id.yaml b/i18n/id.yaml index 8ea19a6..c9d81aa 100644 --- a/i18n/id.yaml +++ b/i18n/id.yaml @@ -38,4 +38,4 @@ skipToContent: other: "Lompat ke konten" readNext: - other: "Baca Selanjutnya" \ No newline at end of file + other: "Baca Selanjutnya" diff --git a/i18n/pl.yaml b/i18n/pl.yaml index d9dc79d..5107482 100644 --- a/i18n/pl.yaml +++ b/i18n/pl.yaml @@ -38,4 +38,4 @@ skipToContent: other: "Przejdź do głównej zawartości" readNext: - other: "Czytaj dalej" \ No newline at end of file + other: "Czytaj dalej" diff --git a/i18n/pt.yaml b/i18n/pt.yaml index fe9fa8e..87a56d5 100644 --- a/i18n/pt.yaml +++ b/i18n/pt.yaml @@ -38,4 +38,4 @@ skipToContent: other: "Pular para o conteúdo principal" readNext: - other: "Leia a seguir" \ No newline at end of file + other: "Leia a seguir" diff --git a/i18n/ru.yaml b/i18n/ru.yaml index 66cd083..b33d3fd 100644 --- a/i18n/ru.yaml +++ b/i18n/ru.yaml @@ -53,4 +53,4 @@ toOldPost: other: "к старой записи" videoIsNotSupported: - other: "Ваш браузер не поддерживает видео" \ No newline at end of file + other: "Ваш браузер не поддерживает видео" diff --git a/i18n/tw.yaml b/i18n/tw.yaml index 5a42c8c..c8c64a2 100644 --- a/i18n/tw.yaml +++ b/i18n/tw.yaml @@ -38,4 +38,4 @@ skipToContent: other: "跳至內容" readNext: - other: "閱讀下一篇" \ No newline at end of file + other: "閱讀下一篇" diff --git a/layouts/404.html b/layouts/404.html index 4ad6603..e9fbfa7 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -5,4 +5,4 @@ Sorry, this Page is not available. -{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html index 7c7f3ec..00294cc 100644 --- a/layouts/_default/_markup/render-heading.html +++ b/layouts/_default/_markup/render-heading.html @@ -5,4 +5,4 @@ {{ .Text | safeHTML }} - \ No newline at end of file + diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 8a75685..efafaf2 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -12,12 +12,12 @@ {{ i18n "skipToContent" }}
-
+
{{ block "header" . }} {{ partial "header.html" . }} {{ end }}
-
+
{{ block "main" . }}{{ end }}
{{ block "footer" . }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index ea25bcf..03e3d11 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -32,4 +32,4 @@ {{ end}}
-{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index cc620f4..15a4ed7 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -9,7 +9,7 @@ {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} - {{ .Permalink }} + {{ .RelPermalink }} {{ .Site.Title }}{{ if ne .Title .Site.Title }}{{ with .Title }} ({{.}}){{ end }}{{ end }} Hugo -- gohugo.io{{ with .Site.LanguageCode }} {{.}}{{end}}{{ with .Site.Author.email }} @@ -18,15 +18,15 @@ {{.}}{{end}}{{ if not .Date.IsZero }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} {{ with .OutputFormats.Get "RSS" }} - {{ printf "" .Permalink .MediaType | safeHTML }} + {{ printf "" .RelPermalink .MediaType | safeHTML }} {{ end }} {{ range $pages }} {{ .Title }} - {{ .Permalink }} + {{ .RelPermalink }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} - {{ .Permalink }} + {{ .RelPermalink }} {{ .Content | html }} {{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index c701504..5f466c9 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,11 +1,11 @@ {{ define "main" }} - {{ if .Menus }} + {{/* {{ if .Menus }} - {{ end }} + {{ end }} */}}
@@ -21,9 +21,14 @@
- - {{ if gt .Site.Params.readNextPosts 0 }} - {{ $related := .Site.RegularPages.Related . | first .Site.Params.readNextPosts }} + + {{ $readNextPosts := 3}} + {{ if isset .Site.Params "readNextPosts" }} + {{ $readNextPosts := .Site.Params.readNextPosts }} + {{ end }} + + {{ if gt $readNextPosts 0 }} + {{ $related := .Site.RegularPages.Related . | first $readNextPosts }} {{ with $related }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/index.html b/layouts/index.html index 44f2764..f134cf2 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -11,4 +11,4 @@ {{ partial "pagination.html" . }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index e58321f..aae2a24 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -16,4 +16,4 @@ {{ if .Site.Params.GiscusRepo}} {{ partial "giscus.html" . }} -{{ end}} \ No newline at end of file +{{ end}} diff --git a/layouts/partials/fa-icons/email.svg b/layouts/partials/fa-icons/email.svg index 24e6760..c3a463b 100644 --- a/layouts/partials/fa-icons/email.svg +++ b/layouts/partials/fa-icons/email.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/fa-icons/facebook.svg b/layouts/partials/fa-icons/facebook.svg index 77829b4..3cb46f5 100644 --- a/layouts/partials/fa-icons/facebook.svg +++ b/layouts/partials/fa-icons/facebook.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/fa-icons/github.svg b/layouts/partials/fa-icons/github.svg index 1a4d15c..beedbf1 100644 --- a/layouts/partials/fa-icons/github.svg +++ b/layouts/partials/fa-icons/github.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/fa-icons/halfcircle.svg b/layouts/partials/fa-icons/halfcircle.svg index e2639e2..fcff4c5 100644 --- a/layouts/partials/fa-icons/halfcircle.svg +++ b/layouts/partials/fa-icons/halfcircle.svg @@ -1,3 +1,3 @@ - \ No newline at end of file + diff --git a/layouts/partials/fa-icons/instagram.svg b/layouts/partials/fa-icons/instagram.svg index 46aab1a..6981448 100644 --- a/layouts/partials/fa-icons/instagram.svg +++ b/layouts/partials/fa-icons/instagram.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/fa-icons/linkedin.svg b/layouts/partials/fa-icons/linkedin.svg index 95faf46..bdde927 100644 --- a/layouts/partials/fa-icons/linkedin.svg +++ b/layouts/partials/fa-icons/linkedin.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/fa-icons/mastodon.svg b/layouts/partials/fa-icons/mastodon.svg index 8532bd0..2dc91f0 100644 --- a/layouts/partials/fa-icons/mastodon.svg +++ b/layouts/partials/fa-icons/mastodon.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/fa-icons/patreon.svg b/layouts/partials/fa-icons/patreon.svg index 5eae6c0..d54c852 100644 --- a/layouts/partials/fa-icons/patreon.svg +++ b/layouts/partials/fa-icons/patreon.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/fa-icons/reddit.svg b/layouts/partials/fa-icons/reddit.svg index 2de59d4..df4bca1 100644 --- a/layouts/partials/fa-icons/reddit.svg +++ b/layouts/partials/fa-icons/reddit.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/fa-icons/rss.svg b/layouts/partials/fa-icons/rss.svg index 606aa89..2f83854 100644 --- a/layouts/partials/fa-icons/rss.svg +++ b/layouts/partials/fa-icons/rss.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/fa-icons/snapchat.svg b/layouts/partials/fa-icons/snapchat.svg index ecf5cf4..733b224 100644 --- a/layouts/partials/fa-icons/snapchat.svg +++ b/layouts/partials/fa-icons/snapchat.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/fa-icons/soundcloud.svg b/layouts/partials/fa-icons/soundcloud.svg index 0901cd1..35f9332 100644 --- a/layouts/partials/fa-icons/soundcloud.svg +++ b/layouts/partials/fa-icons/soundcloud.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/fa-icons/spotify.svg b/layouts/partials/fa-icons/spotify.svg index 718d287..3f422c5 100644 --- a/layouts/partials/fa-icons/spotify.svg +++ b/layouts/partials/fa-icons/spotify.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/fa-icons/telegram.svg b/layouts/partials/fa-icons/telegram.svg index d60b094..26a0a33 100644 --- a/layouts/partials/fa-icons/telegram.svg +++ b/layouts/partials/fa-icons/telegram.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/fa-icons/twitch.svg b/layouts/partials/fa-icons/twitch.svg index a3c407a..3d91f31 100644 --- a/layouts/partials/fa-icons/twitch.svg +++ b/layouts/partials/fa-icons/twitch.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/fa-icons/twitter.svg b/layouts/partials/fa-icons/twitter.svg index 3db10f6..881b95c 100644 --- a/layouts/partials/fa-icons/twitter.svg +++ b/layouts/partials/fa-icons/twitter.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/fa-icons/vk.svg b/layouts/partials/fa-icons/vk.svg index 960003d..3887fe1 100644 --- a/layouts/partials/fa-icons/vk.svg +++ b/layouts/partials/fa-icons/vk.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/fa-icons/youtube.svg b/layouts/partials/fa-icons/youtube.svg index adfe427..ec6c92d 100644 --- a/layouts/partials/fa-icons/youtube.svg +++ b/layouts/partials/fa-icons/youtube.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/font-awesome.html b/layouts/partials/font-awesome.html index 60057f1..09b9cb3 100644 --- a/layouts/partials/font-awesome.html +++ b/layouts/partials/font-awesome.html @@ -2,7 +2,7 @@ {{ $dict := newScratch }} - + {{ if (eq .iconName "docs")}} \ No newline at end of file + diff --git a/layouts/partials/footer-extra.html b/layouts/partials/footer-extra.html index 0e22c9a..d1f0ad9 100644 --- a/layouts/partials/footer-extra.html +++ b/layouts/partials/footer-extra.html @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 9f2ca6e..fbff101 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -13,17 +13,17 @@ {{ end }} {{ end }} - +
- © {{ if isset .Site.Params "author"}}{{ .Site.Params.author }}, {{end}}{{ now.Year }} + © {{ if isset .Site.Author "name"}}{{ .Site.Author.name }}, {{end}}{{ now.Year }} {{ if .Site.Params.UmamiAnalytics.shareUrl }} - + {{ end }}
{{ i18n "powered" }} Hugo, {{ i18n "theme" }} Anubis2.
{{ partial "footer-extra.html" . }} -
+ {{ partial "h-card.html" . }} diff --git a/layouts/partials/giscus.html b/layouts/partials/giscus.html index eb6ce65..0d0f173 100644 --- a/layouts/partials/giscus.html +++ b/layouts/partials/giscus.html @@ -46,4 +46,4 @@ $category := .Site.Params.GiscusDiscussionCategory | default "Announcements" }} data-reactions-enabled="1" data-emit-metadata="0" data-input-position="bottom" data-theme="{{ $theme }}" data-lang="{{ $language }}" crossorigin="anonymous" {{ if $lazyload }} data-loading="lazy" {{ end }} async> -*/}} \ No newline at end of file +*/}} diff --git a/layouts/partials/graphcomment.html b/layouts/partials/graphcomment.html index 9cd1d28..bbfeb41 100644 --- a/layouts/partials/graphcomment.html +++ b/layouts/partials/graphcomment.html @@ -27,6 +27,6 @@ gc.onload = __semio__onload; gc.defer = true; gc.src = 'https://integration.graphcomment.com/gc_graphlogin.js?' + Date.now(); (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(gc); })(); - + diff --git a/layouts/partials/h-card.html b/layouts/partials/h-card.html index 66cf479..d4bc60c 100644 --- a/layouts/partials/h-card.html +++ b/layouts/partials/h-card.html @@ -1,13 +1,13 @@

- {{ .Site.Params.author }} + {{ .Site.Params.author }} - {{ if .Site.Params.email }} + {{ if .Site.Params.email }} / {{ end }} - {{ if .Site.Params.avatar }} + {{ if .Site.Params.avatar }} {{ end }} -

\ No newline at end of file +

diff --git a/layouts/partials/head-extra.html b/layouts/partials/head-extra.html index 0e22c9a..d1f0ad9 100644 --- a/layouts/partials/head-extra.html +++ b/layouts/partials/head-extra.html @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/head.html b/layouts/partials/head.html index a902d73..ea2de2b 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -16,20 +16,22 @@ {{ end }} {{ with .OutputFormats.Get "rss" -}} - {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} + {{ printf `` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }} {{ end -}} {{ partial "favicons.html" . }} {{ $colorTheme := "light" }} -{{ $colorThemeSwitcher := false }} +{{ $colorThemeSwitcher := true }} {{ if and (isset site.Params "colortheme") (ne site.Params.colortheme "") }} {{ $colorTheme = site.Params.colortheme | lower }} {{ end }} -{{ if and (isset site.Params "colorthemeswitcher") }} +{{ if isset site.Params "colorthemeswitcher" }} {{ $colorThemeSwitcher = site.Params.colorthemeswitcher }} +{{ else }} + {{ $colorThemeSwitcher = true }} {{ end }} {{ if or (eq $colorThemeSwitcher true) (eq $colorTheme "auto") }} @@ -54,6 +56,27 @@ {{ partial "resource.html" (dict "context" . "type" "css" "filename" "css/light.css") }} {{ partial "resource.html" (dict "context" . "type" "css" "filename" "css/dark.css") }} + +{{ $opts := dict "transpiler" "libsass" "targetPath" "css/style.css" }} +{{ range site.Params.customCSS }} + {{ with resources.Get . | toCSS $opts | minify | fingerprint }} + + {{ end }} +{{ end }} + +{{ if site.Params.isso.enabled }} {{/* TODO: maybe we can remove it */}} + +{{ end }} + + {{ if .Site.Params.copyCodeButton | default true }} {{ partial "resource.html" (dict "context" . "type" "js" "filename" "js/copy-code.js") }} {{ end }} diff --git a/layouts/partials/header-extra.html b/layouts/partials/header-extra.html index 0e22c9a..d1f0ad9 100644 --- a/layouts/partials/header-extra.html +++ b/layouts/partials/header-extra.html @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 950cbb6..d97227d 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,11 +1,11 @@
{{ partial "site-title.html" . }} - {{ partial "theme-switcher.html" . }} + {{ partial "theme-switcher.html" . }} {{ partial "social-icons.html" . }}
- +
@@ -20,6 +20,7 @@ {{ end }} -{{ if .Site.Params.mathjax }}{{ partial "mathjax_support.html" . }}{{ end }} +{{/* .Params is the current page config. .Site.Params is globall config in hugo.toml */}} +{{ if or .Site.Params.math .Params.math }}{{ partial "mathjax_support.html" . }}{{ end }} -{{ partial "header-extra.html" . }} \ No newline at end of file +{{ partial "header-extra.html" . }} diff --git a/layouts/partials/language-switcher.html b/layouts/partials/language-switcher.html index df9c6ef..b4a9a96 100644 --- a/layouts/partials/language-switcher.html +++ b/layouts/partials/language-switcher.html @@ -9,7 +9,7 @@ {{ if eq .Lang $pageLang }}
  • {{ .Language.LanguageName }}
  • {{ else }} -
  • {{ .Language.LanguageName }}
  • +
  • {{ .Language.LanguageName }}
  • {{ end }} {{ end }} diff --git a/layouts/partials/mathjax_support.html b/layouts/partials/mathjax_support.html index 0dc7dd1..86ec9d0 100644 --- a/layouts/partials/mathjax_support.html +++ b/layouts/partials/mathjax_support.html @@ -19,4 +19,4 @@ \ No newline at end of file + src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"> diff --git a/layouts/partials/pagination-extra.html b/layouts/partials/pagination-extra.html index 0e22c9a..d1f0ad9 100644 --- a/layouts/partials/pagination-extra.html +++ b/layouts/partials/pagination-extra.html @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/post-info.html b/layouts/partials/post-info.html index 641b66a..ad40c71 100644 --- a/layouts/partials/post-info.html +++ b/layouts/partials/post-info.html @@ -18,7 +18,7 @@ {{ end }} - {{ .Permalink }} + {{ .RelPermalink }} {{ .Params.author | default .Site.Params.author }} @@ -27,7 +27,7 @@ {{ end }} @@ -35,7 +35,7 @@ {{ end }} @@ -43,7 +43,7 @@ {{ end }} diff --git a/layouts/partials/post-language-switcher.html b/layouts/partials/post-language-switcher.html index e814393..c492402 100644 --- a/layouts/partials/post-language-switcher.html +++ b/layouts/partials/post-language-switcher.html @@ -9,10 +9,10 @@ {{ else }}
  • - {{ upper .Lang }} + {{ upper .Lang }}
  • {{ end }} {{ end }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/partials/post-summary.html b/layouts/partials/post-summary.html index 72f5148..18f991e 100644 --- a/layouts/partials/post-summary.html +++ b/layouts/partials/post-summary.html @@ -16,6 +16,6 @@ {{ i18n "readMore" }} {{ end }} - + {{ partial "post-info.html" . }} - \ No newline at end of file + diff --git a/layouts/partials/resource.html b/layouts/partials/resource.html index 1ecc5e5..34ae2da 100644 --- a/layouts/partials/resource.html +++ b/layouts/partials/resource.html @@ -15,9 +15,9 @@ {{ $resource = $resource | resources.Fingerprint "sha256" }} {{ if eq .type "css" }} - + {{ else if eq .type "js" }} - + {{ end }} {{ else }} diff --git a/layouts/partials/site-title.html b/layouts/partials/site-title.html index 6ed0d70..a1f1ec5 100644 --- a/layouts/partials/site-title.html +++ b/layouts/partials/site-title.html @@ -1,3 +1,3 @@

    {{ .Site.Title }} -

    \ No newline at end of file +
    diff --git a/layouts/partials/social-icons.html b/layouts/partials/social-icons.html index e358068..798ccaf 100644 --- a/layouts/partials/social-icons.html +++ b/layouts/partials/social-icons.html @@ -1,4 +1,4 @@ - diff --git a/layouts/partials/tabler-icons/4chan.svg b/layouts/partials/tabler-icons/4chan.svg index 7127408..4ae85f1 100644 --- a/layouts/partials/tabler-icons/4chan.svg +++ b/layouts/partials/tabler-icons/4chan.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/docs.svg b/layouts/partials/tabler-icons/docs.svg index 559e19b..d7dd53e 100644 --- a/layouts/partials/tabler-icons/docs.svg +++ b/layouts/partials/tabler-icons/docs.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/email.svg b/layouts/partials/tabler-icons/email.svg index cecc719..a88608d 100644 --- a/layouts/partials/tabler-icons/email.svg +++ b/layouts/partials/tabler-icons/email.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/facebook.svg b/layouts/partials/tabler-icons/facebook.svg index 47ad743..c5bb158 100644 --- a/layouts/partials/tabler-icons/facebook.svg +++ b/layouts/partials/tabler-icons/facebook.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/github.svg b/layouts/partials/tabler-icons/github.svg index ad12afd..62acd1e 100644 --- a/layouts/partials/tabler-icons/github.svg +++ b/layouts/partials/tabler-icons/github.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/gitlab.svg b/layouts/partials/tabler-icons/gitlab.svg index 6de1fad..d6340d4 100644 --- a/layouts/partials/tabler-icons/gitlab.svg +++ b/layouts/partials/tabler-icons/gitlab.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/instagram.svg b/layouts/partials/tabler-icons/instagram.svg index cb790d6..099593d 100644 --- a/layouts/partials/tabler-icons/instagram.svg +++ b/layouts/partials/tabler-icons/instagram.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/leetcode.svg b/layouts/partials/tabler-icons/leetcode.svg index 3fed55a..109890d 100644 --- a/layouts/partials/tabler-icons/leetcode.svg +++ b/layouts/partials/tabler-icons/leetcode.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/linkedin.svg b/layouts/partials/tabler-icons/linkedin.svg index a31391c..c5436c9 100644 --- a/layouts/partials/tabler-icons/linkedin.svg +++ b/layouts/partials/tabler-icons/linkedin.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/mastodon.svg b/layouts/partials/tabler-icons/mastodon.svg index 972d80b..d3dd2e2 100644 --- a/layouts/partials/tabler-icons/mastodon.svg +++ b/layouts/partials/tabler-icons/mastodon.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/medium.svg b/layouts/partials/tabler-icons/medium.svg index 0960909..35c7a76 100644 --- a/layouts/partials/tabler-icons/medium.svg +++ b/layouts/partials/tabler-icons/medium.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/netease-music.svg b/layouts/partials/tabler-icons/netease-music.svg index 3d2da67..42a08f9 100644 --- a/layouts/partials/tabler-icons/netease-music.svg +++ b/layouts/partials/tabler-icons/netease-music.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/notion.svg b/layouts/partials/tabler-icons/notion.svg index e3d0e19..bd5ccae 100644 --- a/layouts/partials/tabler-icons/notion.svg +++ b/layouts/partials/tabler-icons/notion.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/patreon.svg b/layouts/partials/tabler-icons/patreon.svg index bfbb0c2..db2ee03 100644 --- a/layouts/partials/tabler-icons/patreon.svg +++ b/layouts/partials/tabler-icons/patreon.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/qq.svg b/layouts/partials/tabler-icons/qq.svg index b7d7481..723b634 100644 --- a/layouts/partials/tabler-icons/qq.svg +++ b/layouts/partials/tabler-icons/qq.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/reddit.svg b/layouts/partials/tabler-icons/reddit.svg index 8e7dbe3..bfb08a6 100644 --- a/layouts/partials/tabler-icons/reddit.svg +++ b/layouts/partials/tabler-icons/reddit.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/rss.svg b/layouts/partials/tabler-icons/rss.svg index 7751556..b066d73 100644 --- a/layouts/partials/tabler-icons/rss.svg +++ b/layouts/partials/tabler-icons/rss.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/skype.svg b/layouts/partials/tabler-icons/skype.svg index 05a0bde..209690a 100644 --- a/layouts/partials/tabler-icons/skype.svg +++ b/layouts/partials/tabler-icons/skype.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/slack.svg b/layouts/partials/tabler-icons/slack.svg index 6690195..6867bf7 100644 --- a/layouts/partials/tabler-icons/slack.svg +++ b/layouts/partials/tabler-icons/slack.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/snapchat.svg b/layouts/partials/tabler-icons/snapchat.svg index 3b33e3f..de8a3b4 100644 --- a/layouts/partials/tabler-icons/snapchat.svg +++ b/layouts/partials/tabler-icons/snapchat.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/soundcloud.svg b/layouts/partials/tabler-icons/soundcloud.svg index fd0929c..b60384a 100644 --- a/layouts/partials/tabler-icons/soundcloud.svg +++ b/layouts/partials/tabler-icons/soundcloud.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/spotify.svg b/layouts/partials/tabler-icons/spotify.svg index d7a6f29..bde7861 100644 --- a/layouts/partials/tabler-icons/spotify.svg +++ b/layouts/partials/tabler-icons/spotify.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/steam.svg b/layouts/partials/tabler-icons/steam.svg index 1cda320..cc2d5ba 100644 --- a/layouts/partials/tabler-icons/steam.svg +++ b/layouts/partials/tabler-icons/steam.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/teams.svg b/layouts/partials/tabler-icons/teams.svg index e48abb4..856d2cc 100644 --- a/layouts/partials/tabler-icons/teams.svg +++ b/layouts/partials/tabler-icons/teams.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/telegram.svg b/layouts/partials/tabler-icons/telegram.svg index 113242f..6268abc 100644 --- a/layouts/partials/tabler-icons/telegram.svg +++ b/layouts/partials/tabler-icons/telegram.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/theme-dark.svg b/layouts/partials/tabler-icons/theme-dark.svg index ec6ba71..4a4c34e 100644 --- a/layouts/partials/tabler-icons/theme-dark.svg +++ b/layouts/partials/tabler-icons/theme-dark.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/theme-light.svg b/layouts/partials/tabler-icons/theme-light.svg index 9902622..0b85222 100644 --- a/layouts/partials/tabler-icons/theme-light.svg +++ b/layouts/partials/tabler-icons/theme-light.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/tiktok.svg b/layouts/partials/tabler-icons/tiktok.svg index d5c6d2e..8b1cbce 100644 --- a/layouts/partials/tabler-icons/tiktok.svg +++ b/layouts/partials/tabler-icons/tiktok.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/tinder.svg b/layouts/partials/tabler-icons/tinder.svg index 129c7be..b88c37d 100644 --- a/layouts/partials/tabler-icons/tinder.svg +++ b/layouts/partials/tabler-icons/tinder.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/tumblr.svg b/layouts/partials/tabler-icons/tumblr.svg index 531c44e..732041a 100644 --- a/layouts/partials/tabler-icons/tumblr.svg +++ b/layouts/partials/tabler-icons/tumblr.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/twitch.svg b/layouts/partials/tabler-icons/twitch.svg index 9f13c36..35137d4 100644 --- a/layouts/partials/tabler-icons/twitch.svg +++ b/layouts/partials/tabler-icons/twitch.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/twitter.svg b/layouts/partials/tabler-icons/twitter.svg index 81650b7..b34146c 100644 --- a/layouts/partials/tabler-icons/twitter.svg +++ b/layouts/partials/tabler-icons/twitter.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/vk.svg b/layouts/partials/tabler-icons/vk.svg index 7d057fd..99cca62 100644 --- a/layouts/partials/tabler-icons/vk.svg +++ b/layouts/partials/tabler-icons/vk.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/weibo.svg b/layouts/partials/tabler-icons/weibo.svg index 88fbba6..378cfa6 100644 --- a/layouts/partials/tabler-icons/weibo.svg +++ b/layouts/partials/tabler-icons/weibo.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/x.svg b/layouts/partials/tabler-icons/x.svg index 0feee2b..d370aca 100644 --- a/layouts/partials/tabler-icons/x.svg +++ b/layouts/partials/tabler-icons/x.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/youtube.svg b/layouts/partials/tabler-icons/youtube.svg index 2f996cf..7037486 100644 --- a/layouts/partials/tabler-icons/youtube.svg +++ b/layouts/partials/tabler-icons/youtube.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/tabler-icons/zhihu.svg b/layouts/partials/tabler-icons/zhihu.svg index 78c6236..72a04e3 100644 --- a/layouts/partials/tabler-icons/zhihu.svg +++ b/layouts/partials/tabler-icons/zhihu.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/layouts/partials/theme-switcher.html b/layouts/partials/theme-switcher.html index 4614a57..73cf4ab 100644 --- a/layouts/partials/theme-switcher.html +++ b/layouts/partials/theme-switcher.html @@ -1,16 +1,16 @@ {{ $colorTheme := "light" }} -{{ $colorThemeSwitcher := false }} +{{ $colorThemeSwitcher := true }} {{ if and (isset site.Params "colortheme") (ne site.Params.colortheme "") }} {{ $colorTheme = site.Params.colortheme | lower }} {{ end }} -{{ if and (isset site.Params "colorthemeswitcher") }} +{{ if isset site.Params "colorthemeswitcher" }} {{ $colorThemeSwitcher = site.Params.colorthemeswitcher }} {{ end }} {{ if or (eq $colorThemeSwitcher true) (eq $colorTheme "auto") }} - {{ if site.Params.colorthemeswitcher }} + {{ if $colorThemeSwitcher }}
    {{ partial "font-awesome.html" (dict "iconName" "theme-light" "custom" false) }}
    @@ -23,7 +23,7 @@ let currentTheme let switchButton let autoDefinedScheme = window.matchMedia('(prefers-color-scheme: dark)') - + function switchTheme(e) { currentTheme = (currentTheme === 'dark') ? 'light' : 'dark'; if (localStorage) localStorage.setItem(STORAGE_KEY, currentTheme); @@ -31,7 +31,7 @@ changeGiscusTheme(currentTheme); document.body.dispatchEvent(new CustomEvent(currentTheme + "-theme-set")); } - + const autoChangeScheme = e => { currentTheme = e.matches ? 'dark' : 'light' document.documentElement.setAttribute('data-theme', currentTheme); @@ -42,14 +42,14 @@ document.addEventListener('DOMContentLoaded', function () { switchButton = document.querySelector('.theme-switcher') currentTheme = detectCurrentScheme() - + if (currentTheme === 'auto') { autoChangeScheme(autoDefinedScheme); autoDefinedScheme.addListener(autoChangeScheme); } else { document.documentElement.setAttribute('data-theme', currentTheme) } - + if (switchButton) { switchButton.addEventListener('click', switchTheme, false) } @@ -72,13 +72,13 @@ document.body.style.opacity = 1; } - function changeGiscusTheme (theme) { + function changeGiscusTheme (theme) { function sendMessage(message) { const iframe = document.querySelector('iframe.giscus-frame'); if (!iframe) return; iframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app'); } - + sendMessage({ setConfig: { theme: theme @@ -86,4 +86,4 @@ }); } -{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html index 66f8075..2656c6d 100644 --- a/layouts/partials/toc.html +++ b/layouts/partials/toc.html @@ -1,7 +1,9 @@ -{{ $toc := and ($.Site.Params.toc) (ge .WordCount $.Site.Params.tocWordCount) }} -{{ if isset .Params "toc" }} +{{ $toc := and ($.Site.Params.toc) (ge .WordCount $.Site.Params.tocWordCount) }} +{{ if isset .Params "toc" }} {{ $toc = .Params.toc }} -{{ end }} +{{ else }} + {{ $toc = true }} +{{ end }} {{ if $toc }} diff --git a/layouts/partials/utterances.html b/layouts/partials/utterances.html index 1c633a7..551488b 100644 --- a/layouts/partials/utterances.html +++ b/layouts/partials/utterances.html @@ -8,4 +8,4 @@ issue-term="{{ $issue }}" crossorigin="anonymous" async> - \ No newline at end of file + diff --git a/layouts/shortcodes/icon.html b/layouts/shortcodes/icon.html new file mode 100644 index 0000000..494bb61 --- /dev/null +++ b/layouts/shortcodes/icon.html @@ -0,0 +1 @@ +{{ partial (print "tabler-icons/" (.Get 0) ".svg" ) . }} \ No newline at end of file diff --git a/layouts/shortcodes/video.html b/layouts/shortcodes/video.html index c950670..d69e45d 100644 --- a/layouts/shortcodes/video.html +++ b/layouts/shortcodes/video.html @@ -1,10 +1,10 @@ -