Merge branch 'adityatelange:master' into master

This commit is contained in:
~m 2023-12-17 13:05:58 +07:00 committed by GitHub
commit 0a458da1f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 165 additions and 74 deletions

View File

@ -26,7 +26,7 @@ Please fill the template below
- Device/Os: [e.g. Android 10] - Device/Os: [e.g. Android 10]
- Type: [e.g. Desktop/Mobile] - Type: [e.g. Desktop/Mobile]
- Browser and version [e.g. Chrome 86.0]: - 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 ]: - Theme Version [e.g. v4.0, master, or commit-id ]:
**Steps to reproduce the behavior:** **Steps to reproduce the behavior:**

View File

@ -15,7 +15,7 @@ on:
hugoVersion: hugoVersion:
description: "Hugo Version" description: "Hugo Version"
required: false required: false
default: "0.97.1" default: "0.112.4"
# Allow one concurrent deployment # Allow one concurrent deployment
concurrency: concurrency:
@ -38,14 +38,14 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
HUGO_VERSION: "0.97.1" HUGO_VERSION: "0.112.4"
steps: steps:
- name: Check version - name: Check version
if: ${{ github.event.inputs.hugoVersion }} if: ${{ github.event.inputs.hugoVersion }}
run: export HUGO_VERSION="${{ github.event.inputs.hugoVersion }}" run: export HUGO_VERSION="${{ github.event.inputs.hugoVersion }}"
- name: Install Hugo CLI - name: Install Hugo CLI
run: | 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 && sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3

View File

@ -3,7 +3,7 @@
<h4 align=center>☄️ Fast | ☁️ Fluent | 🌙 Smooth | 📱 Responsive</h4> <h4 align=center>☄️ Fast | ☁️ Fluent | 🌙 Smooth | 📱 Responsive</h4>
<br> <br>
> 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).<br>
> The goal of this project is to add more features and customization to the og theme. > 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) **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. **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/) [![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) [![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) [![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) ![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)
--- ---

View File

@ -27,12 +27,10 @@
margin-inline-start: auto; margin-inline-start: auto;
} }
.social-icons {
padding: 12px 0;
}
.social-icons a:not(:last-of-type) { .social-icons a {
margin-inline-end: 12px; display: inline-flex;
padding: 10px;
} }
.social-icons a svg { .social-icons a svg {

View File

@ -80,13 +80,17 @@
bottom: 0; bottom: 0;
} }
.entry-cover, .entry-hint {
.entry-isdraft {
font-size: 14px;
color: var(--secondary); color: var(--secondary);
} }
.entry-hint-parent {
display: flex;
justify-content: space-between;
}
.entry-cover { .entry-cover {
font-size: 14px;
margin-bottom: var(--gap); margin-bottom: var(--gap);
text-align: center; text-align: center;
} }

View File

@ -130,19 +130,18 @@
} }
.post-content table { .post-content table {
margin-bottom: 32px; margin-bottom: var(--content-gap);
} }
.post-content table th, .post-content table th,
.post-content table:not(.highlighttable, .highlight table, .gist .highlight) td { .post-content table:not(.highlighttable, .highlight table, .gist .highlight) td {
min-width: 80px; min-width: 80px;
padding: 12px 8px; padding: 8px 5px;
line-height: 1.5; line-height: 1.5;
border-bottom: 1px solid var(--border); border-bottom: 1px solid var(--border);
} }
.post-content table th { .post-content table th {
font-size: 14px;
text-align: start; text-align: start;
} }

View File

