From 06a4f7acebc82d6410727ae9939507d817de0d9d Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Mon, 29 Apr 2024 12:09:19 +0800 Subject: [PATCH 01/37] add: added support for ICP beian for China ISP --- exampleSiteMultilingual/hugo.toml | 2 ++ layouts/partials/footer.html | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/exampleSiteMultilingual/hugo.toml b/exampleSiteMultilingual/hugo.toml index 14e1713..26ef82d 100644 --- a/exampleSiteMultilingual/hugo.toml +++ b/exampleSiteMultilingual/hugo.toml @@ -17,6 +17,8 @@ description = "Anubis2 is another simple minimalist theme for Hugo blog engine." dateFormat = "2006-01-02" paginationSinglePost = true +# icp = "京ICP备xxxxx号-1" # for China ICP license + colorTheme = "auto" colorThemeSwitcher = true diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index fbff101..d0e4555 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -20,6 +20,11 @@ {{ end }} +
+ {{ if .Site.Params.icp }} + {{ .Site.Params.icp }} + {{ end }} +
{{ i18n "powered" }} Hugo, {{ i18n "theme" }} Anubis2.
{{ partial "footer-extra.html" . }} From 48f1064af15332933c1bd478f0a213afcfaff3c7 Mon Sep 17 00:00:00 2001 From: Junyi Date: Mon, 29 Apr 2024 12:22:40 +0800 Subject: [PATCH 02/37] Update README.md --- README.md | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 70be5e4..75542eb 100644 --- a/README.md +++ b/README.md @@ -24,15 +24,17 @@ You need to install an extended version of Hugo to run this theme. ### As Git Submodule -Inside the folder of your Hugo site run: +Inside the folder of your Hugo site, run: - $ git submodule add https://github.com/Junyi-99/hugo-theme-anubis2.git themes/anubis2 +```bash +git submodule add https://github.com/Junyi-99/hugo-theme-anubis2.git themes/anubis2 +``` For more information read the official [setup guide](https://gohugo.io/overview/installing/) of Hugo. ### Configure your site -Don't be panic, configure Anubis2 is relatively simple. +Don't be panic, configure Anubis2 is really simple. **This is the minimum configuration:** @@ -40,27 +42,37 @@ Don't be panic, configure Anubis2 is relatively simple. baseURL = "https://hugo-theme-anubis2.netlify.app/" languageCode = "en-us" theme = "anubis2" -title = "Anubis2 Demo Site" +title = "Your Site's Name" [author] -name = "Junyi" +name = "Your Name" [markup.goldmark.renderer] -unsafe = true # true | false; Enable unsafe mode to have a better experience +unsafe = true # Enable unsafe mode to have a better experience [markup.highlight] style = 'base16-snazzy' # Highlight.js style ``` -It's not too late to keep the other fields as defaults and fine-tune them when you have time! (see [Configuration Example](https://github.com/Junyi-99/hugo-theme-anubis2/wiki/Configuration-Example)) +You are encouraged keeping other fields as defaults and fine-tune them when you have time! (see [Full Configuration Examples](https://github.com/Junyi-99/hugo-theme-anubis2/wiki/Configuration-Example)) -### Run your site +## Run your site In order to see your site in action, run Hugo's built-in local server. -`$ hugo server` +```bash +hugo server +``` -Now enter [`localhost:1313`](http://localhost:1313/) in the address bar of your browser. +Now enter [`http://localhost:1313`](http://localhost:1313/) in the address bar of your browser. + +## Update to the latest version + +In your Hugo site folder, run this command: + +```bash +git submodule update --remote +``` ## Contributing From b44d2a736cadf06b768cc467ef2edfa47d3bd648 Mon Sep 17 00:00:00 2001 From: chenyin <1270224500@qq.com> Date: Mon, 29 Apr 2024 15:23:22 +0800 Subject: [PATCH 03/37] added support for police beian for China ISP --- exampleSiteMultilingual/hugo.toml | 1 + layouts/partials/footer.html | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/exampleSiteMultilingual/hugo.toml b/exampleSiteMultilingual/hugo.toml index 26ef82d..29db0d1 100644 --- a/exampleSiteMultilingual/hugo.toml +++ b/exampleSiteMultilingual/hugo.toml @@ -18,6 +18,7 @@ dateFormat = "2006-01-02" paginationSinglePost = true # icp = "京ICP备xxxxx号-1" # for China ICP license +# police = "京公网安备 xxxxxxxx号" # for China police beian colorTheme = "auto" colorThemeSwitcher = true diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index d0e4555..ea511b7 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -20,9 +20,20 @@ {{ end }}
-
+
+ {{ $police := .Site.Params.police }} + {{ $info := "info" }} + {{ $pattern := "[0-9]+" }} + {{ $matches := findRE $pattern $police }} + {{ if $matches }} + {{ $firstNumber := index $matches 0 }} + {{ $info = print $firstNumber }} + 备案图标 + {{ .Site.Params.police }} +   + {{ end }} {{ if .Site.Params.icp }} - {{ .Site.Params.icp }} + {{ .Site.Params.icp }} {{ end }}
From b782018b8c70f08ef030f1932e051e4978437992 Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Mon, 29 Apr 2024 15:47:00 +0800 Subject: [PATCH 04/37] update: hide all summary rendering tests because Hugo refused to fix the bug. --- .../content/posts/demo-summary-rendering-1.md | 1 + .../content/posts/demo-summary-rendering-2.md | 1 + .../content/posts/demo-summary-rendering-3.md | 1 + .../content/posts/demo-summary-rendering-4.md | 1 + .../content/posts/demo-summary-rendering-5.md | 1 + .../content/posts/demo-summary-rendering-6.md | 1 + .../content/posts/demo-summary-rendering-7.md | 1 + .../content/posts/demo-summary-rendering-8.md | 1 + exampleSiteMultilingual/hugo.toml | 2 +- 9 files changed, 9 insertions(+), 1 deletion(-) diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-1.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-1.md index 7670383..6f1f432 100644 --- a/exampleSiteMultilingual/content/posts/demo-summary-rendering-1.md +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-1.md @@ -2,6 +2,7 @@ title: "Demo - Summary Rendering Test 1 (😃 Easy)" date: 2024-04-25T1:54:12+08:00 draft: true +hidden: true tags: [Hugo] --- diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-2.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-2.md index 6d051f4..e267eef 100644 --- a/exampleSiteMultilingual/content/posts/demo-summary-rendering-2.md +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-2.md @@ -2,6 +2,7 @@ title: "Demo - Summary Rendering Test 2 (😏 Easy)" date: 2024-04-25T1:54:13+08:00 draft: true +hidden: true tags: [Hugo] --- diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-3.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-3.md index 8b0b1e9..fcd583e 100644 --- a/exampleSiteMultilingual/content/posts/demo-summary-rendering-3.md +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-3.md @@ -2,6 +2,7 @@ title: "Demo - Summary Rendering Test 3 (🤔 Easy)" date: 2024-04-25T1:54:14+08:00 draft: true +hidden: true tags: [Hugo] --- diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-4.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-4.md index 1400d39..1448209 100644 --- a/exampleSiteMultilingual/content/posts/demo-summary-rendering-4.md +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-4.md @@ -2,6 +2,7 @@ title: "Demo - Summary Rendering Test 4 (😅 Easy?)" date: 2024-04-25T1:54:15+08:00 draft: true +hidden: true tags: [Hugo] --- diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-5.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-5.md index 7b9673f..7a7db68 100644 --- a/exampleSiteMultilingual/content/posts/demo-summary-rendering-5.md +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-5.md @@ -2,6 +2,7 @@ title: "Demo - Summary Rendering Test 5 (😥 Medium)" date: 2024-04-25T1:54:16+08:00 draft: true +hidden: true tags: [Hugo] --- diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-6.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-6.md index 1ad288c..118a5e4 100644 --- a/exampleSiteMultilingual/content/posts/demo-summary-rendering-6.md +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-6.md @@ -2,6 +2,7 @@ title: "Demo - Summary Rendering Test 6 (🤯 Hard)" date: 2024-04-25T1:54:17+08:00 draft: true +hidden: true tags: [Hugo] --- diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-7.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-7.md index add4a4d..d10f475 100644 --- a/exampleSiteMultilingual/content/posts/demo-summary-rendering-7.md +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-7.md @@ -2,6 +2,7 @@ title: "Demo - Summary Rendering Test 7 (😱 Bad Dream)" date: 2024-04-25T1:54:18+08:00 draft: true +hidden: true tags: [Hugo] --- diff --git a/exampleSiteMultilingual/content/posts/demo-summary-rendering-8.md b/exampleSiteMultilingual/content/posts/demo-summary-rendering-8.md index 27c02f7..095240e 100644 --- a/exampleSiteMultilingual/content/posts/demo-summary-rendering-8.md +++ b/exampleSiteMultilingual/content/posts/demo-summary-rendering-8.md @@ -2,6 +2,7 @@ title: "Demo - Summary Rendering Test 8 (💀 Nightmare)" date: 2024-04-25T1:54:19+08:00 draft: true +hidden: true tags: [Hugo] --- diff --git a/exampleSiteMultilingual/hugo.toml b/exampleSiteMultilingual/hugo.toml index 29db0d1..2722821 100644 --- a/exampleSiteMultilingual/hugo.toml +++ b/exampleSiteMultilingual/hugo.toml @@ -18,7 +18,7 @@ dateFormat = "2006-01-02" paginationSinglePost = true # icp = "京ICP备xxxxx号-1" # for China ICP license -# police = "京公网安备 xxxxxxxx号" # for China police beian +# police = "京公网安备 12345678号" # for China police beian colorTheme = "auto" colorThemeSwitcher = true From 4f04a33623d66c9ae5de8e393757c7f8a556ed14 Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Mon, 29 Apr 2024 15:50:00 +0800 Subject: [PATCH 05/37] del: remove experimental configs to reduce misleading. these configs has not been implemented. --- exampleSiteMultilingual/hugo.toml | 36 +------------------------------ 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/exampleSiteMultilingual/hugo.toml b/exampleSiteMultilingual/hugo.toml index 2722821..7149232 100644 --- a/exampleSiteMultilingual/hugo.toml +++ b/exampleSiteMultilingual/hugo.toml @@ -168,38 +168,4 @@ 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" - - -# 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 +shareUrl = "https://eu.umami.is/share/RIETUMwZn4IBMIr8/hugo-theme-anubis2.netlify.app" \ No newline at end of file From 7484d058f201af669cf1ae71900f71eda90166a0 Mon Sep 17 00:00:00 2001 From: Philip Mallegol-Hansen Date: Tue, 30 Apr 2024 22:46:39 -0700 Subject: [PATCH 06/37] Corrects logic for enabling ToC --- layouts/partials/toc.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html index 2656c6d..3d148a2 100644 --- a/layouts/partials/toc.html +++ b/layouts/partials/toc.html @@ -1,9 +1,8 @@ -{{ $toc := and ($.Site.Params.toc) (ge .WordCount $.Site.Params.tocWordCount) }} -{{ if isset .Params "toc" }} - {{ $toc = .Params.toc }} -{{ else }} - {{ $toc = true }} +{{ $toc := true }} +{{ if isset .Site.Params "toc" }} + {{ $toc = .Site.Params.toc }} {{ end }} +{{ $toc = and ($toc) (ge .WordCount .Site.Params.tocWordCount) }} {{ if $toc }} From 8c4d7defca48e7de32bafdaae3cecd8a2223a998 Mon Sep 17 00:00:00 2001 From: Philip Mallegol-Hansen Date: Wed, 1 May 2024 13:58:51 -0700 Subject: [PATCH 07/37] Improves ToC logic to account for both site and page configuration --- layouts/partials/toc.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html index 3d148a2..588d180 100644 --- a/layouts/partials/toc.html +++ b/layouts/partials/toc.html @@ -1,8 +1,12 @@ {{ $toc := true }} -{{ if isset .Site.Params "toc" }} - {{ $toc = .Site.Params.toc }} +{{ if isset .Params "toc" }} + {{ $toc = .Params.toc }} +{{ else }} + {{ $toc = ge .WordCount .Site.Params.tocWordCount }} + {{ if and (isset .Site.Params "toc") (not (.Site.Params.toc)) }} + {{ $toc = false }} + {{ end }} {{ end }} -{{ $toc = and ($toc) (ge .WordCount .Site.Params.tocWordCount) }} {{ if $toc }} From c3a7039b35dd8a4c7dce26a5642e7cad5f13fa6b Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Fri, 3 May 2024 01:30:14 +0800 Subject: [PATCH 08/37] fix the sitemap url --- layouts/_default/sitemap.xml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/layouts/_default/sitemap.xml b/layouts/_default/sitemap.xml index 7d4284f..1db96c2 100644 --- a/layouts/_default/sitemap.xml +++ b/layouts/_default/sitemap.xml @@ -2,23 +2,23 @@ {{ range where .Data.Pages "Params.hidden" "!=" true }} - {{- if .RelPermalink -}} - - {{ .RelPermalink }}{{ if not .Lastmod.IsZero }} - {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} - {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} - {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} - {{ end }} - {{ end }} - + {{- if .Permalink -}} + + {{ .Permalink }}{{ if not .Lastmod.IsZero }} + {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} + {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} + {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} + {{ end }} + {{ end }} + {{- end -}} {{ end }} From 8c718ed668180c853cc9bc61057625a2114a306b Mon Sep 17 00:00:00 2001 From: Philip Mallegol-Hansen Date: Mon, 6 May 2024 10:01:20 -0700 Subject: [PATCH 09/37] Corrects readNextPosts logic The docs at https://gohugo.io/functions/collections/isset/ specify that the isset function must be called with a lowercase representation of the key we wish to check. If we do not, the function always returns false. --- layouts/_default/single.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 5f466c9..c9a53af 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -23,8 +23,8 @@ {{ $readNextPosts := 3}} - {{ if isset .Site.Params "readNextPosts" }} - {{ $readNextPosts := .Site.Params.readNextPosts }} + {{ if isset .Site.Params "readnextposts" }} + {{ $readNextPosts = .Site.Params.readNextPosts }} {{ end }} {{ if gt $readNextPosts 0 }} From 5583510cddaeca504c0e18ecf597033dff5159b5 Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Tue, 7 May 2024 15:49:30 +0800 Subject: [PATCH 10/37] fix: fix #47 --- assets/css/main.css | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/css/main.css b/assets/css/main.css index da76a9c..2ca1337 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -179,6 +179,7 @@ kbd { line-height: 154%; border-radius: 6px; border: 1px solid var(--pre-border-color); + overflow: scroll; } /* tag */ From 8f622b49cf6acb84ce0817e38e6bf5f7d90f74a7 Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Tue, 7 May 2024 15:56:37 +0800 Subject: [PATCH 11/37] fix: fix the linenumber disappearing because of fix previous bug. --- assets/css/main.css | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/css/main.css b/assets/css/main.css index 2ca1337..419a06c 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -263,6 +263,7 @@ div.highlight pre { div.highlight code { padding-left: 0px; padding-right: 0px; + overflow: unset; } div.highlight code a:hover, From bd3ab84db8d9ac736e7e2a2c423961ef1f84a4eb Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Tue, 7 May 2024 16:03:03 +0800 Subject: [PATCH 12/37] update: change demo site posts order to attract more peoples. --- .../content/posts/demo-code-pre-kbd-mark.md | 2 +- .../content/posts/demo-diagram.md | 2 +- .../content/posts/icons.md | 2 +- .../content/posts/markdown-syntax.md | 25 ++++++++++--------- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/exampleSiteMultilingual/content/posts/demo-code-pre-kbd-mark.md b/exampleSiteMultilingual/content/posts/demo-code-pre-kbd-mark.md index 7e024a4..280fa88 100644 --- a/exampleSiteMultilingual/content/posts/demo-code-pre-kbd-mark.md +++ b/exampleSiteMultilingual/content/posts/demo-code-pre-kbd-mark.md @@ -1,7 +1,7 @@ +++ author = "Hugo Authors" title = "Demo - Support for code, pre, kbd, mark" -date = "2024-04-22" +date = "2024-04-30" description = "Guide to advanced usage of Anubis2" tags = [ "emoji", diff --git a/exampleSiteMultilingual/content/posts/demo-diagram.md b/exampleSiteMultilingual/content/posts/demo-diagram.md index 47d9852..7a09429 100644 --- a/exampleSiteMultilingual/content/posts/demo-diagram.md +++ b/exampleSiteMultilingual/content/posts/demo-diagram.md @@ -1,7 +1,7 @@ +++ author = "Hugo Authors" title = "Demo - Support for Diagrams" -date = "2024-04-19" +date = "2024-05-06" description = "Guide to advanced usage of Anubis2" tags = [ "emoji", diff --git a/exampleSiteMultilingual/content/posts/icons.md b/exampleSiteMultilingual/content/posts/icons.md index 0f85c12..5f8cd12 100644 --- a/exampleSiteMultilingual/content/posts/icons.md +++ b/exampleSiteMultilingual/content/posts/icons.md @@ -1,7 +1,7 @@ +++ author = "Junyi" title = "Demo - Social Icons" -date = "2024-04-23" +date = "2024-05-05" description = "Guide to using social icons supported by Anubis2." tags = [ "icons", diff --git a/exampleSiteMultilingual/content/posts/markdown-syntax.md b/exampleSiteMultilingual/content/posts/markdown-syntax.md index 9524293..a092b24 100644 --- a/exampleSiteMultilingual/content/posts/markdown-syntax.md +++ b/exampleSiteMultilingual/content/posts/markdown-syntax.md @@ -1,7 +1,7 @@ +++ author = "Hugo Authors" title = "Markdown Syntax Guide" -date = "2019-03-11" +date = "2024-05-07" description = "Sample article showcasing basic Markdown syntax and formatting for HTML elements." tags = [ "markdown", @@ -19,24 +19,23 @@ 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. +The following HTML `

