From 3cf9638af1d728f9cd117ad9ad2b68ea05c4138f Mon Sep 17 00:00:00 2001 From: Dave Derderian Date: Thu, 21 Mar 2019 08:40:07 +0900 Subject: [PATCH 01/35] add conditional table of contents --- layouts/_default/single.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 77ca593..9ec206d 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -20,6 +20,12 @@ {{ end }} + {{ if .Params.Toc }} +
+ {{ .TableOfContents }} +
+ {{ end }} +
{{ .Content }}
From 5987519fd621e0b56edcfaf68fa1cdfb63b684d7 Mon Sep 17 00:00:00 2001 From: Dave Derderian Date: Mon, 25 Mar 2019 11:56:59 +0900 Subject: [PATCH 02/35] add global, local, default TOC --- layouts/_default/single.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 9ec206d..18221d4 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -22,6 +22,17 @@ {{ if .Params.Toc }}
+ {{ if or $.Site.Params.TocTitle .Params.Toc }} +

+ {{ if .Params.TocTitle }} + {{ .Params.TocTitle }} + {{ else if $.Site.Params.TocTitle }} + {{ $.Site.Params.TocTitle }} + {{ else }} + Table of Contents + {{ end }} +

+ {{ end }} {{ .TableOfContents }}
{{ end }} From 5efec67714383b7b82559169862f2617ae55c9a6 Mon Sep 17 00:00:00 2001 From: Dave Derderian Date: Mon, 25 Mar 2019 12:00:41 +0900 Subject: [PATCH 03/35] remove site.params.toctile from if condition --- layouts/_default/single.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 18221d4..52b10f9 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -22,7 +22,7 @@ {{ if .Params.Toc }}
- {{ if or $.Site.Params.TocTitle .Params.Toc }} + {{ if .Params.Toc }}

{{ if .Params.TocTitle }} {{ .Params.TocTitle }} From 034efcb463d0c8b837928d13cfa9396ec614a3bd Mon Sep 17 00:00:00 2001 From: Dave Derderian Date: Mon, 25 Mar 2019 13:12:59 +0900 Subject: [PATCH 04/35] remove unnecessary if statement --- layouts/_default/single.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 52b10f9..fcdcdb5 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -22,7 +22,6 @@ {{ if .Params.Toc }}
- {{ if .Params.Toc }}

{{ if .Params.TocTitle }} {{ .Params.TocTitle }} @@ -32,7 +31,6 @@ Table of Contents {{ end }}

- {{ end }} {{ .TableOfContents }}
{{ end }} From fda8cb9d2043d42c4972e3b4fa89427939dc7069 Mon Sep 17 00:00:00 2001 From: Zhai2333 Date: Sun, 9 Jun 2019 17:52:52 +0800 Subject: [PATCH 05/35] [+] add: 404 Page --- i18n/en.toml | 4 ++++ i18n/zh-CN.toml | 4 ++++ layouts/404.html | 11 +++++++++++ 3 files changed, 19 insertions(+) create mode 100644 i18n/en.toml create mode 100644 i18n/zh-CN.toml create mode 100644 layouts/404.html diff --git a/i18n/en.toml b/i18n/en.toml new file mode 100644 index 0000000..64aebda --- /dev/null +++ b/i18n/en.toml @@ -0,0 +1,4 @@ +[404-text] +other = "404 Not Found." +[404-link] +other = "Go Back" \ No newline at end of file diff --git a/i18n/zh-CN.toml b/i18n/zh-CN.toml new file mode 100644 index 0000000..d2f6e30 --- /dev/null +++ b/i18n/zh-CN.toml @@ -0,0 +1,4 @@ +[404-text] +other = "文件找不到了。" +[404-link] +other = "返回" \ No newline at end of file diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..5a41a14 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,11 @@ +{{ define "main" }} +
+

404!

