Improve formating of generated code
This commit is contained in:
parent
4217561a5e
commit
cad2f67c2f
4 changed files with 21 additions and 23 deletions
layouts/partials
|
@ -23,18 +23,18 @@
|
|||
|
||||
{{- range .AllTranslations -}}
|
||||
<link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}">
|
||||
{{ end -}}
|
||||
{{- end }}
|
||||
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
{{ 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" . }}
|
||||
</head>
|
||||
|
|
|
@ -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" }}
|
||||
|
||||
<script type="application/ld+json">
|
||||
<script type="application/ld+json" id="schema-data">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": {{ $schemaType }},
|
||||
|
@ -62,5 +62,3 @@
|
|||
"description": {{ partial "description.html" . }}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<script type="application/ld+json">
|
||||
<script type="application/ld+json" id="schema-data">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebSite",
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
{{- $logo := resources.Get (site.Params.assets.logo | default "/img/open-graph-logo.png" ) -}}
|
||||
|
||||
{{- if and .IsPage .Params.featured_image }}
|
||||
{{- $image := .Resources.GetMatch .Params.featured_image }}
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:image" content="{{ $image.Permalink }}">
|
||||
{{- $image := .Resources.GetMatch .Params.featured_image }}
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:image" content="{{ $image.Permalink }}">
|
||||
{{- else }}
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:image" content="{{ $logo.Permalink }}">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:image" content="{{ $logo.Permalink }}">
|
||||
{{- end -}}
|
||||
|
|
Loading…
Reference in a new issue