source: tanzpartie-hugo/layouts/_default/baseof.html @ 17332

Last change on this file since 17332 was 17000, checked in by Henrik Bettermann, 2 years ago

Add header image.

File size: 4.5 KB
Line 
1<!DOCTYPE html>
2
3{{ if eq .Type "gallery" }}
4    {{ $image := (index (.Resources.ByType "image") 0 ) }}
5    {{ $imageUrl := "" }}
6
7    {{ if and (.Site.Params.resizeImages | default true) (.Params.resizeImages | default true) }}
8        {{ $imageUrl = ($image.Fill "700x350 q95").Permalink }}
9    {{ else }}
10        {{ $imageUrl = $image.Permalink }}
11    {{ end }}
12
13    {{ .Scratch.Set "image" $imageUrl }}
14
15{{ else if .Resources.GetMatch "featuredImage.*" }}
16    {{ $imageUrl := "" }}
17
18    {{ if and (.Site.Params.resizeImages | default true) (.Params.resizeImages | default true) }}
19         {{ $imageUrl = ((.Resources.GetMatch "featuredImage.*").Fill "700x350 q95").Permalink }}
20    {{ else }}
21        {{ $imageUrl = (.Resources.GetMatch "featuredImage.*").Permalink }}
22    {{ end }}
23
24    {{ .Scratch.Set "image" $imageUrl }}
25
26{{ else if .Params.featuredImage }}
27  {{ .Scratch.Set "image" (.Params.featuredImage | absURL) }}
28{{ else if .Params.mp4videoImage }}
29  {{ .Scratch.Set "image" (.Params.mp4videoImage | absURL) }}
30{{ else }}
31  {{ .Scratch.Set "image" (.Site.Params.featuredImage | absURL) }}
32{{ end }}
33
34{{- if ne .Description "" -}}
35{{ .Scratch.Set "description" (.Description) }}
36{{- else -}}
37{{- if eq .Title .Site.Title -}}
38{{ .Scratch.Set "description" (.Site.Params.description) }}
39{{- else -}}
40{{ .Scratch.Set "description" (printf "%s - %s" (.Title) (.Site.Params.description)) }}
41{{- end -}}
42{{- end -}}
43
44{{- if eq .Site.Title .Title -}}
45    {{ .Scratch.Set "title" (.Site.Params.subtitle) }}
46{{- else -}}
47    {{ .Scratch.Set "title" (.Title) }}
48{{- end -}}
49
50<html itemscope itemtype="https://schema.org/WebPage" class="no-js" lang="{{ .Site.Language.Lang }}">
51
52<head>
53    <meta charset="utf-8">
54    <meta name="viewport" content="width=device-width, initial-scale=1">
55    <meta name="siteBaseUrl" content="{{ .Site.BaseURL }}">
56    <meta name="author" content="{{ .Site.Params.author }}">
57    <meta name="description" content="{{ .Site.Params.description }}">
58    <meta name="keywords" content="{{ .Site.Params.keywords }}">
59    {{ hugo.Generator }}
60    <title>
61        {{ block "title" . }}
62           {{ if .Scratch.Get "title" }}
63               {{ .Scratch.Get "title" }} &vert; {{ .Site.Title }}
64           {{ else }}
65               {{ .Site.Title }}
66           {{ end }}
67        {{ end }}
68    </title>
69    <meta itemprop="name" content="{{ .Scratch.Get "title" }}">
70    <meta itemprop="description" content="{{ .Scratch.Get "description" }}">
71    <meta property="og:title" content="{{ .Scratch.Get "title" }}">
72    <meta property="og:description" content="{{ .Scratch.Get "description" }}">
73    <meta property="og:image" content="{{ .Scratch.Get "image" | absURL }}">
74    <meta property="og:url" content="{{ .Permalink | absURL }}">
75    <meta property="og:site_name" content="{{ .Site.Title }}">
76    {{- if .IsPage }}
77    <meta property="og:type" content="article">
78    {{- else -}}
79    <meta property="og:type" content="website">
80    {{- end }}
81
82    {{ partial "favicon.html" . }}
83
84    <script src="{{ "modernizr-simple.js" | relURL }}"></script>
85
86    {{ if .RelPermalink }}
87    <link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
88    <link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="{{ .Site.Title }}" />
89    {{ end }}
90
91    {{ with .Params.original_url }}
92    <link rel="canonical" href="{{ . }}" />
93    {{ else }}
94    <link rel="canonical" href="{{ .Permalink }}">
95    {{ end }}
96
97    <link rel="stylesheet" href="{{ "theme.css" | absURL }}">
98
99    {{ partial "twitter-card.html" . }}
100
101    {{ if isset .Site.Params "css_modules" }}
102        {{ range .Site.Params.css_modules }}
103            <link rel="stylesheet" href="{{ . | absURL }}">
104        {{ end }}
105    {{ end }}
106</head>
107
108<body class="bilberry-hugo-theme">
109
110    {{ partial "topnav.html" . }}
111
112    {{ partial "header.html" . }}
113
114    <div class="main container">
115        {{ block "main" . }}{{ end }}
116    </div>
117
118    {{ partial "footer.html" . }}
119
120    {{ template "_internal/google_analytics.html" . }}
121
122    {{ if and (isset .Site.Params "enable_mathjax") (eq .Site.Params.enable_mathjax true) }}
123    {{ partial "mathjax.html" . }}
124    {{ end }}
125
126
127    <script src="{{ "theme.js" | absURL }}"></script>
128
129    {{ if isset .Site.Params "js_modules" }}
130    {{ range .Site.Params.js_modules }}
131    <script src="{{ . | absURL }}" type="application/javascript"></script>
132    {{ end }}
133    {{ end }}
134
135    {{ if and (isset .Site.Params "algolia_search") (eq .Site.Params.algolia_search true) }}
136    {{ partial "algolia-search.html" . }}
137    {{ end }}
138</body>
139
140</html>
Note: See TracBrowser for help on using the repository browser.