From 7796d621f0526a8efacfe35072d6bb1abaac6807 Mon Sep 17 00:00:00 2001 From: Althorion Date: Fri, 24 Dec 2021 00:05:23 +0100 Subject: [PATCH 01/33] Fix typos in Polish translation --- i18n/pl.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i18n/pl.yaml b/i18n/pl.yaml index 5233c63..5c8b759 100644 --- a/i18n/pl.yaml +++ b/i18n/pl.yaml @@ -8,7 +8,7 @@ readMore: other: "czytaj dalej" toNewPosts: - other: "poprzedia strona" + other: "poprzednia strona" toOldPosts: other: "następna strona" @@ -41,4 +41,4 @@ darkTheme: other: "ciemny schemat" lightTheme: - other: "lekki schemat" + other: "jasny schemat" From 0c92c7b71a25ea4cbe64e23b8a84b35f4d848150 Mon Sep 17 00:00:00 2001 From: Dmitry Kolosov Date: Thu, 23 Dec 2021 21:56:08 +0300 Subject: [PATCH 02/33] add hidden page param #124 --- README.md | 8 ++++++-- exampleSite/content/post/hidden-post.md | 12 ++++++++++++ exampleSiteMultilingual/content/post/hidden-post.md | 12 ++++++++++++ .../content/post/hidden-post.pl.md | 12 ++++++++++++ layouts/_default/list.html | 4 ++-- layouts/_default/rss.xml | 2 +- layouts/_default/taxonomy.html | 3 ++- layouts/index.html | 2 +- 8 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 exampleSite/content/post/hidden-post.md create mode 100644 exampleSiteMultilingual/content/post/hidden-post.md create mode 100644 exampleSiteMultilingual/content/post/hidden-post.pl.md diff --git a/README.md b/README.md index 0e3db84..78b376a 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/). - Utteranc.es - RSS feeds - Hiding posts from the RSS feed +- Hidden posts (available only by link) - Translations (en, ru, fr, pl) - Custom CSS/JS - Multilingual mode @@ -192,10 +193,13 @@ Based on environment. For production — allow all, for other — disallow all. ### Favorite posts -To mark posts as favorite just add `favorite: true` in post's front matter. It adds a "★" icon nearby post's title. +Add `favorite: true` to post front matter. It adds a "★" icon nearby post's title. ### Hiding posts from RSS -To hide a post from the RSS feed, just add `disable_feed: true` to its front matter. +Add `disable_feed: true` to post front matter. + +### Make post available only by link +Add `hidden: true` to post front matter. Post also is not available in RSS feed. ### Pagination on post single page Enabled by `paginationSinglePost` param in `params` section of config. diff --git a/exampleSite/content/post/hidden-post.md b/exampleSite/content/post/hidden-post.md new file mode 100644 index 0000000..4239564 --- /dev/null +++ b/exampleSite/content/post/hidden-post.md @@ -0,0 +1,12 @@ ++++ +author = "Dmitry Kolosov" +title = "Hidden Post" +date = "2021-12-24" +description = "Post available only by link" +tags = [ + "privacy" +] +hidden = true ++++ + +This is hidden post \ No newline at end of file diff --git a/exampleSiteMultilingual/content/post/hidden-post.md b/exampleSiteMultilingual/content/post/hidden-post.md new file mode 100644 index 0000000..4239564 --- /dev/null +++ b/exampleSiteMultilingual/content/post/hidden-post.md @@ -0,0 +1,12 @@ ++++ +author = "Dmitry Kolosov" +title = "Hidden Post" +date = "2021-12-24" +description = "Post available only by link" +tags = [ + "privacy" +] +hidden = true ++++ + +This is hidden post \ No newline at end of file diff --git a/exampleSiteMultilingual/content/post/hidden-post.pl.md b/exampleSiteMultilingual/content/post/hidden-post.pl.md new file mode 100644 index 0000000..4239564 --- /dev/null +++ b/exampleSiteMultilingual/content/post/hidden-post.pl.md @@ -0,0 +1,12 @@ ++++ +author = "Dmitry Kolosov" +title = "Hidden Post" +date = "2021-12-24" +description = "Post available only by link" +tags = [ + "privacy" +] +hidden = true ++++ + +This is hidden post \ No newline at end of file diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 02500a2..2f6d7c4 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -5,11 +5,11 @@

