From a5bb76fc2a35eda01e1775b69116df4d5861ae67 Mon Sep 17 00:00:00 2001
From: Karl <kc0bfv@gmail.com>
Date: Sun, 08 Dec 2019 19:22:50 +0000
Subject: [PATCH] Make description and author site/page optional
---
layouts/partials/head.html | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 9e66127..67bd42b 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -1,8 +1,16 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-<meta name="description" content="{{ .Params.description }}">
-<meta name="author" content="{{ .Params.author }}">
+{{- if isset .Params "description" -}} {{- $.Scratch.Set "description" .Params.description -}}
+{{- else -}}
+ {{- if isset .Site.Params "description" -}} {{- $.Scratch.Set "description" .Site.Params.description -}} {{- end -}}
+{{- end }}
+{{ with $.Scratch.Get "description" -}}<meta name="description" content="{{ . }}">{{- end }}
+{{- if isset .Params "author" -}} {{- $.Scratch.Set "author" .Params.author -}}
+{{- else -}}
+ {{- if isset .Site.Params "author" -}} {{- $.Scratch.Set "author" .Site.Params.author -}} {{- end -}}
+{{- end }}
+{{ with $.Scratch.Get "author" -}}<meta name="author" content="{{ . }}">{{- end }}
<link rel="icon" href="/{{ .Site.Params.favicon }}">
<title>{{ .Site.Title }}{{ with .Params.title }} - {{ . }}{{ end }}</title>
--
Gitblit v1.10.0