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..4d35f1de 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,14 +38,14 @@ 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 }} 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 diff --git a/README.md b/README.md index 7a80ccab..12bd8cb6 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=>=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) +[![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) + --- 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 { 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/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; } 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 { diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html index 44c8faf3..3d5410f2 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/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/layouts/_default/list.html b/layouts/_default/list.html index 833f9239..81aea6e4 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -65,11 +65,18 @@
{{- $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 }} - {{- if .Draft }}  [draft]{{- end }} + {{- if .Draft }} + + + + + + {{- end }}

{{- if (ne (.Param "hideSummary") true) }} diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 44f14986..b6a7ec06 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -1,21 +1,53 @@ -{{- $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 }} + {{- if reflect.IsMap . }} + {{- with .email }} + {{- $authorEmail = . }} + {{- end }} + {{- end }} +{{- 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 }} + {{- if reflect.IsMap . }} + {{- with .name }} + {{- $authorName = . }} + {{- end }} + {{- else }} + {{- $authorName = . }} + {{- end }} +{{- 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 }} @@ -23,22 +55,22 @@ {{ index . 0 | absURL }} {{- 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}}{{ if not .Date.IsZero }} + Hugo -- gohugo.io + {{ 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 }} @@ -46,6 +78,6 @@ {{- end }} {{- end }} - {{ end }} + {{- end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 405d3e0f..436e481e 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 }}
@@ -22,7 +29,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 }}
diff --git a/layouts/partials/home_info.html b/layouts/partials/home_info.html index efae956e..199dfb72 100644 --- a/layouts/partials/home_info.html +++ b/layouts/partials/home_info.html @@ -7,7 +7,7 @@ {{ .Content | markdownify }}
{{- 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..ce76a308 100644 --- a/layouts/partials/social_icons.html +++ b/layouts/partials/social_icons.html @@ -1,6 +1,7 @@ -