This repository has been archived on 2024-09-02. You can view files and clone it, but cannot push or open issues or pull requests.
hugo-theme-nocolor/layouts/_default/baseof.html
tastytea f682b9da6f
Set correct HTML and RSS language.
Before: Global value for everything.
After: Right value for translations.
2021-07-09 14:00:02 +02:00

48 lines
2.0 KiB
HTML

<!DOCTYPE html>
<html lang="{{ default "en" .Lang }}">
<head>
<meta charset="utf-8" />
<title>{{ if and (.Title) (not (eq .Title .Site.Title)) }}{{ .Title }} | {{ end }}{{ .Site.Title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
<meta name="author" content="{{ .Site.Author.name }}" />
{{ if .Site.Params.opengraph }}{{ template "_internal/opengraph.html" . }}{{ end -}}
{{ if .Site.Params.schema }}{{ template "_internal/schema.html" . }}{{ end -}}
{{ if .Site.Params.twitter_cards }}{{ template "_internal/twitter_cards.html" . }}{{ end -}}
{{ hugo.Generator }}
{{- with .Site.Home.OutputFormats.Get "RSS" }}
{{- $rssLink := .RelPermalink }}
<link href="{{ $rssLink }}" rel="{{ .Rel }}" type="application/rss+xml" title="{{ $.Site.Title }} Feed" />
{{- with $.Page.OutputFormats.Get "RSS" }}
{{- if ne $rssLink .RelPermalink }}
<link href="{{ .RelPermalink }}" rel="{{ .Rel }}" type="application/rss+xml" title="{{ $.Site.Title }}: {{ $.Title }} Feed" />
{{- end }}
{{- end }}
{{- end }}
{{- with .Site.Params.favicon | default "favicon.ico" }}
{{- if resources.Get . }}
{{- $favicon := resources.Get . }}
<link rel="shortcut icon" href="{{ $favicon.RelPermalink }}" type="{{ $favicon.MediaType }}" />
{{- end }}
{{- end }}
{{- $style := resources.Get "nocolor.css" }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" />
{{- with .Site.Params.css }}
{{- if resources.Get . }}
{{- $styleCustom := resources.Get . }}
<link rel="stylesheet" href="{{ $styleCustom.RelPermalink }}" />
{{- end }}
{{- end }}
{{ partial "extra_head.html" . }}
</head>
<body>
{{ partial "header.html" . }}
<main>
{{ block "main" . }}{{ end }}
</main>
{{ partial "extra_foot.html" . }}
{{ partial "footer.html" . }}
</body>
</html>