@ -10,19 +10,20 @@
text-align: center; text-align: center;
} }
.profile .profile_inner h1 { .profile .profile_inner {
padding: 12px 0; display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
} }
.profile img { .profile img {
display: inline-table;
border-radius: 50%; border-radius: 50%;
} }
.buttons { .buttons {
flex-wrap: wrap; flex-wrap: wrap;
max-width: 400px; max-width: 400px;
margin: 0 auto;
} }
.button { .button {

View File

@ -6,7 +6,7 @@
{{- if (.Param "ShowRssButtonInSectionTermList") }} {{- if (.Param "ShowRssButtonInSectionTermList") }}
{{- $rss := (.OutputFormats.Get "rss") }} {{- $rss := (.OutputFormats.Get "rss") }}
{{- if (eq .Kind `page`) }} {{- if (eq .Kind `page`) }}
{{- $rss = (.Parent.OutputFormats.Get "rss") }} {{- $rss = (.Parent.OutputFormats.Get "rss") }}
{{- end }} {{- end }}
{{- with $rss }} {{- with $rss }}
<a href="{{ .RelPermalink }}" title="RSS" aria-label="RSS"> <a href="{{ .RelPermalink }}" title="RSS" aria-label="RSS">
@ -46,9 +46,16 @@
{{- range .Pages }} {{- range .Pages }}
{{- if eq .Kind "page" }} {{- if eq .Kind "page" }}
<div class="archive-entry"> <div class="archive-entry">
<h3 class="archive-entry-title"> <h3 class="archive-entry-title entry-hint-parent">
{{- .Title | markdownify }} {{- .Title | markdownify }}
{{- if .Draft }}<sup><span class="entry-isdraft">&nbsp;&nbsp;[draft]</span></sup>{{- end }} {{- if .Draft }}
<span class="entry-hint" title="Draft">
<svg xmlns="http://www.w3.org/2000/svg" height="15" viewBox="0 -960 960 960" fill="currentColor">
<path
d="M160-410v-60h300v60H160Zm0-165v-60h470v60H160Zm0-165v-60h470v60H160Zm360 580v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q9 9 13 20t4 22q0 11-4.5 22.5T862.09-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z" />
</svg>
</span>
{{- end }}
</h3> </h3>
<div class="archive-meta"> <div class="archive-meta">
{{- partial "post_meta.html" . -}} {{- partial "post_meta.html" . -}}

View File

@ -1,5 +1,5 @@
{{- if lt hugo.Version "0.97.1" }} {{- if lt hugo.Version "0.112.4" }}
{{- errorf "=> hugo v0.97.1 or greater is required for hugo-PaperMod to build " }} {{- errorf "=> hugo v0.112.4 or greater is required for hugo-PaperMod to build " }}
{{- end -}} {{- end -}}
<!DOCTYPE html> <!DOCTYPE html>

View File

@ -65,11 +65,18 @@
<article class="{{ $class }}"> <article class="{{ $class }}">
{{- $isHidden := (.Param "cover.hiddenInList") | default (.Param "cover.hidden") | default false }} {{- $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) }}
<header class="entry-header"> <header class="entry-header">
<h2> <h2 class="entry-hint-parent">
{{- .Title }} {{- .Title }}
{{- if .Draft }}<sup><span class="entry-isdraft">&nbsp;&nbsp;[draft]</span></sup>{{- end }} {{- if .Draft }}
<span class="entry-hint" title="Draft">
<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" fill="currentColor">
<path
d="M160-410v-60h300v60H160Zm0-165v-60h470v60H160Zm0-165v-60h470v60H160Zm360 580v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q9 9 13 20t4 22q0 11-4.5 22.5T862.09-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z" />
</svg>
</span>
{{- end }}
</h2> </h2>
</header> </header>
{{- if (ne (.Param "hideSummary") true) }} {{- if (ne (.Param "hideSummary") true) }}

View File

@ -1,21 +1,53 @@
{{- $pctx := . -}} {{- /* Deprecate site.Author.email in favor of site.Params.author.email */}}
{{- if .IsHome -}}{{ $pctx = site }}{{- end -}} {{- $authorEmail := "" }}
{{- $pages := slice -}} {{- with site.Params.author }}
{{- if or $.IsHome $.IsSection -}} {{- if reflect.IsMap . }}
{{- $pages = $pctx.RegularPages -}} {{- with .email }}
{{- else -}} {{- $authorEmail = . }}
{{- $pages = $pctx.Pages -}} {{- end }}
{{- end -}} {{- end }}
{{- $limit := site.Config.Services.RSS.Limit -}} {{- else }}
{{- if ge $limit 1 -}} {{- with site.Author.email }}
{{- $pages = $pages | first $limit -}} {{- $authorEmail = . }}
{{- end -}} {{- 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 "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} {{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel> <channel>
<title>{{ if eq .Title site.Title }}{{ site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ site.Title }}{{ end }}</title> <title>{{ if eq .Title site.Title }}{{ site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link> <link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ site.Title }}</description> <description>Recent content {{ if ne .Title site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ site.Title }}</description>
{{- with site.Params.images }} {{- with site.Params.images }}
<image> <image>
<title>{{ site.Title }}</title> <title>{{ site.Title }}</title>
@ -23,22 +55,22 @@
<link>{{ index . 0 | absURL }}</link> <link>{{ index . 0 | absURL }}</link>
</image> </image>
{{- end }} {{- end }}
<generator>Hugo -- gohugo.io</generator>{{ with site.LanguageCode }} <generator>Hugo -- gohugo.io</generator>
<language>{{.}}</language>{{end}}{{ with site.Author.email }} <language>{{ site.Language.LanguageCode }}</language>{{ with $authorEmail }}
<managingEditor>{{.}}{{ with site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with site.Author.email }} <managingEditor>{{.}}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with $authorEmail }}
<webMaster>{{.}}{{ with site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with site.Copyright }} <webMaster>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }} <copyright>{{ . }}</copyright>{{ end }}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{- with .OutputFormats.Get "RSS" -}} {{- with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end -}} {{- end }}
{{ range $pages }} {{- range $pages }}
{{- if and (ne .Layout `search`) (ne .Layout `archives`) }} {{- if and (ne .Layout `search`) (ne .Layout `archives`) }}
<item> <item>
<title>{{ .Title }}</title> <title>{{ .Title }}</title>
<link>{{ .Permalink }}</link> <link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with site.Author.email }}<author>{{.}}{{ with site.Author.name }} ({{.}}){{end}}</author>{{end}} {{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }}
<guid>{{ .Permalink }}</guid> <guid>{{ .Permalink }}</guid>
<description>{{ with .Description | html }}{{ . }}{{ else }}{{ .Summary | html }}{{ end -}}</description> <description>{{ with .Description | html }}{{ . }}{{ else }}{{ .Summary | html }}{{ end -}}</description>
{{- if site.Params.ShowFullTextinRSS }} {{- if site.Params.ShowFullTextinRSS }}
@ -46,6 +78,6 @@
{{- end }} {{- end }}
</item> </item>
{{- end }} {{- end }}
{{ end }} {{- end }}
</channel> </channel>
</rss> </rss>

