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

github.com/de-souza/hugo-flex.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorde-souza <43355143+de-souza@users.noreply.github.com>2020-03-06 19:52:44 +0300
committerde-souza <43355143+de-souza@users.noreply.github.com>2020-03-06 19:52:44 +0300
commitf5fcf1d63796deb913f778b90a9ee6fe5c815aa1 (patch)
tree2582d18c7bbbc44d61790918ee53ecd9e084e1d4
parent1a08fc62f2a8e8c7751c85029960777b59b941ee (diff)
parentb1d8f1ac770800352657c80eb9da90ccb7ca2101 (diff)
Put all metatata in a separate partial
-rw-r--r--layouts/_default/baseof.html18
-rw-r--r--layouts/partials/meta.html17
2 files changed, 18 insertions, 17 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index b5279a0..5282f44 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -1,23 +1,7 @@
<!DOCTYPE html>
<html lang="{{ site.LanguageCode }}">
<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- {{ with .Description }}
- <meta name="description" content="{{ . }}">
- {{ else }}
- {{ if .IsPage }}
- <meta name="description" content="{{ .Summary }}">
- {{ else }}
- {{ with .Site.Params.description }}
- <meta name="description" content="{{ . }}">
- {{ end }}
- {{ end }}
- {{ end }}
- {{ hugo.Generator }}
- {{ if site.Params.schema }}{{ template "_internal/schema.html" . }}{{ end }}
- {{ if site.Params.opengraph }}{{ template "_internal/opengraph.html" . }}{{ end }}
- {{ if site.Params.twittercards }}{{ template "_internal/twitter_cards.html" . }}{{ end }}
+ {{ partial "meta.html" . }}
<title>
{{ if eq .Title site.Title }}
{{ site.Title }}
diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html
new file mode 100644
index 0000000..696e244
--- /dev/null
+++ b/layouts/partials/meta.html
@@ -0,0 +1,17 @@
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+{{ with .Description }}
+<meta name="description" content="{{ . }}">
+{{ else }}
+{{ if .IsPage }}
+<meta name="description" content="{{ .Summary }}">
+{{ else }}
+{{ with .Site.Params.description }}
+<meta name="description" content="{{ . }}">
+{{ end }}
+{{ end }}
+{{ end }}
+{{ if site.Params.schema }}{{ template "_internal/schema.html" . }}{{ end }}
+{{ if site.Params.opengraph }}{{ template "_internal/opengraph.html" . }}{{ end }}
+{{ if site.Params.twittercards }}{{ template "_internal/twitter_cards.html" . }}{{ end }}
+{{ hugo.Generator }}