Files
Protocol-oral-history-project/layouts/_default/baseof.html
2025-04-25 22:32:06 -06:00

98 lines
3.5 KiB
HTML

<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode | default "en" }}">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{{/* Generate consistent title */}}
{{ $title := "" }}
{{ if .Params.narrator }}
{{ $title = printf "%s: %s" .Params.narrator .Params.subject }}
{{ else if .IsHome }}
{{ $title = .Title }}
{{ else }}
{{ $title = printf "%s - %s" .Title .Site.Title }}
{{ end }}
<!-- Basic SEO -->
<title>{{ $title }}{{ if .Params.narrator }} - {{ .Site.Title }}{{ end }}</title>
{{/* Generate description from summary, description, or default site description */}}
{{ $description := "" }}
{{ with .Description }}
{{ $description = . }}
{{ else }}
{{ with .Summary }}
{{ $description = . | plainify | truncate 160 }}
{{ else }}
{{ $description = .Site.Params.description }}
{{ end }}
{{ end }}
<meta name="description" content="{{ $description }}" />
{{/* Generate keywords from topics */}}
{{ with .Params.topics }}
<meta name="keywords" content="{{ delimit . ", " }}" />
{{ end }}
<!-- Open Graph / Facebook -->
<meta property="og:site_name" content="{{ .Site.Title }}" />
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" />
<meta property="og:title" content="{{ $title }}" />
<meta property="og:description" content="{{ $description }}" />
{{ with .Params.ogImage | default .Site.Params.openGraphImage }}
<meta property="og:image" content="{{ . | absURL }}" />
{{ end }}
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="{{ $title }}" />
<meta name="twitter:description" content="{{ $description }}" />
{{ with .Params.ogImage | default .Site.Params.openGraphImage }}
<meta name="twitter:image" content="{{ . | absURL }}" />
{{ end }}
<!-- Article Specific -->
{{ if and .IsPage (eq .Type "articles") }}
<meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}" />
<meta property="article:modified_time" content="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}" />
<meta property="article:section" content="Oral History" />
{{ with .Params.topics }}
{{ range . }}
<meta property="article:tag" content="{{ . }}" />
{{ end }}
{{ end }}
{{/* Author information using standard meta topics instead of article:author */}}
{{ with .Params.narrator }}
<meta name="author" content="{{ . }}" />
{{ end }}
{{ with .Params.facilitator }}
<meta name="interviewer" content="{{ . }}" />
{{ end }}
{{ end }}
<!-- Canonical URL -->
<link rel="canonical" href="{{ .Permalink }}" />
<!-- CSS Styles -->
{{ partial "css.html" . }}
</head>
<body class="">
{{ partial "header.html" . }}
<div class="px-4 lg:mx-auto">
{{ block "main" . }}{{ end }}
</div>
{{ partial "footer.html" . }}
{{ $js := resources.Match "js/*.js" | resources.Concat "js/bundle.js" }}
{{ if hugo.IsProduction }}
{{ $js = $js | minify | fingerprint }}
<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}" crossorigin="anonymous"></script>
{{ else }}
<script src="{{ $js.RelPermalink }}"></script>
{{ end }}
</body>
</html>