View File

@ -3,9 +3,16 @@
<article class="post-single"> <article class="post-single">
<header class="post-header"> <header class="post-header">
{{ partial "breadcrumbs.html" . }} {{ partial "breadcrumbs.html" . }}
<h1 class="post-title"> <h1 class="post-title entry-hint-parent">
{{ .Title }} {{ .Title }}
{{- if .Draft }}<sup><span class="entry-isdraft">&nbsp;&nbsp;[draft]</span></sup>{{- end }} {{- if .Draft }}
<span class="entry-hint" title="Draft">
<svg xmlns="http://www.w3.org/2000/svg" height="35" viewBox="0 -960 960 960" fill="currentColor">
<path
d="M160-410v-60h300v60H160Zm0-165v-60h470v60H160Zm0-165v-60h470v60H160Zm360 580v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q9 9 13 20t4 22q0 11-4.5 22.5T862.09-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z" />
</svg>
</span>
{{- end }}
</h1> </h1>
{{- if .Description }} {{- if .Description }}
<div class="post-description"> <div class="post-description">
@ -22,7 +29,7 @@
{{- end }} {{- end }}
</header> </header>
{{- $isHidden := (.Param "cover.hiddenInSingle") | default (.Param "cover.hidden") | default false }} {{- $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") }} {{- if (.Param "ShowToc") }}
{{- partial "toc.html" . }} {{- partial "toc.html" . }}
{{- end }} {{- end }}

View File

@ -1,9 +1,10 @@
{{- with .cxt}} {{/* Apply proper context from dict */}} {{- with .cxt}} {{/* Apply proper context from dict */}}
{{- if (and .Params.cover.image (not $.isHidden)) }} {{- if (and .Params.cover.image (not $.isHidden)) }}
{{- $alt := (.Params.cover.alt | default .Params.cover.caption | plainify) }} {{- $alt := (.Params.cover.alt | default .Params.cover.caption | plainify) }}
{{- $loading := cond $.IsSingle "eager" "lazy" }}
<figure class="entry-cover"> <figure class="entry-cover">
{{- $responsiveImages := (.Params.cover.responsiveImages | default site.Params.cover.responsiveImages) | default true }} {{- $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)) }} {{- $pageBundleCover := (.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }}
{{- $globalResourcesCover := (resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} {{- $globalResourcesCover := (resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }}
{{- $cover := (or $pageBundleCover $globalResourcesCover)}} {{- $cover := (or $pageBundleCover $globalResourcesCover)}}
@ -17,7 +18,7 @@
{{- end -}} {{- end -}}
{{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }} {{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }}
{{- if (and (in $processableFormats $cover.MediaType.SubType) ($responsiveImages) (eq $prod true)) }} {{- if (and (in $processableFormats $cover.MediaType.SubType) ($responsiveImages) (eq $prod true)) }}
<img loading="lazy" srcset="{{- range $size := $sizes -}} <img loading="{{$loading}}" srcset="{{- range $size := $sizes -}}
{{- if (ge $cover.Width $size) -}} {{- if (ge $cover.Width $size) -}}
{{ printf "%s %s" (($cover.Resize (printf "%sx" $size)).Permalink) (printf "%sw ," $size) -}} {{ printf "%s %s" (($cover.Resize (printf "%sx" $size)).Permalink) (printf "%sw ," $size) -}}
{{ end }} {{ end }}
@ -25,16 +26,16 @@
sizes="(min-width: 768px) 720px, 100vw" src="{{ $cover.Permalink }}" alt="{{ $alt }}" sizes="(min-width: 768px) 720px, 100vw" src="{{ $cover.Permalink }}" alt="{{ $alt }}"
width="{{ $cover.Width }}" height="{{ $cover.Height }}"> width="{{ $cover.Width }}" height="{{ $cover.Height }}">
{{- else }}{{/* Unprocessable image or responsive images disabled */}} {{- else }}{{/* Unprocessable image or responsive images disabled */}}
<img loading="lazy" src="{{ (path.Join .RelPermalink .Params.cover.image) | absURL }}" alt="{{ $alt }}"> <img loading="{{$loading}}" src="{{ (path.Join .RelPermalink .Params.cover.image) | absURL }}" alt="{{ $alt }}">
{{- end }} {{- end }}
{{- else }}{{/* For absolute urls and external links, no img processing here */}} {{- else }}{{/* For absolute urls and external links, no img processing here */}}
{{- if $addLink }}<a href="{{ (.Params.cover.image) | absURL }}" target="_blank" {{- if $addLink }}<a href="{{ (.Params.cover.image) | absURL }}" target="_blank"
rel="noopener noreferrer">{{ end -}} rel="noopener noreferrer">{{ end -}}
<img loading="lazy" src="{{ (.Params.cover.image) | absURL }}" alt="{{ $alt }}"> <img loading="{{$loading}}" src="{{ (.Params.cover.image) | absURL }}" alt="{{ $alt }}">
{{- end }} {{- end }}
{{- if $addLink }}</a>{{ end -}} {{- if $addLink }}</a>{{ end -}}
{{/* Display Caption */}} {{/* Display Caption */}}
{{- if not $.IsHome }} {{- if $.IsSingle }}
{{ with .Params.cover.caption }}<p>{{ . | markdownify }}</p>{{- end }} {{ with .Params.cover.caption }}<p>{{ . | markdownify }}</p>{{- end }}
{{- end }} {{- end }}
</figure> </figure>

View File

@ -7,7 +7,7 @@
{{ .Content | markdownify }} {{ .Content | markdownify }}
</div> </div>
<footer class="entry-footer"> <footer class="entry-footer">
{{ partial "social_icons.html" site.Params.socialIcons }} {{ partial "social_icons.html" (dict "align" site.Params.homeInfoParams.AlignSocialIconsTo) }}
</footer> </footer>
</article> </article>
{{- end -}} {{- end -}}

View File

@ -32,7 +32,7 @@
{{- end }} {{- end }}
<h1>{{ .title | default site.Title | markdownify }}</h1> <h1>{{ .title | default site.Title | markdownify }}</h1>
<span>{{ .subtitle | markdownify }}</span> <span>{{ .subtitle | markdownify }}</span>
{{- partial "social_icons.html" site.Params.socialIcons -}} {{- partial "social_icons.html" -}}
{{- with .buttons }} {{- with .buttons }}
<div class="buttons"> <div class="buttons">

View File

@ -1,6 +1,7 @@
<div class="social-icons"> <div class="social-icons" {{ with .align}}align="{{.}}" {{- end }}>
{{- range . }} {{- range site.Params.socialIcons }}
<a href="{{ trim .url " " | safeURL }}" target="_blank" rel="noopener noreferrer me" title="{{ (.title | default .name) | title }}"> <a href="{{ trim .url " " | safeURL }}" target="_blank" rel="noopener noreferrer me"
title="{{ (.title | default .name) | title }}">
{{ partial "svg.html" . }} {{ partial "svg.html" . }}
</a> </a>
{{- end }} {{- end }}

View File

@ -41,12 +41,27 @@
{{- /* If it is part of a series, link to related articles */}} {{- /* If it is part of a series, link to related articles */}}
{{- $permalink := .Permalink }} {{- $permalink := .Permalink }}
{{- $siteSeries := site.Taxonomies.series }} {{- $siteSeries := site.Taxonomies.series }}
{{- if $siteSeries }}
{{ with .Params.series }}{{- range $name := . }} {{ with .Params.series }}{{- range $name := . }}
{{- $series := index $siteSeries ($name | urlize) }} {{- $series := index $siteSeries ($name | urlize) }}
{{- range $page := first 6 $series.Pages }} {{- range $page := first 6 $series.Pages }}
{{- if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}" />{{ end }} {{- if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}" />{{ end }}
{{- end }} {{- end }}
{{ end }}{{ end }} {{ end }}{{ end }}
{{- end }}
{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}}
{{- $facebookAdmin := "" }}
{{- with site.Params.social }}
{{- if reflect.IsMap . }}
{{- $facebookAdmin = .facebook_admin }}
{{- end }}
{{- 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 */}} {{- /* Facebook Page Admin ID for Domain Insights */}}
{{- with site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }} {{ with $facebookAdmin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}

View File

@ -28,6 +28,23 @@
{{- end }} {{- end }}
<meta name="twitter:title" content="{{ .Title }}"/> <meta name="twitter:title" content="{{ .Title }}"/>
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/> <meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/>
{{ with site.Social.twitter -}} {{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}}
<meta name="twitter:site" content="@{{ . }}"/> {{- $twitterSite := "" }}
{{ end -}} {{- with site.Params.social }}
{{- if reflect.IsMap . }}
{{- $twitterSite = .twitter }}
{{- end }}
{{- else }}
{{- with site.Social.twitter }}
{{- $twitterSite = . }}
{{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }}
{{- end }}
{{- end }}
{{- with $twitterSite }}
{{- $content := . }}
{{- if not (strings.HasPrefix . "@") }}
{{- $content = printf "@%v" $twitterSite }}
{{- end }}
<meta name="twitter:site" content="{{ $content }}"/>
{{- end }}

View File

@ -71,10 +71,10 @@
{{- end -}} {{- end -}}
{{- end }} {{- end }}
<li> <li>
<a href="#{{- $cleanedID -}}" aria-label="{{- $header | plainify -}}">{{- $header | safeHTML -}}</a> <a href="#{{- $cleanedID -}}" aria-label="{{- $header | plainify | safeHTML -}}">{{- $header | plainify | safeHTML -}}</a>
{{- else }} {{- else }}
<li> <li>
<a href="#{{- $cleanedID -}}" aria-label="{{- $header | plainify -}}">{{- $header | safeHTML -}}</a> <a href="#{{- $cleanedID -}}" aria-label="{{- $header | plainify | safeHTML -}}">{{- $header | plainify | safeHTML -}}</a>
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
<!-- {{- $firstHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers 0) 1) 0)) -}} --> <!-- {{- $firstHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers 0) 1) 0)) -}} -->

View File

@ -37,7 +37,7 @@ features = [
"scroll-to-top", "scroll-to-top",
"search" "search"
] ]
min_version = "0.97.1" min_version = "0.112.4"
[author] [author]
name = "Aditya Telange" name = "Aditya Telange"