From 2ecb08a5bac9723f264a1ee767494d2599a15aa3 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Fri, 15 Dec 2023 22:08:25 +0530 Subject: [PATCH 01/20] Plainify items insize toc list --- layouts/partials/toc.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html index d9b8b234..28f8694c 100644 --- a/layouts/partials/toc.html +++ b/layouts/partials/toc.html @@ -71,10 +71,10 @@ {{- end -}} {{- end }}
  • - {{- $header | safeHTML -}} + {{- $header | plainify | safeHTML -}} {{- else }}
  • - {{- $header | safeHTML -}} + {{- $header | plainify | safeHTML -}} {{- end -}} {{- end -}} From 6864770ad4dd67fe381e143ca48bdd81c38835ce Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Fri, 15 Dec 2023 22:09:15 +0530 Subject: [PATCH 02/20] Fix social icons extraneous margin --- assets/css/common/main.css | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/assets/css/common/main.css b/assets/css/common/main.css index 50022ac1..cd5c76fb 100644 --- a/assets/css/common/main.css +++ b/assets/css/common/main.css @@ -28,14 +28,12 @@ } .social-icons { - padding: 12px 0; -} - -.social-icons a:not(:last-of-type) { - margin-inline-end: 12px; + display: flex; + gap: 1rem; } .social-icons a svg { + display: block; height: 26px; width: 26px; } From 705ebeb72982dca772d2307cf3936710866dae99 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Fri, 15 Dec 2023 22:09:48 +0530 Subject: [PATCH 03/20] table styles update - reduce margins - rm reduced fontsize --- assets/css/common/post-single.css | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/assets/css/common/post-single.css b/assets/css/common/post-single.css index 14dc701b..7e40eea1 100644 --- a/assets/css/common/post-single.css +++ b/assets/css/common/post-single.css @@ -130,19 +130,18 @@ } .post-content table { - margin-bottom: 32px; + margin-bottom: var(--content-gap); } .post-content table th, .post-content table:not(.highlighttable, .highlight table, .gist .highlight) td { min-width: 80px; - padding: 12px 8px; + padding: 8px 5px; line-height: 1.5; border-bottom: 1px solid var(--border); } .post-content table th { - font-size: 14px; text-align: start; } From 28ec7a407d5c44789d6f608419dc147692a00327 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sat, 16 Dec 2023 00:32:25 +0530 Subject: [PATCH 04/20] Revert "Fix social icons extraneous margin" This reverts commit 6864770ad4dd67fe381e143ca48bdd81c38835ce. --- assets/css/common/main.css | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/assets/css/common/main.css b/assets/css/common/main.css index cd5c76fb..50022ac1 100644 --- a/assets/css/common/main.css +++ b/assets/css/common/main.css @@ -28,12 +28,14 @@ } .social-icons { - display: flex; - gap: 1rem; + padding: 12px 0; +} + +.social-icons a:not(:last-of-type) { + margin-inline-end: 12px; } .social-icons a svg { - display: block; height: 26px; width: 26px; } From 65c2720ab99368c2125fa39ed1433e0677683b75 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sat, 16 Dec 2023 13:09:19 +0530 Subject: [PATCH 05/20] lazy load cover images in lists only --- layouts/_default/list.html | 2 +- layouts/_default/single.html | 2 +- layouts/partials/cover.html | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 833f9239..2640f164 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -65,7 +65,7 @@
    {{- $isHidden := (.Param "cover.hiddenInList") | default (.Param "cover.hidden") | default false }} - {{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }} + {{- partial "cover.html" (dict "cxt" . "IsSingle" false "isHidden" $isHidden) }}

    {{- .Title }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index ee0fec43..837f6197 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -22,7 +22,7 @@ {{- end }}

    {{- $isHidden := (.Param "cover.hiddenInSingle") | default (.Param "cover.hidden") | default false }} - {{- partial "cover.html" (dict "cxt" . "IsHome" false "isHidden" $isHidden) }} + {{- partial "cover.html" (dict "cxt" . "IsSingle" true "isHidden" $isHidden) }} {{- if (.Param "ShowToc") }} {{- partial "toc.html" . }} {{- end }} diff --git a/layouts/partials/cover.html b/layouts/partials/cover.html index 0f8bfbce..e92b5557 100644 --- a/layouts/partials/cover.html +++ b/layouts/partials/cover.html @@ -1,9 +1,10 @@ {{- with .cxt}} {{/* Apply proper context from dict */}} {{- if (and .Params.cover.image (not $.isHidden)) }} {{- $alt := (.Params.cover.alt | default .Params.cover.caption | plainify) }} +{{- $loading := cond $.IsSingle "eager" "lazy" }}
    {{- $responsiveImages := (.Params.cover.responsiveImages | default site.Params.cover.responsiveImages) | default true }} - {{- $addLink := (and site.Params.cover.linkFullImages (not $.IsHome)) }} + {{- $addLink := (and site.Params.cover.linkFullImages $.IsSingle) }} {{- $pageBundleCover := (.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} {{- $globalResourcesCover := (resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} {{- $cover := (or $pageBundleCover $globalResourcesCover)}} @@ -17,7 +18,7 @@ {{- end -}} {{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }} {{- if (and (in $processableFormats $cover.MediaType.SubType) ($responsiveImages) (eq $prod true)) }} - {{ $alt }} {{- else }}{{/* Unprocessable image or responsive images disabled */}} - {{ $alt }} + {{ $alt }} {{- end }} {{- else }}{{/* For absolute urls and external links, no img processing here */}} {{- if $addLink }}{{ end -}} - {{ $alt }} + {{ $alt }} {{- end }} {{- if $addLink }}{{ end -}} {{/* Display Caption */}} - {{- if not $.IsHome }} + {{- if $.IsSingle }} {{ with .Params.cover.caption }}

    {{ . | markdownify }}

    {{- end }} {{- end }}
    From 60984fd13658db175e8945467d3dd799f2fdcc32 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sat, 16 Dec 2023 14:06:46 +0530 Subject: [PATCH 06/20] Add icon for 'draft' posts https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Aedit_note%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048 LICENSE: https://developers.google.com/fonts/faq#can_i_use_any_font_in_a_commercial_product --- assets/css/common/post-entry.css | 10 +++++++--- layouts/_default/archives.html | 13 ++++++++++--- layouts/_default/list.html | 11 +++++++++-- layouts/_default/single.html | 11 +++++++++-- 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/assets/css/common/post-entry.css b/assets/css/common/post-entry.css index 885aa2a4..c3cba370 100644 --- a/assets/css/common/post-entry.css +++ b/assets/css/common/post-entry.css @@ -80,13 +80,17 @@ bottom: 0; } -.entry-cover, -.entry-isdraft { - font-size: 14px; +.entry-hint { color: var(--secondary); } +.entry-hint-parent { + display: flex; + justify-content: space-between; +} + .entry-cover { + font-size: 14px; margin-bottom: var(--gap); text-align: center; } diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html index d2c4d76b..b38e39a1 100644 --- a/layouts/_default/archives.html +++ b/layouts/_default/archives.html @@ -6,7 +6,7 @@ {{- if (.Param "ShowRssButtonInSectionTermList") }} {{- $rss := (.OutputFormats.Get "rss") }} {{- if (eq .Kind `page`) }} - {{- $rss = (.Parent.OutputFormats.Get "rss") }} + {{- $rss = (.Parent.OutputFormats.Get "rss") }} {{- end }} {{- with $rss }} @@ -46,9 +46,16 @@ {{- range .Pages }} {{- if eq .Kind "page" }}
    -

    +

    {{- .Title | markdownify }} - {{- if .Draft }}  [draft]{{- end }} + {{- if .Draft }} + + + + + + {{- end }}

    {{- partial "post_meta.html" . -}} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 2640f164..81aea6e4 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -67,9 +67,16 @@ {{- $isHidden := (.Param "cover.hiddenInList") | default (.Param "cover.hidden") | default false }} {{- partial "cover.html" (dict "cxt" . "IsSingle" false "isHidden" $isHidden) }}
    -

    +

    {{- .Title }} - {{- if .Draft }}  [draft]{{- end }} + {{- if .Draft }} + + + + + + {{- end }}

    {{- if (ne (.Param "hideSummary") true) }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 837f6197..19a624f4 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -3,9 +3,16 @@
    {{ partial "breadcrumbs.html" . }} -

    +

    {{ .Title }} - {{- if .Draft }}  [draft]{{- end }} + {{- if .Draft }} + + + + + + {{- end }}

    {{- if .Description }}
    From 86362ebd72776c78c1c30e660ceb903d235f493d Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sat, 16 Dec 2023 19:28:05 +0530 Subject: [PATCH 07/20] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7a80ccab..14b0bf91 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

    ☄️ Fast | ☁️ Fluent | 🌙 Smooth | 📱 Responsive


    -> Hugo PaperMod is a theme based on [hugo-paper](https://github.com/nanxiaobei/hugo-paper/tree/4330c8b12aa48bfdecbcad6ad66145f679a430b3). +> Hugo PaperMod is a theme based on [hugo-paper](https://github.com/nanxiaobei/hugo-paper/tree/4330c8b12aa48bfdecbcad6ad66145f679a430b3).
    > The goal of this project is to add more features and customization to the og theme. **Documentation** can be found here: [**📚 Wiki**](https://github.com/adityatelange/hugo-PaperMod/wiki) @@ -11,10 +11,12 @@ **ExampleSite** can be found here: [**exampleSite**](https://github.com/adityatelange/hugo-PaperMod/tree/exampleSite). Demo is built up with [exampleSite](https://github.com/adityatelange/hugo-PaperMod/tree/exampleSite) as source. [![hugo-papermod](https://img.shields.io/badge/Hugo--Themes-@PaperMod-blue)](https://themes.gohugo.io/themes/hugo-papermod/) -[![Minimum Hugo Version](https://img.shields.io/static/v1?label=HUGO-version&message=>0.97.1&color=blue&logo=hugo)](https://github.com/gohugoio/hugo/releases/tag/v0.97.1) +[![Minimum Hugo Version](https://img.shields.io/static/v1?label=min-HUGO-version&message=>=0.97.1&color=blue&logo=hugo)](https://github.com/gohugoio/hugo/releases/tag/v0.97.1) [![Discord](https://img.shields.io/discord/971046860317921340?label=Discord&logo=discord)](https://discord.gg/ahpmTvhVmp) [![GitHub](https://img.shields.io/github/license/adityatelange/hugo-PaperMod)](https://github.com/adityatelange/hugo-PaperMod/blob/master/LICENSE) ![code-size](https://img.shields.io/github/languages/code-size/adityatelange/hugo-PaperMod) +[![X (formerly Twitter) URL](https://img.shields.io/badge/-Share%20on%20X-gray?style=flat&logo=x)](https://x.com/intent/tweet/?text=Checkout%20Hugo%20PaperMod%20%E2%9C%A8%0AA%20fast,%20clean,%20responsive%20Hugo%20theme.&url=https://github.com/adityatelange/hugo-PaperMod&hashtags=Hugo,PaperMod) + --- From 102e089bc3c1cf30a0f5b204c0182e0ce72b6880 Mon Sep 17 00:00:00 2001 From: Razon Yang Date: Sat, 4 Nov 2023 15:01:23 +0530 Subject: [PATCH 08/20] [PATCH] tpl/embedded: Make Open Graph's series optional cherry-picked from https://github.com/gohugoio/hugo/commit/b82b547acb404cdb883154cc4991137d46caa22a --- layouts/partials/templates/opengraph.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layouts/partials/templates/opengraph.html b/layouts/partials/templates/opengraph.html index 9e8df143..631dda14 100644 --- a/layouts/partials/templates/opengraph.html +++ b/layouts/partials/templates/opengraph.html @@ -41,12 +41,14 @@ {{- /* If it is part of a series, link to related articles */}} {{- $permalink := .Permalink }} {{- $siteSeries := site.Taxonomies.series }} +{{- if $siteSeries }} {{ with .Params.series }}{{- range $name := . }} {{- $series := index $siteSeries ($name | urlize) }} {{- range $page := first 6 $series.Pages }} {{- if ne $page.Permalink $permalink }}{{ end }} {{- end }} {{ end }}{{ end }} +{{- end }} {{- /* Facebook Page Admin ID for Domain Insights */}} {{- with site.Social.facebook_admin }}{{ end }} From 3fb112bc851ae88d7457300a262c7a30a7522454 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Sat, 4 Nov 2023 15:05:42 +0530 Subject: [PATCH 09/20] [PATCH] tpl/tplimpl: Deprecate .Site.Social usage with internal templates cherry-picked from https://github.com/gohugoio/hugo/commit/4910312ee75a1c67fad68c259ad9576dca854c62 --- layouts/partials/templates/opengraph.html | 13 ++++++++++++- layouts/partials/templates/twitter_cards.html | 15 +++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/layouts/partials/templates/opengraph.html b/layouts/partials/templates/opengraph.html index 631dda14..b7fe84c7 100644 --- a/layouts/partials/templates/opengraph.html +++ b/layouts/partials/templates/opengraph.html @@ -50,5 +50,16 @@ {{ end }}{{ end }} {{- end }} +{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}} +{{- $facebookAdmin := "" }} +{{- with site.Params.social.facebook_admin }} + {{- $facebookAdmin = . }} +{{- else }} + {{- with site.Social.facebook_admin }} + {{- $facebookAdmin = . }} + {{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }} + {{- end }} +{{- end }} + {{- /* Facebook Page Admin ID for Domain Insights */}} -{{- with site.Social.facebook_admin }}{{ end }} +{{ with $facebookAdmin }}{{ end }} diff --git a/layouts/partials/templates/twitter_cards.html b/layouts/partials/templates/twitter_cards.html index bd46e376..bdb59239 100644 --- a/layouts/partials/templates/twitter_cards.html +++ b/layouts/partials/templates/twitter_cards.html @@ -28,6 +28,17 @@ {{- end }} -{{ with site.Social.twitter -}} +{{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}} +{{- $twitterSite := "" }} +{{- with site.Params.social.twitter }} + {{- $twitterSite = . }} +{{- else }} + {{- with site.Social.twitter }} + {{- $twitterSite = . }} + {{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }} + {{- end }} +{{- end }} + +{{- with $twitterSite }} -{{ end -}} +{{- end }} From 87df659c185b91ab09f8eb978b3aab5945b0f8b5 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Sat, 4 Nov 2023 15:08:01 +0530 Subject: [PATCH 10/20] [PATCH] tpl/tplimpl: Fix deprecation logic in embedded templates cherry-picked from https://github.com/gohugoio/hugo/commit/cb98e9061b3d62b6f1e635a6cf9a8be57dc3f56c --- layouts/partials/templates/opengraph.html | 6 ++++-- layouts/partials/templates/twitter_cards.html | 12 +++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/layouts/partials/templates/opengraph.html b/layouts/partials/templates/opengraph.html index b7fe84c7..38fbd246 100644 --- a/layouts/partials/templates/opengraph.html +++ b/layouts/partials/templates/opengraph.html @@ -52,8 +52,10 @@ {{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}} {{- $facebookAdmin := "" }} -{{- with site.Params.social.facebook_admin }} - {{- $facebookAdmin = . }} +{{- with site.Params.social }} + {{- if reflect.IsMap . }} + {{- $facebookAdmin = .facebook_admin }} + {{- end }} {{- else }} {{- with site.Social.facebook_admin }} {{- $facebookAdmin = . }} diff --git a/layouts/partials/templates/twitter_cards.html b/layouts/partials/templates/twitter_cards.html index bdb59239..0e7760aa 100644 --- a/layouts/partials/templates/twitter_cards.html +++ b/layouts/partials/templates/twitter_cards.html @@ -30,8 +30,10 @@ {{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}} {{- $twitterSite := "" }} -{{- with site.Params.social.twitter }} - {{- $twitterSite = . }} +{{- with site.Params.social }} + {{- if reflect.IsMap . }} + {{- $twitterSite = .twitter }} + {{- end }} {{- else }} {{- with site.Social.twitter }} {{- $twitterSite = . }} @@ -40,5 +42,9 @@ {{- end }} {{- with $twitterSite }} - + {{- $content := . }} + {{- if not (strings.HasPrefix . "@") }} + {{- $content = printf "@%v" $twitterSite }} + {{- end }} + {{- end }} From cf62fa3c40ea9a2527b5081db699e28c0e391985 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Sat, 4 Nov 2023 15:19:28 +0530 Subject: [PATCH 11/20] [PATCH] tpl/tplimpl: Use .Language.LanguageCode in built-in templates cherry-pick from https://github.com/gohugoio/hugo/commit/ff77a927f9c032f5a65eff2daf1f7f8c04103711 --- layouts/_default/rss.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 44f14986..db57edac 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -23,8 +23,8 @@ {{ index . 0 | absURL }} {{- end }} - Hugo -- gohugo.io{{ with site.LanguageCode }} - {{.}}{{end}}{{ with site.Author.email }} + Hugo -- gohugo.io + {{ site.Language.LanguageCode }}{{ with site.Author.email }} {{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}}{{ with site.Author.email }} {{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}}{{ with site.Copyright }} {{.}}{{end}}{{ if not .Date.IsZero }} From 00488d01463fc8c8db9fbda3f6060a0b5b373464 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Sat, 4 Nov 2023 15:23:31 +0530 Subject: [PATCH 12/20] [PATCH] tpl/tplimpl: Deprecate .Site.Author usage in RSS template cherry-pick from https://github.com/gohugoio/hugo/commit/d4016dd5cd57a27f19a5472c6031d156066860b7 --- layouts/_default/rss.xml | 68 ++++++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 23 deletions(-) diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index db57edac..22b2e6ed 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -1,21 +1,43 @@ -{{- $pctx := . -}} -{{- if .IsHome -}}{{ $pctx = site }}{{- end -}} -{{- $pages := slice -}} -{{- if or $.IsHome $.IsSection -}} -{{- $pages = $pctx.RegularPages -}} -{{- else -}} -{{- $pages = $pctx.Pages -}} -{{- end -}} -{{- $limit := site.Config.Services.RSS.Limit -}} -{{- if ge $limit 1 -}} -{{- $pages = $pages | first $limit -}} -{{- end -}} +{{- /* Deprecate site.Author.email in favor of site.Params.author.email */}} +{{- $authorEmail := "" }} +{{- with site.Params.author.email }} + {{- $authorEmail = . }} +{{- else }} + {{- with site.Author.email }} + {{- $authorEmail = . }} + {{- warnf "The author key in site configuration is deprecated. Use params.author.email instead." }} + {{- end }} +{{- end }} + +{{- /* Deprecate site.Author.name in favor of site.Params.author.name */}} +{{- $authorName := "" }} +{{- with site.Params.author.name }} + {{- $authorName = . }} +{{- else }} + {{- with site.Author.name }} + {{- $authorName = . }} + {{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }} + {{- end }} +{{- end }} + +{{- $pctx := . }} +{{- if .IsHome }}{{ $pctx = .Site }}{{ end }} +{{- $pages := slice }} +{{- if or $.IsHome $.IsSection }} +{{- $pages = $pctx.RegularPages }} +{{- else }} +{{- $pages = $pctx.Pages }} +{{- end }} +{{- $limit := .Site.Config.Services.RSS.Limit }} +{{- if ge $limit 1 }} +{{- $pages = $pages | first $limit }} +{{- end }} {{- printf "" | safeHTML }} - + - {{ if eq .Title site.Title }}{{ site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ site.Title }}{{ end }} + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }} {{ .Permalink }} - Recent content {{ if ne .Title site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ site.Title }} + Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }} {{- with site.Params.images }} {{ site.Title }} @@ -24,21 +46,21 @@ {{- end }} Hugo -- gohugo.io - {{ site.Language.LanguageCode }}{{ with site.Author.email }} - {{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}}{{ with site.Author.email }} - {{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}}{{ with site.Copyright }} - {{.}}{{end}}{{ if not .Date.IsZero }} + {{ site.Language.LanguageCode }}{{ with $authorEmail }} + {{.}}{{ with $authorName }} ({{ . }}){{ end }}{{ end }}{{ with $authorEmail }} + {{ . }}{{ with $authorName }} ({{ . }}){{ 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" -}} + {{- with .OutputFormats.Get "RSS" }} {{ printf "" .Permalink .MediaType | safeHTML }} - {{- end -}} - {{ range $pages }} + {{- end }} + {{- range $pages }} {{- if and (ne .Layout `search`) (ne .Layout `archives`) }} {{ .Title }} {{ .Permalink }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with site.Author.email }}{{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}} + {{- with $authorEmail }}{{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }} {{ .Permalink }} {{ with .Description | html }}{{ . }}{{ else }}{{ .Summary | html }}{{ end -}} {{- if site.Params.ShowFullTextinRSS }} From ff7443b17f597e2307a590c805e39df1d935ebc6 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Sat, 4 Nov 2023 15:34:56 +0530 Subject: [PATCH 13/20] [PATCH] tpl/tplimpl: Fix deprecation logic in RSS template cherry-pick from https://github.com/gohugoio/hugo/commit/23fcfb7f741a417f53a8ef4997bb68e64631df01 --- layouts/_default/rss.xml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 22b2e6ed..3b28fbf6 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -1,7 +1,11 @@ {{- /* Deprecate site.Author.email in favor of site.Params.author.email */}} {{- $authorEmail := "" }} -{{- with site.Params.author.email }} - {{- $authorEmail = . }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .email }} + {{- $authorEmail = . }} + {{- end }} + {{- end }} {{- else }} {{- with site.Author.email }} {{- $authorEmail = . }} @@ -11,8 +15,14 @@ {{- /* Deprecate site.Author.name in favor of site.Params.author.name */}} {{- $authorName := "" }} -{{- with site.Params.author.name }} - {{- $authorName = . }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .name }} + {{- $authorName = . }} + {{- end }} + {{- else }} + {{- $authorName = . }} + {{- end }} {{- else }} {{- with site.Author.name }} {{- $authorName = . }} From f51ad4981904a9cb0ad9729b6d204532fef4371d Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sat, 4 Nov 2023 15:36:08 +0530 Subject: [PATCH 14/20] replace .Site with site & fix whitespace --- layouts/_default/rss.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 3b28fbf6..b6a7ec06 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -31,23 +31,23 @@ {{- end }} {{- $pctx := . }} -{{- if .IsHome }}{{ $pctx = .Site }}{{ end }} +{{- if .IsHome }}{{ $pctx = site }}{{ end }} {{- $pages := slice }} {{- if or $.IsHome $.IsSection }} {{- $pages = $pctx.RegularPages }} {{- else }} {{- $pages = $pctx.Pages }} {{- end }} -{{- $limit := .Site.Config.Services.RSS.Limit }} +{{- $limit := site.Config.Services.RSS.Limit }} {{- if ge $limit 1 }} {{- $pages = $pages | first $limit }} {{- end }} {{- printf "" | safeHTML }} - {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }} + {{ if eq .Title site.Title }}{{ site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ site.Title }}{{ end }} {{ .Permalink }} - Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }} + Recent content {{ if ne .Title site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ site.Title }} {{- with site.Params.images }} {{ site.Title }} @@ -58,7 +58,7 @@ Hugo -- gohugo.io {{ site.Language.LanguageCode }}{{ with $authorEmail }} {{.}}{{ with $authorName }} ({{ . }}){{ end }}{{ end }}{{ with $authorEmail }} - {{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }}{{ with .Site.Copyright }} + {{ . }}{{ with $authorName }} ({{ . }}){{ 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" }} @@ -78,6 +78,6 @@ {{- end }} {{- end }} - {{ end }} + {{- end }} From e3ad0aeb705409639a4a4d860075a2924e00eb23 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sat, 16 Dec 2023 19:59:55 +0530 Subject: [PATCH 15/20] Bump minimum Hugo version to 0.112.4 * language.LanguageCode is required for Fix/hugo depr 0.120.x #1328 --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/workflows/gh-pages.yml | 4 ++-- README.md | 2 +- layouts/_default/baseof.html | 4 ++-- theme.toml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index b7d5b289..d88b750f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -26,7 +26,7 @@ Please fill the template below - Device/Os: [e.g. Android 10] - Type: [e.g. Desktop/Mobile] - Browser and version [e.g. Chrome 86.0]: - - Hugo Version [ >=0.97.1 expected]: + - Hugo Version [ >=0.112.4 expected]: - Theme Version [e.g. v4.0, master, or commit-id ]: **Steps to reproduce the behavior:** diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index c7b8351a..f4acb7e0 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -15,7 +15,7 @@ on: hugoVersion: description: "Hugo Version" required: false - default: "0.97.1" + default: "0.112.4" # Allow one concurrent deployment concurrency: @@ -38,7 +38,7 @@ jobs: build: runs-on: ubuntu-latest env: - HUGO_VERSION: "0.97.1" + HUGO_VERSION: "0.112.4" steps: - name: Check version if: ${{ github.event.inputs.hugoVersion }} diff --git a/README.md b/README.md index 14b0bf91..12bd8cb6 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ **ExampleSite** can be found here: [**exampleSite**](https://github.com/adityatelange/hugo-PaperMod/tree/exampleSite). Demo is built up with [exampleSite](https://github.com/adityatelange/hugo-PaperMod/tree/exampleSite) as source. [![hugo-papermod](https://img.shields.io/badge/Hugo--Themes-@PaperMod-blue)](https://themes.gohugo.io/themes/hugo-papermod/) -[![Minimum Hugo Version](https://img.shields.io/static/v1?label=min-HUGO-version&message=>=0.97.1&color=blue&logo=hugo)](https://github.com/gohugoio/hugo/releases/tag/v0.97.1) +[![Minimum Hugo Version](https://img.shields.io/static/v1?label=min-HUGO-version&message=>=v0.112.4&color=blue&logo=hugo)](https://github.com/gohugoio/hugo/releases/tag/v0.112.4) [![Discord](https://img.shields.io/discord/971046860317921340?label=Discord&logo=discord)](https://discord.gg/ahpmTvhVmp) [![GitHub](https://img.shields.io/github/license/adityatelange/hugo-PaperMod)](https://github.com/adityatelange/hugo-PaperMod/blob/master/LICENSE) ![code-size](https://img.shields.io/github/languages/code-size/adityatelange/hugo-PaperMod) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index d2de5eec..df611bfb 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,5 +1,5 @@ -{{- if lt hugo.Version "0.97.1" }} -{{- errorf "=> hugo v0.97.1 or greater is required for hugo-PaperMod to build " }} +{{- if lt hugo.Version "0.112.4" }} +{{- errorf "=> hugo v0.112.4 or greater is required for hugo-PaperMod to build " }} {{- end -}} diff --git a/theme.toml b/theme.toml index aa26fe06..f659f5c9 100644 --- a/theme.toml +++ b/theme.toml @@ -37,7 +37,7 @@ features = [ "scroll-to-top", "search" ] -min_version = "0.97.1" +min_version = "0.112.4" [author] name = "Aditya Telange" From 5f624757ae894d46c2e96e6ba6c0720a4ec7771a Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sat, 16 Dec 2023 20:07:15 +0530 Subject: [PATCH 16/20] Workflows: Update release bin path for hugo linux-amd64.deb --- .github/workflows/gh-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index f4acb7e0..4d35f1de 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -45,7 +45,7 @@ jobs: run: export HUGO_VERSION="${{ github.event.inputs.hugoVersion }}" - name: Install Hugo CLI run: | - wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.deb \ + wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_linux-amd64.deb \ && sudo dpkg -i ${{ runner.temp }}/hugo.deb - name: Checkout uses: actions/checkout@v3 From f8e125c7eef82323b11fc2dfc67110dfc7454dd8 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sat, 16 Dec 2023 20:59:08 +0530 Subject: [PATCH 17/20] Add padding to social-icons for better tap sizing --- assets/css/common/main.css | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/assets/css/common/main.css b/assets/css/common/main.css index 50022ac1..25ae4dae 100644 --- a/assets/css/common/main.css +++ b/assets/css/common/main.css @@ -27,12 +27,10 @@ margin-inline-start: auto; } -.social-icons { - padding: 12px 0; -} -.social-icons a:not(:last-of-type) { - margin-inline-end: 12px; +.social-icons a { + display: inline-flex; + padding: 10px; } .social-icons a svg { From 69e5e085ab0b8d0cae03d9c189c4b262890646ac Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sat, 16 Dec 2023 20:59:36 +0530 Subject: [PATCH 18/20] improved profile mode spacing --- assets/css/common/profile-mode.css | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/assets/css/common/profile-mode.css b/assets/css/common/profile-mode.css index 58f28198..9e98df55 100644 --- a/assets/css/common/profile-mode.css +++ b/assets/css/common/profile-mode.css @@ -10,19 +10,20 @@ text-align: center; } -.profile .profile_inner h1 { - padding: 12px 0; +.profile .profile_inner { + display: flex; + flex-direction: column; + align-items: center; + gap: 10px; } .profile img { - display: inline-table; border-radius: 50%; } .buttons { flex-wrap: wrap; max-width: 400px; - margin: 0 auto; } .button { From fb1c0aeb6fd5b1b1cfc17a977754cc6d0f03b486 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sat, 16 Dec 2023 21:38:24 +0530 Subject: [PATCH 19/20] social icons refactor Params.socialIcons --- layouts/partials/home_info.html | 2 +- layouts/partials/index_profile.html | 2 +- layouts/partials/social_icons.html | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/layouts/partials/home_info.html b/layouts/partials/home_info.html index efae956e..aece5327 100644 --- a/layouts/partials/home_info.html +++ b/layouts/partials/home_info.html @@ -7,7 +7,7 @@ {{ .Content | markdownify }}
    - {{ partial "social_icons.html" site.Params.socialIcons }} + {{ partial "social_icons.html" }}
    {{- end -}} diff --git a/layouts/partials/index_profile.html b/layouts/partials/index_profile.html index d9ddbda5..6882f39b 100644 --- a/layouts/partials/index_profile.html +++ b/layouts/partials/index_profile.html @@ -32,7 +32,7 @@ {{- end }}

    {{ .title | default site.Title | markdownify }}

    {{ .subtitle | markdownify }} - {{- partial "social_icons.html" site.Params.socialIcons -}} + {{- partial "social_icons.html" -}} {{- with .buttons }}
    diff --git a/layouts/partials/social_icons.html b/layouts/partials/social_icons.html index 876b77c6..761129eb 100644 --- a/layouts/partials/social_icons.html +++ b/layouts/partials/social_icons.html @@ -1,6 +1,7 @@
    - {{ partial "social_icons.html" }} + {{ partial "social_icons.html" (dict "align" site.Params.homeInfoParams.AlignSocialIconsTo) }}
    {{- end -}} diff --git a/layouts/partials/social_icons.html b/layouts/partials/social_icons.html index 761129eb..ce76a308 100644 --- a/layouts/partials/social_icons.html +++ b/layouts/partials/social_icons.html @@ -1,4 +1,4 @@ -
    +