+
{{- .Title }}
- {{- if .Draft }} [draft]{{- end }}
+ {{- if .Draft }}
+
+
+
+ {{- end }}
+
{{ .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 0f8bfbc..e92b555 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)) }}
-
{{- else }}{{/* Unprocessable image or responsive images disabled */}}
-
+
{{- end }}
{{- else }}{{/* For absolute urls and external links, no img processing here */}}
{{- if $addLink }}{{ end -}}
-
+
{{- end }}
{{- if $addLink }}{{ end -}}
{{/* Display Caption */}}
- {{- if not $.IsHome }}
+ {{- if $.IsSingle }}
{{ with .Params.cover.caption }}{{ . | markdownify }}
{{- end }}
{{- end }}
diff --git a/layouts/partials/share_icons.html b/layouts/partials/share_icons.html
index 4ae1879..910ba7f 100644
--- a/layouts/partials/share_icons.html
+++ b/layouts/partials/share_icons.html
@@ -13,69 +13,83 @@
{{- $ShareButtons := (.Param "ShareButtons")}}
{{- with $ShareButtons }}{{ $custom = true }}{{ end }}
-
+
diff --git a/layouts/partials/templates/opengraph.html b/layouts/partials/templates/opengraph.html
index 9e8df14..38fbd24 100644
--- a/layouts/partials/templates/opengraph.html
+++ b/layouts/partials/templates/opengraph.html
@@ -41,12 +41,27 @@
{{- /* 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 }}
+
+{{- /* 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 */}}
-{{- 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 bd46e37..0e7760a 100644
--- a/layouts/partials/templates/twitter_cards.html
+++ b/layouts/partials/templates/twitter_cards.html
@@ -28,6 +28,23 @@
{{- end }}
-{{ with site.Social.twitter -}}
-
-{{ end -}}
+{{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}}
+{{- $twitterSite := "" }}
+{{- 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 }}
+
+{{- end }}
diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html
index d9b8b23..28f8694 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 -}}
diff --git a/theme.toml b/theme.toml
index aa26fe0..f659f5c 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"
{{ . | markdownify }}
{{- end }} {{- end }}