Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thegeeklab/hugo-geekblog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Kaussow <mail@thegeeklab.de>2022-02-06 14:46:10 +0300
committerGitHub <noreply@github.com>2022-02-06 14:46:10 +0300
commit1b3e25abc326d03b2330cc2e6ec15bbbe2475447 (patch)
treedc89f26d5df85948afc367614f44c97108942864 /layouts
parent91f44eb3a534022190b61093c4cb6cba8b37e2ca (diff)
use title partial when possible (#190)
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/list.atom.xml8
-rw-r--r--layouts/_default/list.json.json8
-rw-r--r--layouts/partials/head/others.html14
-rw-r--r--layouts/partials/head/schema.html4
-rw-r--r--layouts/partials/microformats/opengraph.html2
-rw-r--r--layouts/partials/microformats/twitter_cards.html2
-rw-r--r--layouts/partials/site-header.html2
7 files changed, 20 insertions, 20 deletions
diff --git a/layouts/_default/list.atom.xml b/layouts/_default/list.atom.xml
index a4187bc..01d79d7 100644
--- a/layouts/_default/list.atom.xml
+++ b/layouts/_default/list.atom.xml
@@ -2,10 +2,8 @@
<feed xmlns="http://www.w3.org/2005/Atom"{{ with .Site.Language.Lang }} xml:lang="{{ . }}"{{ end }}>
<generator uri="https://gohugo.io/" version="{{ hugo.Version }}">Hugo</generator>
{{- $title := .Site.Title -}}
- {{- with .Title -}}
- {{- if (not (eq . $title)) -}}
- {{- $title = printf `%s on %s` . $title -}}
- {{- end -}}
+ {{- if not (eq .Kind "home") -}}
+ {{- $title = printf `%s on %s` (partial "utils/title" .) $title -}}
{{- end -}}
{{ printf `<title type="html"><![CDATA[%s]]></title>` $title | safeHTML }}
{{ with .Site.Params.subtitle }}
@@ -37,7 +35,7 @@
{{- range $pages }}
{{ $page := . }}
<entry>
- {{ printf `<title type="html"><![CDATA[%s]]></title>` .Title | safeHTML }}
+ {{ printf `<title type="html"><![CDATA[%s]]></title>` (partial "utils/title" .) | safeHTML }}
<link href="{{ .Permalink }}?utm_source=atom_feed" rel="alternate" type="text/html" {{ with .Site.Language.Lang }} hreflang="{{ . }}"{{ end }} />
<id>{{ .Permalink }}</id>
{{ with .Params.authors -}}
diff --git a/layouts/_default/list.json.json b/layouts/_default/list.json.json
index af7bd50..af66370 100644
--- a/layouts/_default/list.json.json
+++ b/layouts/_default/list.json.json
@@ -1,8 +1,6 @@
{{- $title := .Site.Title -}}
-{{- with .Title -}}
- {{- if (not (eq . $title)) -}}
- {{- $title = printf `%s on %s` . $title -}}
- {{- end -}}
+{{- if not (eq .Kind "home") -}}
+ {{- $title = printf `%s on %s` (partial "utils/title" .) $title -}}
{{- end -}}
{
"version": "https://jsonfeed.org/version/1.1",
@@ -33,7 +31,7 @@
{{- $len := (len $pages) }}
{{- range $i, $page := $pages }}
{
- "title" : {{ .Title | jsonify }},
+ "title" : {{ (partial "utils/title" .) | jsonify }},
"date_published" : {{ (.Date.Format "2006-01-02T15:04:05Z07:00") | jsonify }},
"date_modified" : {{ (.Lastmod.Format "2006-01-02T15:04:05Z07:00") | jsonify }},
"id" : "{{ .Permalink }}",
diff --git a/layouts/partials/head/others.html b/layouts/partials/head/others.html
index 4d86bd0..f411277 100644
--- a/layouts/partials/head/others.html
+++ b/layouts/partials/head/others.html
@@ -66,12 +66,16 @@
media="all"
/>
-{{ with .OutputFormats.Get "atom" }}
- {{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
-{{ end }}
+{{- with (.Site.GetPage "home").OutputFormats.Get "atom" }}
+ {{ printf `<link rel="%s" type="%s" href="%s" title="%s Atom Feed">` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
+{{- end }}
-{{ if (default false $.Site.Params.GeekblogOverwriteHTMLBase) }}
+{{- with (.Site.GetPage "home").OutputFormats.Get "json" }}
+ {{ printf `<link rel="%s" type="%s" href="%s" title="%s JSON Feed">` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
+{{- end }}
+
+{{- if (default false $.Site.Params.GeekblogOverwriteHTMLBase) }}
<base href="{{ .Site.BaseURL }}" />
-{{ end }}
+{{- end }}
{{ printf "<!-- %s -->" "Made with Geekblog theme https://github.com/thegeeklab/hugo-geekblog" | safeHTML }}
diff --git a/layouts/partials/head/schema.html b/layouts/partials/head/schema.html
index 1d4e0de..e2f4ff0 100644
--- a/layouts/partials/head/schema.html
+++ b/layouts/partials/head/schema.html
@@ -29,8 +29,8 @@
"@context": "http://schema.org",
"@type": "BlogPosting",
"articleSection": "{{ .Section }}",
- "name": "{{ .Title | safeJS }}",
- "headline": "{{ .Title | safeJS }}",
+ "name": "{{ (partial "utils/title" .) | safeJS }}",
+ "headline": "{{ (partial "utils/title" .) | safeJS }}",
{{- with .Params.lead }}
"alternativeHeadline": "{{ . }}",
{{- end }}
diff --git a/layouts/partials/microformats/opengraph.html b/layouts/partials/microformats/opengraph.html
index 4af9f44..b763811 100644
--- a/layouts/partials/microformats/opengraph.html
+++ b/layouts/partials/microformats/opengraph.html
@@ -1,4 +1,4 @@
-<meta property="og:title" content="{{ .Title }}" />
+<meta property="og:title" content="{{ partial "utils/title" . }}" />
{{ with partial "utils/description" . }}
<meta property="og:description" content="{{ trim (. | plainify) "\n" }}" />
{{ end }}
diff --git a/layouts/partials/microformats/twitter_cards.html b/layouts/partials/microformats/twitter_cards.html
index 035e877..aadd2ab 100644
--- a/layouts/partials/microformats/twitter_cards.html
+++ b/layouts/partials/microformats/twitter_cards.html
@@ -17,7 +17,7 @@
{{- end -}}
{{- end -}}
{{- end }}
-<meta name="twitter:title" content="{{ .Title }}" />
+<meta name="twitter:title" content="{{ partial "utils/title" . }}" />
{{- with partial "utils/description" . }}
<meta name="twitter:description" content="{{ trim (. | plainify) "\n" }}" />
{{- end }}
diff --git a/layouts/partials/site-header.html b/layouts/partials/site-header.html
index 008c01c..6066bcc 100644
--- a/layouts/partials/site-header.html
+++ b/layouts/partials/site-header.html
@@ -53,7 +53,7 @@
class="gblog-nav__entry {{ if eq $currentPage .RelPermalink }}is-active{{ end }}"
href="{{ .RelPermalink }}"
>
- {{ .Title }}
+ {{ partial "utils/title" . }}
</a>
</li>
{{ end }}