CHANGE image handling, ADD partials to reuse structure, REFACTOR
This commit is contained in:
parent
1265491dee
commit
01dcf04b8a
36 changed files with 1181 additions and 864 deletions
|
@ -1,63 +1,52 @@
|
|||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="{{ .Site.LanguageCode }}">
|
||||
<head>
|
||||
<meta name="description" content="{{ if .Params.summary }}{{ .Params.summary }}{{ else if .Site.Params.Description }}{{ .Site.Params.Description }}{{ else }}Hardcoded description; the author should update :){{ end }}" />
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no" />
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title>{{ if .Title }}{{ .Title }}{{ else }}{{ .Site.Title }}{{ end }}</title>
|
||||
{{ block "opengraph" . }}
|
||||
<meta property="og:type" content="website" />
|
||||
{{ with .Site.LanguageCode }}
|
||||
<meta property="og:locale" content='{{ replace . "-" "_" }}' />
|
||||
{{ end }}
|
||||
<meta property="og:title" content="{{ if .Title }}{{ .Title }}{{ else }}{{ .Site.Title }}{{ end }}" />
|
||||
<meta property="og:url" content="{{ .Permalink }}" />
|
||||
<meta property="og:site_name" content="{{ .Site.Title }}" />
|
||||
{{ if .Params.image }}
|
||||
<meta property="og:image" content="{{ .Params.image | absURL }}" />
|
||||
{{ else }}
|
||||
<meta property="og:image" content="{{ .Site.Params.logo | absURL }}" />
|
||||
{{ end }}
|
||||
{{ if .Params.summary }}
|
||||
<meta property="og:description" content="{{ .Params.summary }}" />
|
||||
{{ else if .Content }}
|
||||
<meta property="og:description" content="{{ .Content | safeHTML | truncate 100 }}" />
|
||||
{{ else }}
|
||||
<meta property="og:description" content="{{ .Site.Params.Description }}" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- $favIcon := .Site.Params.favIcon }}
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ if $favIcon.small }}{{ $favIcon.small }}{{ else }}/favIcon16x16.png{{ end }}">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ if $favIcon.big }}{{ $favIcon.big }}{{ else }}/favIcon32x32.png{{ end }}">
|
||||
{{ with .Site.Params.tracking }}
|
||||
<script src="{{ . }}"></script>
|
||||
{{ end }}
|
||||
<link rel="stylesheet" type="text/css" href="/icons/fontawesome.css">
|
||||
{{ $template := resources.Get "scss/index.scss" }}
|
||||
{{ if $template }}
|
||||
{{ $index := $template | resources.ExecuteAsTemplate "css/index.scss" . | resources.ToCSS (dict "outputStyle" "compressed") | fingerprint }}
|
||||
<link rel="stylesheet" type="text/css" href="{{ $index.RelPermalink }}">
|
||||
{{ end }}
|
||||
{{ block "styling" . }}
|
||||
{{ end }}
|
||||
{{ $template := resources.Get "scss/totop.scss" }}
|
||||
{{ if $template }}
|
||||
{{ $totop := $template | resources.ExecuteAsTemplate "css/totop.scss" . | resources.ToCSS (dict "outputStyle" "compressed") | fingerprint }}
|
||||
<link rel="stylesheet" type="text/css" href="{{ $totop.RelPermalink }}">
|
||||
{{ end }}
|
||||
</head>
|
||||
<body>
|
||||
{{ block "header" . }}
|
||||
{{- partial "header.html" . -}}
|
||||
{{ end }}
|
||||
{{ block "main" . }}
|
||||
<!-- The part of the page that begins to differ between templates -->
|
||||
{{ end }}
|
||||
{{ block "footer" . }}
|
||||
{{- partial "footer.html" . -}}
|
||||
{{ end }}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<head>
|
||||
<meta name="description"
|
||||
content="{{ if .Params.summary }}{{ .Params.summary }}{{ else if .Site.Params.Description }}{{ .Site.Params.Description }}{{ else }}Hardcoded description; the author should update :){{ end }}" />
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no" />
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
||||
<meta name="color-scheme" content="light">
|
||||
{{ template "_internal/opengraph.html" . }}
|
||||
<title>
|
||||
{{ if .Title }}{{ .Title }}{{ else }}{{ .Site.Title }}{{ end }}
|
||||
</title>
|
||||
{{ with .Site.Params.favIcon }}
|
||||
{{ if .ico }}
|
||||
<link rel="icon" type="image/x-icon" href="{{ .ico }}">
|
||||
{{ end }}
|
||||
{{ if .small }}
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ .small }}">
|
||||
{{ end }}
|
||||
{{ if .big }}
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ .big }}">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ with .Site.Params.tracking }}
|
||||
<script src="{{ . }}"></script>
|
||||
{{ end }}
|
||||
<link rel="stylesheet" type="text/css" href="/icons/fontawesome.css" />
|
||||
{{ $template := resources.Get "scss/index.scss" }} {{ if $template }} {{
|
||||
$index := $template | resources.ExecuteAsTemplate "css/index.scss" . |
|
||||
resources.ToCSS (dict "outputStyle" "compressed") | fingerprint }}
|
||||
<link rel="stylesheet" type="text/css" href="{{ $index.RelPermalink }}" />
|
||||
{{ end }} {{ block "styling" . }} {{ end }} {{ $template := resources.Get
|
||||
"scss/totop.scss" }} {{ if $template }} {{ $totop := $template |
|
||||
resources.ExecuteAsTemplate "css/totop.scss" . | resources.ToCSS (dict
|
||||
"outputStyle" "compressed") | fingerprint }}
|
||||
<link rel="stylesheet" type="text/css" href="{{ $totop.RelPermalink }}" />
|
||||
{{ end }}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{{ block "header" . }} {{- partial "header.html" . -}} {{ end }}
|
||||
<main>
|
||||
{{ block "main" . }}
|
||||
<!-- The part of the page that begins to differ between templates -->
|
||||
{{ end }}
|
||||
</main>
|
||||
{{ block "footer" . }} {{- partial "footer.html" . -}} {{ end }}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue