aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2023-12-30 16:39:52 -0500
committertdro <tdro@noreply.example.com>2023-12-30 16:39:52 -0500
commit937d0e35700c85c7d683dd33a7f542442d8ec11c (patch)
treed9b071862fdd2b51b9d0f9fb864cfbf4fb5a0df6 /themes/default/layouts
parent3b43bb9fbe661cb35201082fca9b0924da22bb03 (diff)
downloadcanory-937d0e35700c85c7d683dd33a7f542442d8ec11c.tar.gz
canory-937d0e35700c85c7d683dd33a7f542442d8ec11c.tar.bz2
canory-937d0e35700c85c7d683dd33a7f542442d8ec11c.zip
config: Simplify author site data
Diffstat (limited to 'themes/default/layouts')
-rw-r--r--themes/default/layouts/_default/home.authors.html2
-rw-r--r--themes/default/layouts/_default/home.authors.section.html2
-rw-r--r--themes/default/layouts/partials/base-discovery.html9
-rw-r--r--themes/default/layouts/partials/base-footer.html12
-rw-r--r--themes/default/layouts/partials/base-head.html27
-rw-r--r--themes/default/layouts/partials/base-title.html2
-rw-r--r--themes/default/layouts/partials/function-authors-data.html6
7 files changed, 23 insertions, 37 deletions
diff --git a/themes/default/layouts/_default/home.authors.html b/themes/default/layouts/_default/home.authors.html
index 87ebc3c..3854ebe 100644
--- a/themes/default/layouts/_default/home.authors.html
+++ b/themes/default/layouts/_default/home.authors.html
@@ -26,7 +26,7 @@
{{- $authors := partial "function-authors-slice.html" . -}}
{{- range $author := $authors -}}
- {{- $data := index $.Site.Data $author | default "default" -}}
+ {{- $data := index $.Site.Data $author -}}
{{- $date := (index (first 1 (where $.Site.Pages.ByDate.Reverse "Section" $author)) 0).Date -}}
{{- partial "author-card.html" (dict
"Data" $data
diff --git a/themes/default/layouts/_default/home.authors.section.html b/themes/default/layouts/_default/home.authors.section.html
index 4374f69..20ffdc6 100644
--- a/themes/default/layouts/_default/home.authors.section.html
+++ b/themes/default/layouts/_default/home.authors.section.html
@@ -9,7 +9,7 @@
{{- if $modified -}}
{{- range $author := first 3 $authors -}}
- {{- $data := index $.Site.Data $author | default "default" -}}
+ {{- $data := index $.Site.Data $author -}}
{{- $date := (index (first 1 (where $.Site.Pages.ByDate.Reverse "Section" $author)) 0).Date -}}
{{- partial "author-card.html" (dict
"Data" $data
diff --git a/themes/default/layouts/partials/base-discovery.html b/themes/default/layouts/partials/base-discovery.html
index 69406ef..8c7272f 100644
--- a/themes/default/layouts/partials/base-discovery.html
+++ b/themes/default/layouts/partials/base-discovery.html
@@ -1,11 +1,4 @@
-{{-
- $authorData := (dict
- "Context" .
- "AuthorDefaultUser" .Site.Author.default.home
- )
--}}
-
-{{- $author := partial "function-authors-data.html" (dict "Data" $authorData) -}}
+{{- $author := partial "function-authors-data.html" . -}}
{{- with (eq .Page.Kind "home") -}}
<link
diff --git a/themes/default/layouts/partials/base-footer.html b/themes/default/layouts/partials/base-footer.html
index 53b3b2f..3873153 100644
--- a/themes/default/layouts/partials/base-footer.html
+++ b/themes/default/layouts/partials/base-footer.html
@@ -1,14 +1,14 @@
{{- $kind := in (slice "home" "taxonomy" "term") .Page.Kind -}}
-{{- $author := index .Site.Data ((or .Section .Site.Author.default.footer) | default "default") -}}
+{{- $author := index .Site.Data .Section -}}
<footer>
- {{- with .Site.Author.footer -}}
- {{- if $kind -}}
- {{ . | markdownify }} &middot;
+ {{- if $kind -}}
+ {{- with $footer := (and $kind .Site.Author.default.footer) -}}
+ {{ $footer | markdownify }} &middot;
Copyright &copy; {{ now | time.Format "2006"}} &middot;
- {{- else -}}
- {{ or $author.footer $author.title | markdownify }} &middot;
{{- end -}}
+ {{- else -}}
+ {{ or $author.default.footer $author.title | markdownify }} &middot;
{{- end }}
<a href="/sitemap.xml" >Site Map</a>
</footer>
diff --git a/themes/default/layouts/partials/base-head.html b/themes/default/layouts/partials/base-head.html
index 1fdfe4e..0fbeb3a 100644
--- a/themes/default/layouts/partials/base-head.html
+++ b/themes/default/layouts/partials/base-head.html
@@ -1,20 +1,15 @@
-{{-
- $authorData := (dict
- "Context" .
- "AuthorDefaultUser" .Site.Author.default.home
- )
--}}
-
-{{- $author := partial "function-authors-data.html" (dict "Data" $authorData) -}}
-
{{- $noindex := "" -}}
-{{- if or .Params.Feed .Params.Unlisted .Params.ExpiryDate -}}
+{{- $author := .Section -}}
+{{- $authors := partial "function-authors-data.html" . -}}
+{{- $image := print ("" | absURL) "/data/media/" $author "/" $author "-profile.png" -}}
+
+{{- with or .Params.Feed .Params.Unlisted .Params.ExpiryDate -}}
{{- $noindex = "noindex,nofollow" -}}
{{- end }}
<!-- HTML Meta Tags -->
<meta charset="utf-8" />
-<meta name="author" content="{{ $author.name -}}" />
+<meta name="author" content="{{ $authors.name -}}" />
<meta name="robots" content="{{ or $noindex .Site.Params.site.robots "index,follow" }}" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="keywords" content="{{- partial "base-title.html" . -}}" />
@@ -22,14 +17,14 @@
<!-- Search Engine Tags -->
<meta itemprop="name" content="{{ partial "base-title.html" . -}}" />
-<meta itemprop="description" content="{{ if .Params.summary }}{{ .Params.summary }}{{ else }}{{ .Summary }}{{ end }}" />
-<meta itemprop="image" content="{{ .Site.BaseURL }}/{{ $author.user -}}/media/profile/picture.png" />
+<meta itemprop="description" content="{{- partial "base-description.html" . -}}" />
+<meta itemprop="image" content="{{ $image }}" />
<!-- Open Graph Meta Tags -->
<meta property="og:title" content="{{ partial "base-title.html" . -}}" />
<meta property="og:description" content="{{- partial "base-description.html" . -}}" />
<meta property="og:url" content="{{ .Permalink }}" />
-<meta property="og:image" content="{{ .Site.BaseURL }}/{{ $author.user -}}/media/profile/picture.png" />
+<meta property="og:image" content="{{ $image }}" />
<meta property="og:type" content="website" />
<meta property="article:published_time" content="{{ (or .Params.PublishDate now.UTC) | time.Format "2006-01-02T15:04:05Z" }}" />
<meta property="article:modified_time " content="{{ (or .Params.LastMod now.UTC) | time.Format "2006-01-02T15:04:05Z" }}" />
@@ -38,14 +33,14 @@
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="{{ partial "base-title.html" . -}}" />
<meta name="twitter:description" content="{{- partial "base-description.html" . -}}" />
-<meta name="twitter:image" content="{{ .Site.BaseURL }}/{{ $author.user -}}/media/profile/picture.png" />
+<meta name="twitter:image" content="{{ $image }}" />
<!-- Extra Meta Tags -->
<meta name='base-url' content="{{ "" | absURL }}" />
<meta name='last-modified' content="{{ now.UTC.Format "Mon, 02 Jan 2006 15:04:05 GMT" }}" />
<!-- Link Tags -->
-<link rel="home" href="{{ .Site.BaseURL }}/{{ $author.user }}/" />
+<link rel="home" href="{{ "" | absURL }}/{{ $authors.user }}/" />
<!-- Search Verification -->
{{- partial "base-search.html" . -}}
diff --git a/themes/default/layouts/partials/base-title.html b/themes/default/layouts/partials/base-title.html
index 79e34ca..c8736b1 100644
--- a/themes/default/layouts/partials/base-title.html
+++ b/themes/default/layouts/partials/base-title.html
@@ -1,4 +1,4 @@
-{{- $author := index .Site.Data ((or .Section .Site.Author.default.title) | default "default") -}}
+{{- $author := index .Site.Data .Section -}}
{{- if not (eq .Title $.Site.Title) -}}
{{- with $title := or .Title .Summary -}}
diff --git a/themes/default/layouts/partials/function-authors-data.html b/themes/default/layouts/partials/function-authors-data.html
index 88af43d..d9eaade 100644
--- a/themes/default/layouts/partials/function-authors-data.html
+++ b/themes/default/layouts/partials/function-authors-data.html
@@ -1,11 +1,9 @@
-{{- $input := or .Data.Context . -}}
+{{- $input := . -}}
{{- $pageContext := $input -}}
-{{- $authorDefaultUser := or .Data.AuthorDefaultUser $pageContext.Site.Author.default.user -}}
-
{{- $author := $pageContext.Section -}}
-{{- $output := index $pageContext.Site.Data ((or $author $authorDefaultUser) | default "default") -}}
+{{- $output := index $pageContext.Site.Data $author -}}
{{- return $output -}}