diff options
| author | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-07-20 20:13:51 +0530 |
|---|---|---|
| committer | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-07-20 20:13:51 +0530 |
| commit | 2e0ef75edf86bd6b350f153b3791e2a453b1e95e (patch) | |
| tree | 4039e14d076328c5ae7d330d27cf26a92bf4d188 | |
| parent | e933bf39b74518c8739a9d6a683b3fe5ebca066d (diff) | |
separate head
| -rw-r--r-- | layouts/partials/head.html | 36 | ||||
| -rw-r--r-- | layouts/partials/header.html | 37 |
2 files changed, 37 insertions, 36 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..91687be --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,36 @@ +<meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> +<!-- Title --> +<title>{{ if .Title }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title> +<!-- Meta --> +{{- if eq .Kind "page" }} +<meta name="description" content="{{ .Summary }}"> +<meta name="author" content="{{ .Params.author | default .Site.Params.author }}"> +{{- else }} +<meta name="description" content="{{ .Site.Params.description }}"> +<meta name="author" content="{{ .Site.Params.author }}"> +{{- end }} +<!-- Styles --> +{{ $anoldhope := resources.Get "an-old-hope.min.css" | minify }} +{{ $style := resources.Get "style.css" | minify }} +{{ $stylesheet := slice $anoldhope $style | resources.Concat "stylesheet.css" | minify }} +<link href="{{ $stylesheet.Permalink }}" rel="stylesheet"> +<link href="{{ "custom.css" | absURL }}" rel="stylesheet"> +<!-- Favicons --> +<link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | absURL }}"> +<link rel="icon" href="{{ "favicon.ico" | absURL }}"> +<!-- Generator --> +{{- hugo.Generator }} +<!-- RSS --> +{{ range .AlternativeOutputFormats -}} +{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} +{{ end -}} +<!-- Misc --> +{{- if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} +{{- template "_internal/google_analytics_async.html" . }} +{{- template "_internal/opengraph.html" . }} +{{- end }} +<!-- Script --> +{{ $settheme := resources.Get "set-theme.js" | minify }} +<script src="{{ $settheme.Permalink }}"></script>
\ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index d110ffd..938d24c 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -2,42 +2,7 @@ <html lang="{{ .Site.LanguageCode }}"> <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> - <!-- Title --> - <title>{{ if .Title }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title> - <!-- Meta --> - {{- if eq .Kind "page" }} - <meta name="description" content="{{ .Summary }}"> - <meta name="author" content="{{ .Params.author | default .Site.Params.author }}"> - {{- else }} - <meta name="description" content="{{ .Site.Params.description }}"> - <meta name="author" content="{{ .Site.Params.author }}"> - {{- end }} - <!-- Styles --> - {{ $anoldhope := resources.Get "an-old-hope.min.css" | minify }} - {{ $style := resources.Get "style.css" | minify }} - {{ $stylesheet := slice $anoldhope $style | resources.Concat "stylesheet.css" | minify }} - <link href="{{ $stylesheet.Permalink }}" rel="stylesheet"> - <link href="{{ "custom.css" | absURL }}" rel="stylesheet"> - <!-- Favicons --> - <link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | absURL }}"> - <link rel="icon" href="{{ "favicon.ico" | absURL }}"> - <!-- Generator --> - {{- hugo.Generator }} - <!-- RSS --> - {{ range .AlternativeOutputFormats -}} - {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} - {{ end -}} - <!-- Misc --> - {{- if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} - {{- template "_internal/google_analytics_async.html" . }} - {{- template "_internal/opengraph.html" . }} - {{- end }} - <!-- Script --> - {{ $settheme := resources.Get "set-theme.js" | minify }} - <script src="{{ $settheme.Permalink }}"></script> + {{- partial "head.html" . }} </head> <body class="{{ if eq .Kind `page` }}single{{ else }}list{{ if .IsHome }} home{{ end }}{{ end }}"> |
