From cad2f67c2f98dd6fe15c402de1bf6c1801bd30dc Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Tue, 12 Jul 2022 23:51:05 +0200 Subject: Improve formating of generated code --- layouts/partials/head.html | 14 +++++++------- layouts/partials/schema.org/article.html | 18 ++++++++---------- layouts/partials/schema.org/website.html | 2 +- layouts/partials/templates/twitter_cards.html | 10 +++++----- 4 files changed, 21 insertions(+), 23 deletions(-) (limited to 'layouts') diff --git a/layouts/partials/head.html b/layouts/partials/head.html index ee88371..934ccc9 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -23,18 +23,18 @@ {{- range .AllTranslations -}} - {{ end -}} + {{- end }} - {{ block "custom-head" . }}{{ partial "custom-head.html" . }}{{ end }} - {{ block "custom-scripts" . }}{{ partial "custom-scripts.html" . }}{{ end }} + {{- block "custom-head" . }}{{ partial "custom-head.html" . }}{{ end }} + {{- block "custom-scripts" . }}{{ partial "custom-scripts.html" . }}{{ end }} {{- /* Misc */}} - {{ template "partials/templates/opengraph.html" . }} - {{ template "partials/templates/twitter_cards.html" . }} - {{ template "partials/templates/schema_json.html" . }} + {{- template "partials/templates/opengraph.html" . }} + {{- template "partials/templates/twitter_cards.html" . }} + {{- template "partials/templates/schema_json.html" . }} {{- /* SEO */}} - {{ partial "partials/seo/ga.html" . }} + {{- partial "partials/seo/ga.html" . }} diff --git a/layouts/partials/schema.org/article.html b/layouts/partials/schema.org/article.html index 821a1c8..05c8358 100644 --- a/layouts/partials/schema.org/article.html +++ b/layouts/partials/schema.org/article.html @@ -1,14 +1,14 @@ {{- /* Get schema type. */}} -{{ $schemaType := "Article" }} -{{ if or (eq .Type "post") (eq .Type "posts") }} - {{ $schemaType = "BlogPosting" }} -{{ end -}} +{{- $schemaType := "Article" -}} +{{- if or (eq .Type "post") (eq .Type "posts") -}} + {{- $schemaType = "BlogPosting" -}} +{{- end -}} -{{- $publisher := site.Params.seo.publisher | default site.Title }} -{{ $logo := resources.Get (site.Params.assets.logo | default "/img/open-graph-logo.png") }} -{{ $logo = $logo.Resize "96x96" -}} +{{- $publisher := site.Params.seo.publisher | default site.Title -}} +{{- $logo := resources.Get (site.Params.assets.logo | default "/img/open-graph-logo.png") -}} +{{- $logo = $logo.Resize "96x96" }} - - - diff --git a/layouts/partials/schema.org/website.html b/layouts/partials/schema.org/website.html index a84d110..c06bd76 100644 --- a/layouts/partials/schema.org/website.html +++ b/layouts/partials/schema.org/website.html @@ -1,4 +1,4 @@ -