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 01/20] 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 02/20] 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 03/20] 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 04/20] 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 06/20] 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 07/20] 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 08/20] 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 09/20] 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 10/20] 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 11/20] 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 12/20] 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 13/20] 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 14/20] 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 15/20] 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 16/20] 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)