+ +
+ {{ i18n "404-text" }}
+ {{ i18n "404-link" }} → +
+ +
+{{ end }} From 1d9856db286f6daca21c78a96fa0eadc7c7a8daf Mon Sep 17 00:00:00 2001 From: Zhai2333 Date: Wed, 28 Aug 2019 15:37:08 +0800 Subject: [PATCH 06/35] [^] upd: Update 404 --- README.md | 2 ++ i18n/en.toml | 4 ---- i18n/zh-CN.toml | 4 ---- layouts/404.html | 4 ++-- 4 files changed, 4 insertions(+), 10 deletions(-) delete mode 100644 i18n/en.toml delete mode 100644 i18n/zh-CN.toml diff --git a/README.md b/README.md index d07e40a..27f282d 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,8 @@ paginate = 5 menuMore = "Show more" readMore = "Read more" readOtherPosts = "Read other posts" + missingContentMessage = "Page not found." + missingBackButtonLabel = "Go Back" [languages.en.params.logo] logoText = "Terminal" diff --git a/i18n/en.toml b/i18n/en.toml deleted file mode 100644 index 64aebda..0000000 --- a/i18n/en.toml +++ /dev/null @@ -1,4 +0,0 @@ -[404-text] -other = "404 Not Found." -[404-link] -other = "Go Back" \ No newline at end of file diff --git a/i18n/zh-CN.toml b/i18n/zh-CN.toml deleted file mode 100644 index d2f6e30..0000000 --- a/i18n/zh-CN.toml +++ /dev/null @@ -1,4 +0,0 @@ -[404-text] -other = "文件找不到了。" -[404-link] -other = "返回" \ No newline at end of file diff --git a/layouts/404.html b/layouts/404.html index 5a41a14..d69471a 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -3,8 +3,8 @@

404!

- {{ i18n "404-text" }}
- {{ i18n "404-link" }} → + {{ .Site.Params.missingContentMessage }}
+ {{ .Site.Params.missingBackButtonLabel }} →