{{ i18n .Title }}

- {{ $pages := where .Pages "Type" "in" site.Params.mainSections }} + {{ $pages := where (where .Pages "Type" "in" site.Params.mainSections) "Params.hidden" "!=" true}} {{ range $pages }}
-
+

{{ trim .Title " " }}

{{ partial "post-language-switcher.html" . }}
diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index cb728d9..cc620f4 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -1,6 +1,6 @@ {{- $pctx := . -}} {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} -{{- $pages := where $pctx.RegularPages ".Params.disable_feed" "!=" true -}} +{{- $pages := where (where $pctx.RegularPages ".Params.disable_feed" "!=" true) "Params.hidden" "!=" true -}} {{- $limit := .Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} {{- $pages = $pages | first $limit -}} diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index c31cfb9..9c04382 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -3,7 +3,8 @@ - {{ range .Paginator.Pages }} + {{ $pages := where .Pages "Params.hidden" "!=" true }} + {{ range (.Paginate $pages).Pages }} {{ partial "post-summary.html" . }} {{ end }} {{ partial "pagination.html" . }} diff --git a/layouts/index.html b/layouts/index.html index ed4e128..44f2764 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -4,7 +4,7 @@
- {{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} + {{ $pages := where (where site.RegularPages "Type" "in" site.Params.mainSections) "Params.hidden" "!=" true }} {{ range (.Paginate $pages).Pages }} {{ partial "post-summary.html" . }} {{ end }} From 36f693a61cfb1fc9b113ee294f9ea9ee3e872cf2 Mon Sep 17 00:00:00 2001 From: Dmitry Kolosov Date: Mon, 27 Dec 2021 20:17:40 +0300 Subject: [PATCH 03/33] do not count hidden pages in taxonomy pages #124 --- layouts/_default/terms.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index d4e745e..60e624a 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -4,15 +4,15 @@

{{ i18n .Title }}

-
    - {{ range $key, $value := .Data.Terms }} -
  • - - {{ $key }} - - ({{ len $value }}) -
  • + {{ range .Data.Terms }} + {{ $postsNum := len (where .Pages "Params.hidden" "!=" true) }} + {{ if gt $postsNum 0 }} +
  • + {{ .Page.Title }} + ({{ $postsNum }}) +
  • + {{ end}} {{ end }}
From 68892b834f0e4feb403c8505324896eb344ceab5 Mon Sep 17 00:00:00 2001 From: Dmitry Kolosov Date: Mon, 27 Dec 2021 20:18:00 +0300 Subject: [PATCH 04/33] hide hidden page from search engines #124 --- layouts/partials/head.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 6fd87a9..e882d5d 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -7,6 +7,10 @@ {{ partial "title.html" . }} +{{ if and (.IsPage) (eq .Params.hidden true)}} + +{{ end }} + {{ with .OutputFormats.Get "rss" -}} {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ end -}} From fb130db4c376574a9000049da9d70ff378017eb6 Mon Sep 17 00:00:00 2001 From: Dmitry Kolosov Date: Thu, 23 Dec 2021 13:36:05 +0300 Subject: [PATCH 05/33] add anchor headings #123 --- assets/css/main.css | 52 +++++++++++++++++++- layouts/_default/_markup/render-heading.html | 3 ++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 layouts/_default/_markup/render-heading.html diff --git a/assets/css/main.css b/assets/css/main.css index 23df334..a190725 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -341,7 +341,6 @@ article:not(:last-of-type) { padding-bottom: 2em; } - article header h1 { font-size: 1.35em; line-height: 1.1em; @@ -356,6 +355,57 @@ article header h1 a { text-decoration: none; } +.post h1, +.post h2, +.post h3, +.post h4, +.post h5, +.post h6 { + position: relative; +} + +.post h1 a, +.post h2 a, +.post h3 a, +.post h4 a, +.post h5 a, +.post h6 a { + opacity: 0; + position: absolute; + left: -0.7em; + color: var(--font-color); +} + +.post h1:hover a, +.post h2:hover a, +.post h3:hover a, +.post h4:hover a, +.post h5:hover a, +.post h6:hover a { + opacity: 1; +} + +.post h1:hover a:hover, +.post h1:hover a:focus, +.post h1:hover a:active, +.post h2:hover a:hover, +.post h2:hover a:focus, +.post h2:hover a:active, +.post h3:hover a:hover, +.post h3:hover a:focus, +.post h3:hover a:active, +.post h4:hover a:hover, +.post h4:hover a:focus, +.post h4:hover a:active, +.post h5:hover a:hover, +.post h5:hover a:focus, +.post h5:hover a:active, +.post h6:hover a:hover, +.post h6:hover a:focus, +.post h6:hover a:active { + color: var(--link-state-color); +} + .post-info { color: var(--post-info-color); font-size: 0.75em; diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000..7e34fa1 --- /dev/null +++ b/layouts/_default/_markup/render-heading.html @@ -0,0 +1,3 @@ +{{ .Text | safeHTML }} +# + \ No newline at end of file From a5e44ced3cd23c1a09ed137592f772c30532081a Mon Sep 17 00:00:00 2001 From: Dmitry Kolosov Date: Mon, 27 Dec 2021 23:02:57 +0300 Subject: [PATCH 06/33] changed anchor to icon #123 --- assets/css/main.css | 3 ++- layouts/_default/_markup/render-heading.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index a190725..46784e5 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -372,7 +372,7 @@ article header h1 a { .post h6 a { opacity: 0; position: absolute; - left: -0.7em; + left: -1.05rem; color: var(--font-color); } @@ -404,6 +404,7 @@ article header h1 a { .post h6:hover a:focus, .post h6:hover a:active { color: var(--link-state-color); + border-bottom: none; } .post-info { diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html index 7e34fa1..8a9dbb1 100644 --- a/layouts/_default/_markup/render-heading.html +++ b/layouts/_default/_markup/render-heading.html @@ -1,3 +1,3 @@ {{ .Text | safeHTML }} -# + \ No newline at end of file From 5d199f595ee98be3c458570abf9d0572fa4900d5 Mon Sep 17 00:00:00 2001 From: Dmitry Kolosov Date: Mon, 27 Dec 2021 23:06:21 +0300 Subject: [PATCH 07/33] Revert "changed anchor to icon #123" This reverts commit a5e44ced3cd23c1a09ed137592f772c30532081a. --- assets/css/main.css | 3 +-- layouts/_default/_markup/render-heading.html | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index 46784e5..a190725 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -372,7 +372,7 @@ article header h1 a { .post h6 a { opacity: 0; position: absolute; - left: -1.05rem; + left: -0.7em; color: var(--font-color); } @@ -404,7 +404,6 @@ article header h1 a { .post h6:hover a:focus, .post h6:hover a:active { color: var(--link-state-color); - border-bottom: none; } .post-info { diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html index 8a9dbb1..7e34fa1 100644 --- a/layouts/_default/_markup/render-heading.html +++ b/layouts/_default/_markup/render-heading.html @@ -1,3 +1,3 @@ {{ .Text | safeHTML }} - +# \ No newline at end of file From eaafa7cfde61e1b851309031992213609aa22d4a Mon Sep 17 00:00:00 2001 From: Jixun Wu Date: Fri, 31 Dec 2021 19:48:26 +0000 Subject: [PATCH 08/33] fix: allow emoji to be used in i18n override --- layouts/_default/baseof.html | 2 +- layouts/partials/footer.html | 2 +- layouts/partials/post-summary.html | 2 +- layouts/partials/theme-switcher.html | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 97bfae4..a0ea13d 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -10,7 +10,7 @@ {{ end }} - {{ i18n "skipToContent" | humanize }} + {{ i18n "skipToContent" }}
{{ block "header" . }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index fe1ba38..46dea49 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -15,7 +15,7 @@ {{ end }} diff --git a/layouts/partials/post-summary.html b/layouts/partials/post-summary.html index 618c280..06dc4a9 100644 --- a/layouts/partials/post-summary.html +++ b/layouts/partials/post-summary.html @@ -13,7 +13,7 @@ {{ end }} {{ if and (.Truncated) (.Site.Params.readMore) }} {{ end }} diff --git a/layouts/partials/theme-switcher.html b/layouts/partials/theme-switcher.html index 5e8de97..6ee5cef 100644 --- a/layouts/partials/theme-switcher.html +++ b/layouts/partials/theme-switcher.html @@ -5,7 +5,7 @@ {{ if not (in (slice "light-without-switcher" "dark-without-switcher" "auto-without-switcher") $style) }} -{{ end }} \ No newline at end of file + changeButtonText() +} + +function showContent() { + document.body.style.visibility = 'visible'; + document.body.style.opacity = 1; +} + \ No newline at end of file From 6d928371d58ad9b5697e729e31ce9043639787ef Mon Sep 17 00:00:00 2001 From: SteveYi Date: Tue, 22 Feb 2022 03:34:46 +0800 Subject: [PATCH 23/33] Add 404 Page --- layouts/404.html | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 layouts/404.html diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..4a96310 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,8 @@ +{{ define "main"}} +
+
+

Go Home

+ Sorry, This Page is not available. +
+
+{{ end }} From e98fcde09aa28f625977052b5ee8c3fe3e01c22b Mon Sep 17 00:00:00 2001 From: Dmitry Kolosov Date: Tue, 22 Feb 2022 18:38:27 +0300 Subject: [PATCH 24/33] added support for meta keywords #137 --- layouts/partials/head.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index e62029c..dfbc9f7 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -7,6 +7,10 @@ {{ partial "title.html" . }} +{{ with .Keywords }} + +{{ end }} + {{ if and (.IsPage) (eq .Params.hidden true)}} {{ end }} From 50b0d8dc73659187671b5b81a23cf5d5be3fc5ef Mon Sep 17 00:00:00 2001 From: SteveYi Date: Wed, 23 Feb 2022 00:35:22 +0800 Subject: [PATCH 25/33] Fix suggestion --- layouts/404.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/404.html b/layouts/404.html index 4a96310..4ad6603 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,8 +1,8 @@ {{ define "main"}}
-

Go Home

- Sorry, This Page is not available. +

Go Home

+ Sorry, this Page is not available.
-{{ end }} +{{ end }} \ No newline at end of file From 18196328d7185ab281a06706e2a72206b4e46859 Mon Sep 17 00:00:00 2001 From: Syahravi Date: Sat, 26 Feb 2022 15:13:01 +0700 Subject: [PATCH 26/33] add graphcomment --- exampleSite/config.toml | 5 ++++- exampleSiteMultilingual/config.toml | 5 ++++- layouts/partials/graphcomment.html | 32 +++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 layouts/partials/graphcomment.html diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 5e3d15a..e1d58c4 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -21,6 +21,9 @@ readNextPosts = 2 copyCodeButton = true rssAsSocialIcon = true +# Graphcomment support +graphcommentId = "" + # utteranc.es support utterancesRepo = "" # mandatory utterancesTheme = "" # optional @@ -60,4 +63,4 @@ category = "categories" tag = "tags" [markup.goldmark.renderer] -unsafe = true \ No newline at end of file +unsafe = true diff --git a/exampleSiteMultilingual/config.toml b/exampleSiteMultilingual/config.toml index a18faea..e8cfc91 100644 --- a/exampleSiteMultilingual/config.toml +++ b/exampleSiteMultilingual/config.toml @@ -22,6 +22,9 @@ readNextPosts = 2 copyCodeButton = true rssAsSocialIcon = true +# Graphcomment support +graphcommentId = "" + # utteranc.es support utterancesRepo = "" # mandatory utterancesTheme = "" # optional @@ -83,4 +86,4 @@ category = "categories" tag = "tags" [markup.goldmark.renderer] -unsafe = true \ No newline at end of file +unsafe = true diff --git a/layouts/partials/graphcomment.html b/layouts/partials/graphcomment.html new file mode 100644 index 0000000..41960a7 --- /dev/null +++ b/layouts/partials/graphcomment.html @@ -0,0 +1,32 @@ +
+ From 17155479e02d4363c8aedd4047f938fbecf4ef30 Mon Sep 17 00:00:00 2001 From: Syahravi Date: Sat, 26 Feb 2022 15:21:10 +0700 Subject: [PATCH 27/33] merge single.html partial graphcomment --- layouts/_default/single.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 4202051..c25a022 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -49,4 +49,8 @@ {{ partial "isso.html" . }} {{ end }} + {{ if .Site.Params.graphcommentId }} + {{ partial "graphcomment.html" . }} + {{ end }} + {{ end }} From 6c20822bc16bae781f66624f4edcc2729c0f29a5 Mon Sep 17 00:00:00 2001 From: Dmitry Kolosov Date: Sat, 26 Feb 2022 17:30:52 +0300 Subject: [PATCH 28/33] Add GraphComment info to Readme --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5d5e04c..eb35279 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,7 @@ Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/). - Mobile support - Social icons - Google Analytics -- Disqus -- ISSO -- Utteranc.es +- Comment systems: Disqus, ISSO, Utteranc.es, GraphComment - RSS feeds - Related posts (Read Next section) - Deploy via Netlify (config included in example site) @@ -106,6 +104,7 @@ params: id: "thread-id" # optional avatar: true # optional avatar-bg: "#f0f0f0" # optional + graphcommentId: "" webmentions: url: https://yourdomain.com/webemntions/receive login: hugo-theme-anubis From 47c089fcd9af53030061712482f8d5cd007e1fbe Mon Sep 17 00:00:00 2001 From: Vinay Pandey Date: Tue, 5 Apr 2022 23:19:12 -0700 Subject: [PATCH 29/33] Initialise `go` module * This will enable the theme to be imported as `hugo` module with a simple `module.imports` in the `config` file * Removes the messy git submodule --- go.mod | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 go.mod diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..f3d87a2 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/Mitrichius/hugo-theme-anubis + +go 1.18 From 3024735e3796294c83e0dd3c70769905c8344167 Mon Sep 17 00:00:00 2001 From: Carson Chen Date: Sun, 10 Apr 2022 09:34:06 +0800 Subject: [PATCH 30/33] fix: theme switcher not change button text --- layouts/partials/theme-switcher.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/theme-switcher.html b/layouts/partials/theme-switcher.html index f3eff3c..ab97e84 100644 --- a/layouts/partials/theme-switcher.html +++ b/layouts/partials/theme-switcher.html @@ -58,7 +58,7 @@ function detectCurrentScheme() { return 'light' } -function changeButtonText(switchButton) +function changeButtonText() { if (switchButton) { switchButton.textContent = currentTheme == 'dark' ? {{ i18n "lightTheme" }} : {{ i18n "darkTheme" }} From c4665390d2a33a31b2b6ad1a7fd7cd9a6f9c1795 Mon Sep 17 00:00:00 2001 From: Dmitry Kolosov Date: Mon, 11 Apr 2022 21:10:25 +0300 Subject: [PATCH 31/33] change pre colors #148 --- assets/css/dark.css | 4 ++-- assets/css/light.css | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/css/dark.css b/assets/css/dark.css index a78d184..927a7cc 100644 --- a/assets/css/dark.css +++ b/assets/css/dark.css @@ -12,8 +12,8 @@ --nav-bg-color: #242424; --nav-link-color: #b6b6b6; ---pre-color: #333; ---pre-bg-color: #f1f1f1; +--pre-color: #f8f8f2; +--pre-bg-color: #272822; --bq-color: #ccc; --hr-color: #333; diff --git a/assets/css/light.css b/assets/css/light.css index 8216e42..3bb2fad 100644 --- a/assets/css/light.css +++ b/assets/css/light.css @@ -13,8 +13,8 @@ --nav-bg-color: #fafafa; --nav-link-color: #696969; - --pre-color: #333; - --pre-bg-color: #f1f1f1; + --pre-color: #f8f8f2; + --pre-bg-color: #272822; --bq-color: #ccc; --hr-color: #ccc; From ae6b41de47179464b5cb5742a8cbfd11499cce4a Mon Sep 17 00:00:00 2001 From: Dmitry Kolosov Date: Tue, 12 Apr 2022 20:11:58 +0300 Subject: [PATCH 32/33] add disableComments option #147 --- README.md | 3 +++ layouts/_default/single.html | 17 ++--------------- layouts/partials/comments.html | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 layouts/partials/comments.html diff --git a/README.md b/README.md index eb35279..b3098a4 100644 --- a/README.md +++ b/README.md @@ -233,6 +233,9 @@ Enabled by `paginationSinglePost` param in `params` section of config. To provide webmention support you can **either** specify your webmention.io username with `login: webmentionusername` **or** specify a link to your custom webmention endpoint with `url: https://yourdomain.com/webemntions/receive`. If you use webmention.io you can also enable pingback with `pingback: true` +### Disabling comments per-page basis +Add `disableComments: true` to post front matter. + ## Contributing If you find a bug or have an idea for a feature, feel free to write an [issue](https://github.com/mitrichius/hugo-theme-anubis/issues) or make a PR. diff --git a/layouts/_default/single.html b/layouts/_default/single.html index c25a022..a7905bc 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -37,20 +37,7 @@ {{ partial "post-pagination.html" . }} {{ end }} - {{ if .Site.DisqusShortname }} - {{ partial "disqus.html" . }} + {{ if not .Params.disableComments }} + {{ partial "comments.html" . }} {{ end }} - - {{ if .Site.Params.UtterancesRepo }} - {{ partial "utterances.html" . }} - {{ end }} - - {{ if .Site.Params.isso.enabled }} - {{ partial "isso.html" . }} - {{ end }} - - {{ if .Site.Params.graphcommentId }} - {{ partial "graphcomment.html" . }} - {{ end }} - {{ end }} diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html new file mode 100644 index 0000000..079e0f9 --- /dev/null +++ b/layouts/partials/comments.html @@ -0,0 +1,15 @@ +{{ if .Site.DisqusShortname }} + {{ partial "disqus.html" . }} +{{ end }} + +{{ if .Site.Params.UtterancesRepo }} + {{ partial "utterances.html" . }} +{{ end }} + +{{ if .Site.Params.isso.enabled }} + {{ partial "isso.html" . }} +{{ end }} + +{{ if .Site.Params.graphcommentId }} + {{ partial "graphcomment.html" . }} +{{ end }} From edc508fa62c02db92a74ce7e38533f2fc8415904 Mon Sep 17 00:00:00 2001 From: Dmitry Kolosov Date: Sat, 21 May 2022 14:51:30 +0300 Subject: [PATCH 33/33] fix single page menu urls, update example sites #151 --- exampleSite/content/about-subpage.md | 23 ++++++++------- exampleSite/content/about-subpage2.md | 24 +++++++++++++++ exampleSite/content/about.md | 20 ++++++------- .../content/about-subpage.md | 24 +++++++++++++++ .../content/about-subpage.pl.md | 24 +++++++++++++++ .../content/about-subpage2.md | 24 +++++++++++++++ .../content/about-subpage2.pl.md | 24 +++++++++++++++ exampleSiteMultilingual/content/about.md | 29 ++++++++++++++----- exampleSiteMultilingual/content/about.pl.md | 29 ++++++++++++++----- layouts/_default/single.html | 2 +- 10 files changed, 187 insertions(+), 36 deletions(-) create mode 100644 exampleSite/content/about-subpage2.md create mode 100644 exampleSiteMultilingual/content/about-subpage.md create mode 100644 exampleSiteMultilingual/content/about-subpage.pl.md create mode 100644 exampleSiteMultilingual/content/about-subpage2.md create mode 100644 exampleSiteMultilingual/content/about-subpage2.pl.md diff --git a/exampleSite/content/about-subpage.md b/exampleSite/content/about-subpage.md index 1d1dc16..f499aa6 100644 --- a/exampleSite/content/about-subpage.md +++ b/exampleSite/content/about-subpage.md @@ -1,23 +1,24 @@ --- -title: "Subpage" -description: "Just a subpage of about" +title: "About subpage" +description: "About subpage" date: "2019-02-28" author: "Hugo Authors" slug: /about/subpage menu: about: - identifier: about - name: About - title: About - url: /about + identifier: about-subpage-s + parent: about + name: About Subpage + title: About Subpage + url: /about/subpage/ weight: 1 subpage: - identifier: subpage + identifier: about-subpage2-s parent: about - name: Subpage - title: Subpage - url: /about/subpage/ + name: Second About subpage + title: Second About subpage + url: /about/subpage2/ weight: 10 --- -Just a subpage of About. +About subpage diff --git a/exampleSite/content/about-subpage2.md b/exampleSite/content/about-subpage2.md new file mode 100644 index 0000000..7963032 --- /dev/null +++ b/exampleSite/content/about-subpage2.md @@ -0,0 +1,24 @@ +--- +title: "Second About subpage" +description: "Second About subpage" +date: "2019-02-28" +author: "Hugo Authors" +slug: /about/subpage2 +menu: + about: + identifier: about-subpage-s2 + parent: about + name: About Subpage + title: About Subpage + url: /about/subpage/ + weight: 1 + subpage: + 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/exampleSite/content/about.md b/exampleSite/content/about.md index 627e661..6040fc8 100644 --- a/exampleSite/content/about.md +++ b/exampleSite/content/about.md @@ -2,22 +2,22 @@ title: "About" description: "Hugo, the world’s fastest framework for building websites" date: "2019-02-28" -aliases: - - "about-us" - - "about-hugo" - - "contact" +aliases: ["about-us","about-hugo","contact"] author: "Hugo Authors" menu: about: - name: About - title: About - url: /about + identifier: about-subpage + parent: about + name: About Subpage + title: About Subpage + url: /about/subpage/ weight: 1 subpage: + identifier: about-subpage2 parent: about - name: Subpage - title: Subpage - url: /about/subpage + name: Second About subpage + title: Second About subpage + url: /about/subpage2/ weight: 10 --- diff --git a/exampleSiteMultilingual/content/about-subpage.md b/exampleSiteMultilingual/content/about-subpage.md new file mode 100644 index 0000000..413f0ea --- /dev/null +++ b/exampleSiteMultilingual/content/about-subpage.md @@ -0,0 +1,24 @@ +--- +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 new file mode 100644 index 0000000..413f0ea --- /dev/null +++ b/exampleSiteMultilingual/content/about-subpage.pl.md @@ -0,0 +1,24 @@ +--- +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 new file mode 100644 index 0000000..372dced --- /dev/null +++ b/exampleSiteMultilingual/content/about-subpage2.md @@ -0,0 +1,24 @@ +--- +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 new file mode 100644 index 0000000..372dced --- /dev/null +++ b/exampleSiteMultilingual/content/about-subpage2.pl.md @@ -0,0 +1,24 @@ +--- +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 a412806..0c2f335 100644 --- a/exampleSiteMultilingual/content/about.md +++ b/exampleSiteMultilingual/content/about.md @@ -1,10 +1,25 @@ -+++ -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" -+++ +--- +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 +--- Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows. diff --git a/exampleSiteMultilingual/content/about.pl.md b/exampleSiteMultilingual/content/about.pl.md index a412806..0c2f335 100644 --- a/exampleSiteMultilingual/content/about.pl.md +++ b/exampleSiteMultilingual/content/about.pl.md @@ -1,10 +1,25 @@ -+++ -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" -+++ +--- +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 +--- Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows. diff --git a/layouts/_default/single.html b/layouts/_default/single.html index a7905bc..88917da 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -2,7 +2,7 @@ {{ if .Menus }} {{ end }}