`—`

` elements represent 5 levels of section headings. `

` is the highest section level while `

` is the lowest. -# H1 +## H2 -You should not use `# H1` in your markdown file, since the title is `#H1`. +You should using `## H2` as your section title, since the file title is `# H1` -If you use, you will get a warning from linter: +If you use `# H1` as your section title, you will get a warning from linter: ```txt MD025/single-title/single-h1: Multiple top-level headings in the same document ``` -## H2 - ### H3 #### H4 @@ -45,9 +44,11 @@ MD025/single-title/single-h1: Multiple top-level headings in the same document ###### 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. +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? +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. Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat. @@ -61,7 +62,7 @@ The blockquote element represents content that is quoted from another source, op > > **Note** that you can use *Markdown syntax* within a blockquote. -#### Blockquote with attribution +### Blockquote with attribution > Don't communicate by sharing memory, share memory by communicating.

> — Rob Pike[^1] @@ -85,9 +86,9 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou ## Code Blocks -### Code block with backticks +### Code block with backticks and showing highlighted lines -```html +```html {linenos=table, hl_lines=[1,"4-5",8], linenostart=199} @@ -158,6 +159,6 @@ H2O Xn + Yn = Zn -Press CTRL+ALT+Delete to end the session. +Press CTRL+ALT+Delete to end the session. Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. From 2259c04f32651c19e5cba72989137d65c6f7bb8e Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Mon, 13 May 2024 11:03:14 +0800 Subject: [PATCH 13/37] add: added error message when customCSS not exist --- layouts/partials/head.html | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index ea2de2b..12aa20d 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -59,8 +59,17 @@ {{ $opts := dict "transpiler" "libsass" "targetPath" "css/style.css" }} {{ range site.Params.customCSS }} - {{ with resources.Get . | toCSS $opts | minify | fingerprint }} - + {{ $r := "" }} + {{ with resources.Get . }} + {{ $r = . }} + {{ else }} + {{ errorf "error: You defined customCSS, but %s was not found, please check your config." . }} + {{ end }} + + {{ if $r}} + {{ with $r | toCSS $opts | minify | fingerprint }} + + {{ end }} {{ end }} {{ end }} From 8e659b1110e549a4f834fe0272e7ba8ef2c584d0 Mon Sep 17 00:00:00 2001 From: Vlad Grigorian <43073227+massifsurfer@users.noreply.github.com> Date: Sat, 8 Jun 2024 20:33:09 +0300 Subject: [PATCH 14/37] Create ce.yaml i18n for Chechen language --- i18n/ce.yaml | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 i18n/ce.yaml diff --git a/i18n/ce.yaml b/i18n/ce.yaml new file mode 100644 index 0000000..4c2a054 --- /dev/null +++ b/i18n/ce.yaml @@ -0,0 +1,56 @@ +powered: + other: "Озорг" + +theme: + other: "тем" + +readMore: + other: "ДӀаеша" + +toNewPosts: + other: "керла дӀаяздаршка хӀо" + +toOldPosts: + other: "тиша дӀаяздаршка хӀо" + +tag: + other: "тег" + +Tags: + other: "Тегаш" + +Posts: + other: "ДӀаяздарш" + +category: + other: "категори" + +Categories: + other: "Категореш" + +toAllTags: + other: "тегаш лемаре хӀо" + +toAllAuthors: + other: "авторш лемаре хӀо" + +toAllCategories: + other: "категореш лемаре хӀо" + +skipToContent: + other: "коьрта контенте хӀо" + +readNext: + other: "ДӀаеша" + +lastMod: + other: "йуха яздин ю:" + +toNewPost: + other: "керла д1аяздаре хӀо" + +toOldPost: + other: "тиша дӀаяздаре хӀо" + +videoIsNotSupported: + other: "хӀа браузер окх видео цан болх ца бо" From 14d077743709c393b09a83f4fe302d2b3064fdf1 Mon Sep 17 00:00:00 2001 From: Joao Senger Date: Tue, 11 Jun 2024 10:21:37 -0300 Subject: [PATCH 15/37] feat: googleAnalytics --- .hugo_build.lock | 0 exampleSiteMultilingual/hugo.toml | 6 +++++- layouts/partials/google_analytics.html | 8 ++++++++ layouts/partials/head.html | 4 ++-- 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 .hugo_build.lock create mode 100644 layouts/partials/google_analytics.html diff --git a/.hugo_build.lock b/.hugo_build.lock new file mode 100644 index 0000000..e69de29 diff --git a/exampleSiteMultilingual/hugo.toml b/exampleSiteMultilingual/hugo.toml index 7149232..185b37f 100644 --- a/exampleSiteMultilingual/hugo.toml +++ b/exampleSiteMultilingual/hugo.toml @@ -168,4 +168,8 @@ 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" \ No newline at end of file +shareUrl = "https://eu.umami.is/share/RIETUMwZn4IBMIr8/hugo-theme-anubis2.netlify.app" + +[params.GoogleAnalytics] +enabled = true +gtag = "G-T5LM1515MT" \ No newline at end of file diff --git a/layouts/partials/google_analytics.html b/layouts/partials/google_analytics.html new file mode 100644 index 0000000..9751923 --- /dev/null +++ b/layouts/partials/google_analytics.html @@ -0,0 +1,8 @@ + + + \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index ea2de2b..aabe2c7 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -103,8 +103,8 @@ --> -{{ if and (.Site.GoogleAnalytics) (hugo.IsProduction) }} - {{ template "_internal/google_analytics.html" . }} +{{ if (.Site.Params.GoogleAnalytics.enabled) }} + {{ partial "google_analytics.html" . }} {{ end }} {{ if (.Site.Params.UmamiAnalytics.enabled ) }} From 728414737c65cd059ef67e8c3980f5eee493992b Mon Sep 17 00:00:00 2001 From: Joao Senger Date: Tue, 11 Jun 2024 10:27:58 -0300 Subject: [PATCH 16/37] fix: googleAnalytics --- .hugo_build.lock | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .hugo_build.lock diff --git a/.hugo_build.lock b/.hugo_build.lock deleted file mode 100644 index e69de29..0000000 From f5bb357b12fd99f55262672cc38c342dd310553a Mon Sep 17 00:00:00 2001 From: Joao Senger Date: Tue, 11 Jun 2024 10:36:37 -0300 Subject: [PATCH 17/37] fix: gtagexample --- exampleSiteMultilingual/hugo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exampleSiteMultilingual/hugo.toml b/exampleSiteMultilingual/hugo.toml index 185b37f..f8eabb9 100644 --- a/exampleSiteMultilingual/hugo.toml +++ b/exampleSiteMultilingual/hugo.toml @@ -172,4 +172,4 @@ shareUrl = "https://eu.umami.is/share/RIETUMwZn4IBMIr8/hugo-theme-anubis2.netlif [params.GoogleAnalytics] enabled = true -gtag = "G-T5LM1515MT" \ No newline at end of file +gtag = "G-TAGEXAMPLE" \ No newline at end of file From d3d75410777fb28d0cec71d717a15586c2af9e8f Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Fri, 14 Jun 2024 15:33:49 +0800 Subject: [PATCH 18/37] update Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 75542eb..96b39df 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Inside the folder of your Hugo site, run: git submodule add https://github.com/Junyi-99/hugo-theme-anubis2.git themes/anubis2 ``` -For more information read the official [setup guide](https://gohugo.io/overview/installing/) of Hugo. +For more information read the [official setup guide of Hugo](https://gohugo.io/installation/). ### Configure your site From 793e1778cb4b90430c517abeaffbd197b979862d Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Fri, 14 Jun 2024 15:40:38 +0800 Subject: [PATCH 19/37] update readme --- README.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 96b39df..5653e33 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,13 @@ Anubis2 is another simple minimalist theme for [Hugo blog engine](https://gohugo - Mobile Support - [Full Features](wiki/Full-Features) -## Installation +## Installation & Configuration You need to install an extended version of Hugo to run this theme. -### As Git Submodule +For more information read the [official setup guide of Hugo](https://gohugo.io/installation/). + +### Install theme as Git Submodule Inside the folder of your Hugo site, run: @@ -30,11 +32,11 @@ Inside the folder of your Hugo site, run: git submodule add https://github.com/Junyi-99/hugo-theme-anubis2.git themes/anubis2 ``` -For more information read the [official setup guide of Hugo](https://gohugo.io/installation/). +That's all, let's configure anubis2. ### Configure your site -Don't be panic, configure Anubis2 is really simple. +Don't be panic, configure Anubis2 is really **simple**. **This is the minimum configuration:** @@ -56,17 +58,19 @@ style = 'base16-snazzy' # Highlight.js style You are encouraged keeping other fields as defaults and fine-tune them when you have time! (see [Full Configuration Examples](https://github.com/Junyi-99/hugo-theme-anubis2/wiki/Configuration-Example)) +In the other way, you can check out the example site's [configuration file](exampleSiteMultilingual/hugo.toml) + ## Run your site -In order to see your site in action, run Hugo's built-in local server. +In order to see your site, run Hugo's built-in local server. ```bash hugo server ``` -Now enter [`http://localhost:1313`](http://localhost:1313/) in the address bar of your browser. +Now enter [`http://localhost:1313`](http://localhost:1313/) in the address bar of your browser to open your site. -## Update to the latest version +## Update Anubis2 to the latest version In your Hugo site folder, run this command: @@ -79,4 +83,5 @@ git submodule update --remote If you find a bug or have an idea for a feature, feel free to write an [issue](https://github.com/Junyi-99/hugo-theme-anubis2/issues) or make a PR. ## License + MIT © Junyi, 2024 From 0ceec0db715d4a04430597a4c537ee9efa4e5836 Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Fri, 14 Jun 2024 15:48:44 +0800 Subject: [PATCH 20/37] update GoogleAnalytics for ExampleSite --- exampleSiteMultilingual/hugo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exampleSiteMultilingual/hugo.toml b/exampleSiteMultilingual/hugo.toml index f8eabb9..f4be162 100644 --- a/exampleSiteMultilingual/hugo.toml +++ b/exampleSiteMultilingual/hugo.toml @@ -165,11 +165,11 @@ tabWidth = 4 [params.UmamiAnalytics] enabled = true dnt = false -id = "e4f661ff-9a8c-49d4-b3cc-2efe553e3973" # Website ID +id = "d01ce82c-c8f4-4714-ba37-ba4899f2a885" # Website ID datacache = false -url = "https://eu.umami.is/script.js" -shareUrl = "https://eu.umami.is/share/RIETUMwZn4IBMIr8/hugo-theme-anubis2.netlify.app" +url = "https://umami.xtra.science/script.js" +shareUrl = "https://umami.xtra.science/share/Fy0goUn0b9rrxxGe/hugo-theme-anubis2.netlify.app" [params.GoogleAnalytics] enabled = true -gtag = "G-TAGEXAMPLE" \ No newline at end of file +gtag = "G-32F16X8HLF" \ No newline at end of file From 680690250166c47cb0754422f1a71430cc4d0572 Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Thu, 25 Jul 2024 16:08:42 +0800 Subject: [PATCH 21/37] add feat: load "icon.svg" in the posts foler --- layouts/partials/post-summary.html | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/layouts/partials/post-summary.html b/layouts/partials/post-summary.html index 18f991e..732f7b1 100644 --- a/layouts/partials/post-summary.html +++ b/layouts/partials/post-summary.html @@ -1,7 +1,24 @@
-