From 6ef1bb168634c76ed370f83a0fa92867c644fa5c Mon Sep 17 00:00:00 2001 From: willstocks <43744514+willstocks@users.noreply.github.com> Date: Tue, 10 Mar 2020 12:03:11 +0000 Subject: [PATCH 07/35] Update head.html --- layouts/partials/head.html | 76 +++++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 26 deletions(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 793405b..166ce7c 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,8 +1,11 @@ - - - - + + + + {{ template "_internal/google_analytics.html" . }} @@ -10,12 +13,13 @@ {{ if (ne $.Site.Params.ThemeColor "orange") }} - + {{ end }} {{ if (fileExists "static/style.css") -}} - + {{- end }} @@ -23,38 +27,58 @@ {{ if isset $.Site.Params "favicon" }} {{ else }} - + {{ end }} - - - - - - + + + + + + - - - - - - - - - -{{ range .Params.categories }}{{ end }} -{{ if isset .Params "date" }}{{ end }} + + + + + + + + + +{{ range .Params.categories }} +{{ end }} +{{ if isset .Params "date" }} +{{ end }} {{ with .OutputFormats.Get "RSS" }} - + {{ end }} {{ with .OutputFormats.Get "json" }} - + {{ end }} From b226e1dc8c3a64802becd66be91f7a547931079f Mon Sep 17 00:00:00 2001 From: willstocks <43744514+willstocks@users.noreply.github.com> Date: Tue, 10 Mar 2020 12:08:33 +0000 Subject: [PATCH 08/35] Fix OpenGraph and Twitter meta tags Title tags could be a little bloated as the subtitle was being appended. This should fall in to the description instead. Also, if not looking at an individual post, there was no author being defined or site image. --- layouts/partials/head.html | 76 ++++++++++++++------------------------ 1 file changed, 28 insertions(+), 48 deletions(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 166ce7c..b580d6d 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,10 +1,7 @@ - - - + + + @@ -13,72 +10,55 @@ {{ if (ne $.Site.Params.ThemeColor "orange") }} - + {{ end }} {{ if (fileExists "static/style.css") -}} - + {{- end }} {{ if isset $.Site.Params "favicon" }} - + {{ else }} - + {{ end }} - - - - - - + + + + + + - - - - - - - - - + + + + + + + + + {{ range .Params.categories }} -{{ end }} + +{{ end }} {{ if isset .Params "date" }} -{{ end }} + +{{ end }} {{ with .OutputFormats.Get "RSS" }} - + {{ end }} {{ with .OutputFormats.Get "json" }} - + {{ end }} From 6ed6715b5bd0a72bed0f4a23075ae44d02f2e1d2 Mon Sep 17 00:00:00 2001 From: willstocks <43744514+willstocks@users.noreply.github.com> Date: Tue, 10 Mar 2020 12:28:08 +0000 Subject: [PATCH 09/35] Add owner as a param for Twitter Card (creator) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index bd72655..a908f96 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,7 @@ paginate = 5 languageName = "English" title = "Terminal" subtitle = "A simple, retro theme for Hugo" + owner = "" keywords = "" copyright = "" menuMore = "Show more" From a3f51f61c7e3af4ced610ff167586d4dd03ed43e Mon Sep 17 00:00:00 2001 From: willstocks <43744514+willstocks@users.noreply.github.com> Date: Tue, 10 Mar 2020 13:57:17 +0000 Subject: [PATCH 10/35] Update USERS.md --- USERS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/USERS.md b/USERS.md index fe3c7fd..fd36d1f 100644 --- a/USERS.md +++ b/USERS.md @@ -25,6 +25,7 @@ - https://www.rockyourcode.com **Sophia Brandt** (tax officer and hobby coder) - https://qbunt.com **Jeremy Bunting** (Software Engineer) - https://smeik.org **Smeik** (Embedded Developer) +- https://code.willstocks.co.uk **Will Stocks** (Blogger & Developer) From 1b00e7e31705458dedd6e24e8b005e1468029a95 Mon Sep 17 00:00:00 2001 From: willstocks <43744514+willstocks@users.noreply.github.com> Date: Mon, 16 Mar 2020 11:01:48 +0000 Subject: [PATCH 12/35] Include Twitter Card parameters --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a908f96..b89eb97 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,8 @@ paginate = 5 title = "Terminal" subtitle = "A simple, retro theme for Hugo" owner = "" + ownerTwitter = "panr" + siteTwitter = "terminal" keywords = "" copyright = "" menuMore = "Show more" From a6ae1efab1e148a2fa47bd0790ce839a68124a2a Mon Sep 17 00:00:00 2001 From: willstocks <43744514+willstocks@users.noreply.github.com> Date: Mon, 16 Mar 2020 11:05:35 +0000 Subject: [PATCH 13/35] Twitter card + OG markup fixes Remove Twitter card title, description and image (twitter cards fall back to OG markup for these elements). Fix og:image url for non-home content Conditionally show twitter:site tag --- layouts/partials/head.html | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index d32fd87..ea517ec 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -28,11 +28,10 @@ - - - - - +{{ if (isset .Params "twitterSite") | or (eq .Params.twitterSite "") }} + +{{ end }} + @@ -41,7 +40,7 @@ - + {{ range .Params.categories }} From a89e9723090e128fdf029a4aedf5706b42446305 Mon Sep 17 00:00:00 2001 From: willstocks <43744514+willstocks@users.noreply.github.com> Date: Mon, 16 Mar 2020 11:07:04 +0000 Subject: [PATCH 14/35] Amend twitter params --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b89eb97..63f5b90 100644 --- a/README.md +++ b/README.md @@ -104,8 +104,8 @@ paginate = 5 title = "Terminal" subtitle = "A simple, retro theme for Hugo" owner = "" - ownerTwitter = "panr" - siteTwitter = "terminal" + twitterOwner = "" #Site Owner Twitter handle - do not include @ + twitterSite = "" #Site Twitter handle - do not include @ keywords = "" copyright = "" menuMore = "Show more" From 22098b16d96c32cf3b9a8a9dd66408a483e025f6 Mon Sep 17 00:00:00 2001 From: willstocks <43744514+willstocks@users.noreply.github.com> Date: Wed, 18 Mar 2020 11:12:36 +0000 Subject: [PATCH 15/35] Remove erroneous | MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Radek Kozieł --- layouts/partials/head.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index ea517ec..c2a166c 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -28,7 +28,7 @@ -{{ if (isset .Params "twitterSite") | or (eq .Params.twitterSite "") }} +{{ if (isset .Params "twitterSite") or (eq .Params.twitterSite "") }} {{ end }} From b39a2e93b73f24d79777e831e04c1067808d2d4a Mon Sep 17 00:00:00 2001 From: willstocks <43744514+willstocks@users.noreply.github.com> Date: Wed, 18 Mar 2020 11:20:14 +0000 Subject: [PATCH 16/35] Tweak twitter card tags to cater for new params --- layouts/partials/head.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index c2a166c..ca6f354 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -28,10 +28,10 @@ -{{ if (isset .Params "twitterSite") or (eq .Params.twitterSite "") }} - +{{ if (isset $.Site.Params.Twitter "site") or (eq $.Site.Params.Twitter.site "") }} + {{ end }} - + From 6f5e42002e4d41fdaed79f890651aaddd2360a84 Mon Sep 17 00:00:00 2001 From: willstocks <43744514+willstocks@users.noreply.github.com> Date: Wed, 18 Mar 2020 11:20:39 +0000 Subject: [PATCH 17/35] Separate twitter card params --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 63f5b90..d86448a 100644 --- a/README.md +++ b/README.md @@ -98,14 +98,19 @@ paginate = 5 # it's set to `true` by default # oneHeadingSize = false +[params.twitter] + # set Twitter handles for Twitter cards + # see https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/getting-started#card-and-content-attribution + # do not include @ + creator = "" + site = "" + [languages] [languages.en] languageName = "English" title = "Terminal" subtitle = "A simple, retro theme for Hugo" owner = "" - twitterOwner = "" #Site Owner Twitter handle - do not include @ - twitterSite = "" #Site Twitter handle - do not include @ keywords = "" copyright = "" menuMore = "Show more" From 5ede34df2cde854954b9af17e0bb5d41ccff237f Mon Sep 17 00:00:00 2001 From: willstocks <43744514+willstocks@users.noreply.github.com> Date: Wed, 18 Mar 2020 11:24:24 +0000 Subject: [PATCH 18/35] Only use isset check for twitter:site param See https://gohugo.io/functions/isset/ - consistent with all other param checks in file --- layouts/partials/head.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index ca6f354..0edf28a 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -28,7 +28,7 @@ -{{ if (isset $.Site.Params.Twitter "site") or (eq $.Site.Params.Twitter.site "") }} +{{ if (isset $.Site.Params.Twitter "site") }} {{ end }} From 9d64a6909279ad95212bd80b880b4ab9a26905e8 Mon Sep 17 00:00:00 2001 From: willstocks <43744514+willstocks@users.noreply.github.com> Date: Fri, 20 Mar 2020 09:21:20 +0000 Subject: [PATCH 19/35] Update twitter:creator with cleaner/multiple fallbacks --- layouts/partials/head.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 0edf28a..acbd81a 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -31,7 +31,7 @@ {{ if (isset $.Site.Params.Twitter "site") }} {{ end }} - + From 801db391a8dc6892135ae6e851388e4e72af07e6 Mon Sep 17 00:00:00 2001 From: willstocks <43744514+willstocks@users.noreply.github.com> Date: Fri, 20 Mar 2020 10:53:10 +0000 Subject: [PATCH 20/35] Add authorTwitter to post archetype For Twitter cards --- archetypes/posts.md | 1 + 1 file changed, 1 insertion(+) diff --git a/archetypes/posts.md b/archetypes/posts.md index a0d1a30..cf19c25 100644 --- a/archetypes/posts.md +++ b/archetypes/posts.md @@ -2,6 +2,7 @@ title = "" date = "" author = "" +authorTwitter = "" #do not include @ cover = "" tags = ["", ""] keywords = ["", ""] From 18af67974ac64d5fbee2d80c8d68b42d09c8ec5e Mon Sep 17 00:00:00 2001 From: willstocks <43744514+willstocks@users.noreply.github.com> Date: Mon, 23 Mar 2020 08:47:31 +0000 Subject: [PATCH 21/35] Only populate og:image with cover if is set --- layouts/partials/head.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index acbd81a..0385369 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -40,7 +40,7 @@ - + {{ range .Params.categories }} From faf59f6d5d89e48f68291e3f90dd422fcfd09ec5 Mon Sep 17 00:00:00 2001 From: Nanda Gopal <31374517+Nanda-G@users.noreply.github.com> Date: Sun, 29 Mar 2020 16:27:33 +0530 Subject: [PATCH 22/35] Updatr USERS.md --- USERS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/USERS.md b/USERS.md index fd36d1f..46030bf 100644 --- a/USERS.md +++ b/USERS.md @@ -26,6 +26,7 @@ - https://qbunt.com **Jeremy Bunting** (Software Engineer) - https://smeik.org **Smeik** (Embedded Developer) - https://code.willstocks.co.uk **Will Stocks** (Blogger & Developer) +- https://blog.vnandag.me **Nanda Gopal** (Student Developer)