all repos — archie @ 1f47eeb7bedefd8fee4d8bae7072766cfa2219ad

A minimal Hugo Theme

layouts/partials/header.html (view raw)

 1<head>
 2	<meta charset="utf-8" />
 3	<meta http-equiv="X-UA-Compatible" content="IE=edge">
 4	{{- $title := ( .Title ) -}}
 5	{{- $siteTitle := ( .Site.Title ) -}}
 6	{{- if .IsHome -}}
 7	<title>{{ $siteTitle }} | Home </title>
 8	{{- else -}}
 9	<title>{{ $title }} - {{ $siteTitle }}</title>
10	{{- end -}}
11
12	{{- if isset .Site.Params "favicon" -}}
13	<link rel="icon" type="image/png" href={{ .Site.Params.favicon }} />
14	{{- end -}}
15
16	<meta name="viewport" content="width=device-width, initial-scale=1">
17	{{- if isset .Site.Params "description" }}
18	<meta name="description" content="{{ .Site.Params.description }}" />
19	{{- end }}
20	<meta property="og:image" content="{{ .Site.Params.og_image }}"/>
21	{{ with .OutputFormats.Get "rss" -}}
22	{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
23	{{ end -}}
24	
25	{{- template "_internal/opengraph.html" . -}}
26	{{- template "_internal/twitter_cards.html" . -}}
27	{{ if and (isset .Site.Params "social") (.Site.Params.useCDN | default false) -}}
28		<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
29	{{- else if (isset .Site.Params "social") -}}
30		<script src="{{ .Site.BaseURL }}js/feather.min.js"></script>
31	{{ end }}
32	{{ if .Site.Params.useCDN | default false -}}
33        <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@1,500&display=swap" rel="stylesheet">
34        <link href="https://fonts.googleapis.com/css2?family=Fira+Sans&display=swap" rel="stylesheet">
35        <link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
36	{{- else -}}
37        <link href="{{ .Site.BaseURL }}css/fonts.css" rel="stylesheet">
38	{{ end }}
39	<link rel="stylesheet" type="text/css" media="screen" href="{{ .Site.BaseURL }}css/main.css" />
40	{{- if or (eq .Site.Params.mode "auto") (eq .Site.Params.mode "dark") -}}
41		<link rel="stylesheet" type="text/css" href="{{ .Site.BaseURL }}css/dark.css" {{ if eq .Site.Params.mode "auto" }}media="(prefers-color-scheme: dark)"{{ end }} />
42	{{ end }}
43	<!-- Custom CSS style get applied last -->
44	{{- if isset .Site.Params "customcss" }}
45		{{ range .Site.Params.customCSS }}
46		<link rel="stylesheet" type="text/css" href="{{ . | relURL }}">
47		{{ end }}
48	{{- end -}}
49	{{- range .Site.Params.customJS }}
50	{{- if or (hasPrefix . "http://") (hasPrefix . "https://") }}
51	<script src="{{ . }}"></script>
52	{{- else }}
53	<script src="{{ $.Site.BaseURL }}{{ . }}"></script>
54	{{- end }}
55	{{- end }}
56</head>