{{ trim .Title " " | markdownify }}

+ {{ $random := (md5 .Title) }} + {{ $iconPath := printf "%s/icon.svg" .File.Dir }} + {{ if fileExists $iconPath }} + + {{ end }} +

+ {{ trim .Title " " | markdownify }} +

{{ partial "post-language-switcher.html" . }}
@@ -11,6 +28,7 @@ {{ .Summary | safeHTML }}
{{ end }} + {{ if and (.Truncated) (.Site.Params.readMore) }}
{{ i18n "readMore" }} From 9b689084a31e1043ddcff3e78c16c1910a1609e2 Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Thu, 15 Aug 2024 13:43:06 +0800 Subject: [PATCH 22/37] upgrade DisqusShortname --- layouts/partials/comments.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index aae2a24..3e3a652 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -1,4 +1,4 @@ -{{ if .Site.DisqusShortname }} +{{ if .Site.Config.Services.Disqus.Shortname }} {{ partial "disqus.html" . }} {{ end }} From f53cc0573b961a87831abebfe333a88808cf78ff Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Thu, 15 Aug 2024 15:54:53 +0800 Subject: [PATCH 23/37] upgrade config --- layouts/_default/rss.xml | 26 ++++++++++++++++++++++---- layouts/partials/footer.html | 2 +- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 15a4ed7..7dccba1 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -12,9 +12,27 @@ {{ .RelPermalink }} {{ .Site.Title }}{{ if ne .Title .Site.Title }}{{ with .Title }} ({{.}}){{ end }}{{ end }} Hugo -- gohugo.io{{ with .Site.LanguageCode }} - {{.}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} + {{.}}{{end}} + {{ with .Site.Params.author }} + {{ with .email }} + {{.}} + {{ with $.Site.Params.author.name }} + ({{.}}) + {{end}} + + {{end}} + + {{ with .Site.Params.author.email }} + + {{.}} + {{ with $.Site.Params.author.name }} + ({{.}}) + {{end}} + + {{end}} + {{ end }} + + {{ with .Site.Copyright }} {{.}}{{end}}{{ if not .Date.IsZero }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} {{ with .OutputFormats.Get "RSS" }} @@ -25,7 +43,7 @@ {{ .Title }} {{ .RelPermalink }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ with .Site.Params.author.email }}{{.}}{{ with $.Site.Params.author.name }} ({{.}}){{end}}{{end}} {{ .RelPermalink }} {{ .Content | html }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index ea511b7..5a01e1f 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -15,7 +15,7 @@ {{ end }}
- © {{ if isset .Site.Author "name"}}{{ .Site.Author.name }}, {{end}}{{ now.Year }} + © {{ if isset .Site.Params.author "name"}}{{ .Site.Params.author.name }}, {{end}}{{ now.Year }} {{ if .Site.Params.UmamiAnalytics.shareUrl }} {{ end }} From 422f416612f6c65a232ca947eff21179ae2a508a Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Wed, 11 Sep 2024 11:57:49 +0800 Subject: [PATCH 24/37] align with latest Hugo. Hugo is a piece of shit! --- exampleSiteMultilingual/hugo.toml | 8 +++++--- layouts/_default/single.html | 6 +++--- layouts/partials/footer.html | 18 +++++++++--------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/exampleSiteMultilingual/hugo.toml b/exampleSiteMultilingual/hugo.toml index f4be162..8a0757e 100644 --- a/exampleSiteMultilingual/hugo.toml +++ b/exampleSiteMultilingual/hugo.toml @@ -3,11 +3,13 @@ languageCode = "en-us" defaultContentLanguage = "en" title = "Anubis2 Demo Site" theme = "anubis2" -paginate = 5 - disqusShortname = "" -[author] +[pagination] +pagerSize = 5 + + +[params.author] name = "Junyi" email = "me@junyi.dev" location = "Singapore" diff --git a/layouts/_default/single.html b/layouts/_default/single.html index c9a53af..296faa9 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -23,8 +23,8 @@ {{ $readNextPosts := 3}} - {{ if isset .Site.Params "readnextposts" }} - {{ $readNextPosts = .Site.Params.readNextPosts }} + {{ if site.Params.readNextPosts }} + {{ $readNextPosts = site.Params.readNextPosts }} {{ end }} {{ if gt $readNextPosts 0 }} @@ -56,7 +56,7 @@ {{ partial "resource.html" (dict "context" . "type" "js" "filename" "js/load-mermaid.js") }} {{ $colorTheme := "light" }} - {{ if and (isset site.Params "colortheme") (ne site.Params.colortheme "") }} + {{ if and (site.Params.colortheme) (ne site.Params.colortheme "") }} {{ $colorTheme = site.Params.colortheme | lower }} {{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 5a01e1f..1a0917d 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -5,23 +5,23 @@ {{ end }}