hugo-theme-terminal/layouts/partials/head.html

81 lines
3.7 KiB
HTML
Raw Normal View History

2019-01-28 00:11:02 +00:00
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.Subtitle }}{{ else }}{{ .Summary | plainify }}{{ end }}" />
<meta name="keywords" content="{{ with .Params.Keywords }}{{ delimit . ", " }}{{ else }}{{ $.Site.Params.Keywords }}{{ end }}" />
2020-03-10 12:03:11 +00:00
<meta name="robots" content="noodp" />
2019-01-28 00:11:02 +00:00
<link rel="canonical" href="{{ .Permalink }}" />
2020-01-15 13:41:43 +00:00
{{ template "_internal/google_analytics.html" . }}
2019-01-28 00:11:02 +00:00
<!-- Theme CSS -->
2020-07-16 21:56:01 +00:00
{{ $css := resources.Get "css/style.css" }}
{{ $opts := dict "inlineImports" true }}
{{ $style := $css | resources.PostCSS $opts | minify }}
<link rel="stylesheet" href="{{ $style.Permalink }}">
{{ if (or (isset .Params "color") (ne $.Site.Params.ThemeColor "orange")) }}
{{ $colorCss := resources.Get (printf "css/color/%s.css" (or .Params.color $.Site.Params.ThemeColor)) }}
{{ $color := $colorCss | resources.PostCSS $opts | minify }}
<link rel="stylesheet" href="{{ $color.Permalink }}">
2019-01-28 00:11:02 +00:00
{{ end }}
<!-- Custom CSS to override theme properties (/static/style.css) -->
{{ if (fileExists "static/style.css") -}}
<link rel="stylesheet" href="{{ "style.css" | absURL }}">
{{- end }}
2019-01-28 00:11:02 +00:00
<!-- Icons -->
2019-01-29 09:47:50 +00:00
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ "img/apple-touch-icon-144-precomposed.png" | absURL }}">
2019-03-13 01:40:07 +00:00
{{ if isset $.Site.Params "favicon" }}
<link rel="shortcut icon" href="{{ $.Site.Params.favicon | absURL }}">
2019-03-13 01:40:07 +00:00
{{ else }}
<link rel="shortcut icon" href="{{ printf "img/favicon/%s.png" $.Site.Params.ThemeColor | absURL }}">
2019-01-28 00:11:02 +00:00
{{ end }}
<!-- Twitter Card -->
{{ if (isset $.Site.Params "twitter") }}
<meta name="twitter:card" content="summary" />
{{ if (isset $.Site.Params.Twitter "site") }}
<meta name="twitter:site" content="{{ $.Site.Params.Twitter.site }}" />
{{ end }}
<meta name="twitter:creator" content="{{ if .IsHome }}{{ $.Site.Params.Twitter.creator }}{{ else if isset .Params "authortwitter" }}{{ .Params.authorTwitter }}{{ else }}{{ .Params.Author }}{{ end }}" />
{{ end }}
2019-01-28 00:11:02 +00:00
<!-- OG data -->
<meta property="og:locale" content="{{ $.Site.Language.Lang }}" />
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
<meta property="og:title" content="{{ if .IsHome }}{{ $.Site.Title }}{{ else }}{{ .Title }} :: {{ $.Site.Title }}{{ end }}">
2020-03-29 15:07:41 +00:00
<meta property="og:description" content="{{ if .IsHome }}{{ $.Site.Params.Subtitle }}{{ else if .Description}}{{ .Description | plainify }}{{ else }}{{ .Summary | plainify }}{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" />
<meta property="og:site_name" content="{{ .Title }}" />
{{ if and (not .IsHome) (isset .Params "cover") }}
<meta property="og:image" content="{{ .Param "cover" | absURL }}">
{{ else }}
{{ if isset $.Site.Params "favicon" }}
<meta property="og:image" content="{{ $.Site.Params.favicon | absURL }}">
{{ else }}
<meta property="og:image" content="{{ printf "img/favicon/%s.png" $.Site.Params.ThemeColor | absURL }}">
{{ end }}
{{ end }}
<meta property="og:image:width" content="2048">
<meta property="og:image:height" content="1024">
2020-03-10 12:03:11 +00:00
{{ range .Params.categories }}
<meta property="article:section" content="{{ . }}" />
{{ end }}
2020-03-10 12:03:11 +00:00
{{ if isset .Params "date" }}
<meta property="article:published_time" content="{{ time .Date }}" />
{{ end }}
2019-01-28 00:11:02 +00:00
<!-- RSS -->
2019-05-24 07:36:06 +00:00
{{ with .OutputFormats.Get "RSS" }}
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
2019-01-28 00:11:02 +00:00
{{ end }}
<!-- JSON Feed -->
2019-05-24 07:36:06 +00:00
{{ with .OutputFormats.Get "json" }}
<link href="{{ .RelPermalink }}" rel="alternate" type="application/json" title="{{ $.Site.Title }}" />
2019-01-28 00:11:02 +00:00
{{ end }}
<!-- Extended head section-->
{{ partial "extended_head.html" . }}