themu/layouts/partials/header.html

50 lines
2.1 KiB
HTML
Raw Normal View History

2023-09-25 23:02:22 +03:00
{{ "<!-- Добро пожаловать на мой веб-сайт! -->" | safeHTML }}
{{ "<!-- Сайт сделан на HUGO, тема - themu -->" | safeHTML }}
{{ "<!-- Контент лицензирован под СС BY-SA -->" | safeHTML }}
{{ "<!-- ASCII-арт взят с сайта asciiart.eu -->" | safeHTML }}
<head lang="{{ .Site.Language.Lang }}">
2020-04-08 21:44:29 +03:00
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
{{- $title := ( .Title ) -}}
{{- $siteTitle := ( .Site.Title ) -}}
{{- if .IsHome -}}
2023-07-29 19:24:47 +03:00
<title>{{ $siteTitle }}</title>
2020-04-08 21:44:29 +03:00
{{- else -}}
<title>{{ $title }} - {{ $siteTitle }}</title>
{{- end -}}
{{- if isset .Site.Params "favicon" -}}
2023-08-23 15:04:27 +03:00
<link rel="icon" type="image/png" href={{ .Site.BaseURL }}{{ .Site.Params.favicon }} />
2020-04-08 21:44:29 +03:00
{{- end -}}
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
2023-08-23 15:04:27 +03:00
<meta property="og:image" content="{{ .Site.BaseURL }}{{ .Site.Params.og_image }}"/>
2020-04-08 21:44:29 +03:00
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
2020-04-08 21:44:29 +03:00
{{- template "_internal/opengraph.html" . -}}
{{- template "_internal/twitter_cards.html" . -}}
{{ $style := resources.Get "css/main.css" | fingerprint }}
<link rel="stylesheet" type="text/css" media="screen" href="{{ $style.Permalink }}" />
<!-- Custom CSS style get applied last -->
{{- if isset .Site.Params "customcss" }}
{{ range .Site.Params.customCSS }}
{{ $customstyle := resources.Get . | fingerprint }}
<link rel="stylesheet" type="text/css" href="{{ $customstyle.Permalink }}">
{{ end }}
2020-04-16 10:20:38 +03:00
{{- end -}}
2020-04-08 21:44:29 +03:00
{{- range .Site.Params.customJS }}
{{- if or (hasPrefix . "http://") (hasPrefix . "https://") }}
<script src="{{ . }}"></script>
{{- else if (hasPrefix . "<script")}}
{{ .| safeHTML }}
2020-04-08 21:44:29 +03:00
{{- else }}
<script src="{{ $.Site.BaseURL }}{{ . }}"></script>
{{- end }}
{{- end }}
</head>