feat: add "head" block

This commit is contained in:
Jimmy Cai 2020-09-26 23:00:48 +02:00
parent 6e48765d82
commit c19780280e
No known key found for this signature in database
GPG Key ID: 3EA408E527F37B18
2 changed files with 22 additions and 21 deletions

View File

@ -1,6 +1,9 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}"> <html lang="{{ .Site.LanguageCode }}">
<head>
{{- partial "head/head.html" . -}} {{- partial "head/head.html" . -}}
{{- block "head" . -}}{{ end }}
</head>
<body class="{{ block `body-class` . }}{{ end }}"> <body class="{{ block `body-class` . }}{{ end }}">
<div class="container flex on-phone--column align-items--flex-start {{ if .Site.Params.widgets.enabled }}extended{{ else }}compact{{ end }} {{ block `container-class` . }}{{end}}"> <div class="container flex on-phone--column align-items--flex-start {{ if .Site.Params.widgets.enabled }}extended{{ else }}compact{{ end }} {{ block `container-class` . }}{{end}}">
{{ partial "sidebar/left.html" . }} {{ partial "sidebar/left.html" . }}

View File

@ -1,22 +1,20 @@
<head> <meta charset='utf-8'>
<meta charset='utf-8'> <meta name='viewport' content='width=device-width, initial-scale=1'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
{{- $description := partialCached "data/description" . .RelPermalink -}} {{- $description := partialCached "data/description" . .RelPermalink -}}
<meta name='description' content='{{ $description }}'> <meta name='description' content='{{ $description }}'>
{{- $title := partialCached "data/title" . .RelPermalink -}} {{- $title := partialCached "data/title" . .RelPermalink -}}
<title>{{ $title }}</title> <title>{{ $title }}</title>
<link rel='canonical' href='{{ .Permalink }}'> <link rel='canonical' href='{{ .Permalink }}'>
{{- partial "head/style.html" . -}} {{- partial "head/style.html" . -}}
{{- partial "head/script.html" . -}} {{- partial "head/script.html" . -}}
{{- partial "head/opengraph/include.html" . -}} {{- partial "head/opengraph/include.html" . -}}
{{- range .AlternativeOutputFormats -}} {{- range .AlternativeOutputFormats -}}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}"> <link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
{{- end -}} {{- end -}}
{{- partial "head/custom.html" . -}} {{- partial "head/custom.html" . -}}
</head>