parent
c6fbd73a16
commit
16261320d9
17 changed files with 309 additions and 213 deletions
After Width: | Height: | Size: 15 KiB |
@ -1,82 +1,47 @@ |
||||
<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"> |
||||
<meta name="author" |
||||
content="{{ if .Params.author }}{{ .Params.author }}{{ else }}{{ range .Site.Author }}{{ . }} {{ end }}{{ end }}"> |
||||
<meta name="description" |
||||
content="{{ if .IsHome }}{{ .Site.Params.homeSubtitle }}{{ else }}{{ .Summary | plainify }}{{ end }}" /> |
||||
<meta name="keywords" |
||||
content="{{ .Site.Params.keywords }}{{ if .Params.tags }}{{ range .Params.tags }}, {{ . }}{{ end }}{{ end }}" /> |
||||
<meta name="robots" content="noodp" /> |
||||
<!-- <meta name="theme-color" content="{{ .Site.Params.themeColor }}" /> --> |
||||
<link rel="canonical" href="{{ .Permalink }}" /> |
||||
|
||||
<link rel="canonical" href="{{ .Permalink }}" /> |
||||
|
||||
<link rel="preload" href="{{ .Site.BaseURL }}fonts/Inter-UI-Regular.woff2" as="font" type="font/woff2" |
||||
crossorigin="anonymous"> |
||||
<link rel="preload" href="{{ .Site.BaseURL }}fonts/Inter-UI-Bold.woff2" as="font" type="font/woff2" |
||||
crossorigin="anonymous"> |
||||
|
||||
{{ block "title" . }} |
||||
<title> |
||||
{{ if .IsHome }} |
||||
{{ $.Site.Title }} {{ with $.Site.Params.Subtitle }} — {{ . }} {{ end }} |
||||
{{ else }} |
||||
{{ .Title }} :: {{ $.Site.Title }} {{ with $.Site.Params.Subtitle }} — {{ . }}{{ end }} |
||||
{{ end }} |
||||
</title> |
||||
{{ end }} |
||||
|
||||
{{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" true) }} |
||||
{{ $style := resources.Get "scss/main.scss" | resources.ToCSS $options | resources.Fingerprint }} |
||||
{{- $style := resources.Get "scss/main.scss" | resources.ToCSS $options | resources.Fingerprint }} |
||||
<link rel="stylesheet" href="{{ $style.RelPermalink }}"> |
||||
|
||||
{{ range $val := $.Site.Params.customCSS }} |
||||
{{ if gt (len $val) 0 }} |
||||
{{- range $val := $.Site.Params.customCSS }} |
||||
{{- if gt (len $val) 0 }} |
||||
<link rel="stylesheet" type="text/css" href="{{ $val }}"> |
||||
{{ end }} |
||||
{{ end }} |
||||
|
||||
<!-- Icons --> |
||||
{{- partial "favicons.html" . }} |
||||
{{- end }} |
||||
{{- end }} |
||||
|
||||
{{ template "_internal/schema.html" . }} |
||||
{{ template "_internal/twitter_cards.html" . }} |
||||
{{- partial "favicons.html" . -}} |
||||
|
||||
{{ if isset .Site.Taxonomies "series" }} |
||||
{{ template "_internal/opengraph.html" . }} |
||||
{{ end }} |
||||
|
||||
{{ range .Params.categories }} |
||||
<meta property="article:section" content="{{ . }}" /> |
||||
{{ end }} |
||||
|
||||
{{ if isset .Params "date" }} |
||||
<meta property="article:published_time" content="{{ time .Date }}" /> |
||||
{{ end }} |
||||
<!-- Meta tags --> |
||||
{{- partial "meta-tags.html" . -}} |
||||
|
||||
<!-- RSS --> |
||||
{{ with .OutputFormats.Get "rss" -}} |
||||
<!-- {{- with .OutputFormats.Get "rss" }} |
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} |
||||
{{ end -}} |
||||
{{- end }} --> |
||||
<link rel="alternate" type="application/rss+xml" href="{{ "/posts/index.xml" | absURL }}" title="{{ $.Site.Title }}" /> |
||||
|
||||
<!-- JSON Feed --> |
||||
{{ if .OutputFormats.Get "json" }} |
||||
{{- if .OutputFormats.Get "json" }} |
||||
<link href="{{ if .OutputFormats.Get "json" }}{{ .Site.BaseURL }}feed.json{{ end }}" rel="alternate" |
||||
type="application/json" title="{{ .Site.Title }}" /> |
||||
{{ end }} |
||||
|
||||
{{ if .Site.GoogleAnalytics }} |
||||
<!-- Global site tag (gtag.js) - Google Analytics --> |
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ .Site.GoogleAnalytics }}"></script> |
||||
<script> |
||||
window.dataLayer = window.dataLayer || []; |
||||
{{- end }} |
||||
|
||||
function gtag() { |
||||
dataLayer.push(arguments); |
||||
} |
||||
gtag('js', new Date()); |
||||
|
||||
gtag('config', '{{ .Site.GoogleAnalytics }}'); |
||||
</script> |
||||
{{ end }} |
||||
{{- block "title" . }} |
||||
<title> |
||||
{{- if .IsHome }} |
||||
{{- $.Site.Title }} {{ with $.Site.Params.Subtitle }} — {{ . }} {{ end }} |
||||
{{- else }} |
||||
{{- .Title }} :: {{ $.Site.Title }} {{ with $.Site.Params.Subtitle }} — {{ . }}{{ end }} |
||||
{{- end -}} |
||||
</title> |
||||
{{- end }} |
@ -1,15 +1,26 @@ |
||||
{{ $main := resources.Get "js/main.js" }} |
||||
{{ $menu := resources.Get "js/menu.js" }} |
||||
{{ $theme := resources.Get "js/theme.js" }} |
||||
{{ $secureJS := slice $main $menu $theme | resources.Concat "bundle.js" | resources.Minify | resources.Fingerprint "sha512" }} |
||||
{{- $main := resources.Get "js/main.js" }} |
||||
{{- $menu := resources.Get "js/menu.js" }} |
||||
{{- $theme := resources.Get "js/theme.js" }} |
||||
{{- $secureJS := slice $main $menu $theme | resources.Concat "bundle.js" | resources.Minify | resources.Fingerprint "sha512" }} |
||||
<script type="text/javascript" src="{{ $secureJS.RelPermalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script> |
||||
|
||||
{{- if .Site.GoogleAnalytics }} |
||||
{{ template "_internal/google_analytics.html" . }} |
||||
<!-- Global site tag (gtag.js) - Google Analytics --> |
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ .Site.GoogleAnalytics }}"></script> |
||||
<script> |
||||
window.dataLayer = window.dataLayer || []; |
||||
|
||||
function gtag() { |
||||
dataLayer.push(arguments); |
||||
} |
||||
gtag('js', new Date()); |
||||
|
||||
gtag('config', '{{ .Site.GoogleAnalytics }}'); |
||||
</script> |
||||
{{- end }} |
||||
|
||||
{{ range $val := $.Site.Params.customJS }} |
||||
{{ if gt (len $val) 0 }} |
||||
{{- range $val := $.Site.Params.customJS }} |
||||
{{- if gt (len $val) 0 }} |
||||
<script src="{{ $val }}"></script> |
||||
{{ end }} |
||||
{{ end }} |
||||
{{- end }} |
||||
{{- end }} |
@ -1,15 +1,15 @@ |
||||
<a href="{{ if .Site.Params.Logo.LogoHomeLink }}{{ .Site.Params.Logo.LogoHomeLink }}{{else}}{{ .Site.BaseURL }}{{ end }}" |
||||
style="text-decoration: none;"> |
||||
<div class="logo"> |
||||
{{ if .Site.Params.Logo.path }} |
||||
{{- if .Site.Params.Logo.path }} |
||||
<img src="{{ .Site.Params.Logo.path }}" alt="{{ .Site.Params.Logo.alt }}" /> |
||||
{{ else }} |
||||
{{- else }} |
||||
<span class="logo__mark">></span> |
||||
<span class="logo__text">{{ with .Site.Params.Logo.logoText }}{{ . }}{{ else }}hello{{ end }}</span> |
||||
<span class="logo__cursor" style="{{ with.Site.Params.Logo.logoCursorDisabled }}visibility:hidden;{{ end }} |
||||
{{ with.Site.Params.Logo.logoCursorColor }}background-color:{{ . }};{{ end }} |
||||
{{ with.Site.Params.Logo.logoCursorAnimate }}animation-duration:{{ . }};{{ end }}"> |
||||
<span class="logo__text">{{- with .Site.Params.Logo.logoText }}{{ . }}{{ else }}hello{{ end }}</span> |
||||
<span class="logo__cursor" style="{{- with.Site.Params.Logo.logoCursorDisabled }}visibility:hidden;{{ end -}} |
||||
{{- with.Site.Params.Logo.logoCursorColor }}background-color:{{ . }};{{ end -}} |
||||
{{- with.Site.Params.Logo.logoCursorAnimate }}animation-duration:{{ . }};{{ end -}}"> |
||||
</span> |
||||
{{ end }} |
||||
{{- end }} |
||||
</div> |
||||
</a> |
@ -1,7 +1,7 @@ |
||||
<nav class="menu"> |
||||
<ul class="menu__inner"> |
||||
{{- $currentPage := . -}} |
||||
{{ range .Site.Menus.main -}} |
||||
{{ range .Site.Menus.main }} |
||||
<li><a href="{{ .URL | absLangURL }}">{{ .Name }}</a></li> |
||||
{{- end }} |
||||
</ul> |
||||
|
@ -0,0 +1,64 @@ |
||||
<!-- Default --> |
||||
<meta name="author" |
||||
content="{{ if .Params.author }}{{ .Params.author }}{{ else }}{{ range .Site.Author }}{{ . }} {{ end }}{{ end }}"> |
||||
<meta name="description" |
||||
content="{{ if .IsHome }}{{ .Site.Params.homeSubtitle }}{{ else }}{{ .Params.description | plainify }}{{ end }}" /> |
||||
<meta name="keywords" |
||||
content="{{ .Site.Params.keywords }}{{ if .Params.tags }}{{ range .Params.tags }}, {{ . }}{{ end }}{{ end }}" /> |
||||
<meta name="robots" content="noodp" /> |
||||
|
||||
<!-- Og --> |
||||
<meta property="og:site_name" content="{{ .Site.Title }}" /> |
||||
<meta property="og:type" content="{{ if .IsHome }}website{{ else }}article{{ end }}" /> |
||||
<meta property="og:title" |
||||
content="{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Params.title | plainify }}{{ end }}" /> |
||||
<meta property="og:description" |
||||
content="{{ if .IsHome }}{{ .Site.Params.homeSubtitle }}{{ else }}{{ .Params.description | plainify }}{{ end }}" /> |
||||
<meta property="og:url" content="{{ .Permalink }}" /> |
||||
{{- with .Params.cover }} |
||||
<meta property="og:image" content="{{ . | absURL }}" /> |
||||
{{- $img := imageConfig (printf "static/%s" .) }} |
||||
<meta property="og:image:width" content="{{ $img.Width }}" /> |
||||
<meta property="og:image:height" content="{{ $img.Height }}" /> |
||||
{{- end }} |
||||
|
||||
<!-- Article --> |
||||
<meta property="article:publisher" content="{{ .Site.BaseURL }}" /> |
||||
<meta name="article:author" |
||||
content="{{ if .Params.author }}{{ .Params.author }}{{ else }}{{ range .Site.Author }}{{ . }} {{ end }}{{ end }}"> |
||||
|
||||
{{- if isset .Params "date" }} |
||||
<meta property="article:published_time" content="{{ time .Date }}" /> |
||||
{{- end }} |
||||
|
||||
{{- if .GitInfo }} |
||||
<meta property="article:modified_time" content="{{ time .GitInfo.AuthorDate }}" /> |
||||
{{- end }} |
||||
|
||||
{{- range .Params.categories }} |
||||
<meta property="article:section" content="{{ . }}" /> |
||||
{{- end }} |
||||
|
||||
{{- range .Params.tags }} |
||||
<meta property="article:tag" content="{{ . }}" /> |
||||
{{- end }} |
||||
|
||||
<!-- Itemprops --> |
||||
{{- template "_internal/schema.html" . }} |
||||
|
||||
<!-- Twitter cards --> |
||||
<meta name="twitter:card" content="summary_large_image" /> |
||||
{{- if .Params.cover }} |
||||
<meta name="twitter:image" content="{{ .Params.cover | absURL }}" /> |
||||
<meta name="twitter:image:alt" content="{{ .Params.title | plainify | default " " }}" /> |
||||
{{- end }} |
||||
<meta name="twitter:title" content="{{ .Title }}" /> |
||||
<meta name="twitter:description" |
||||
content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}" /> |
||||
<meta name="twitter:url" content="{{ .Permalink }}" /> |
||||
{{- with .Site.Social.twitter }} |
||||
<meta name="twitter:site" content="{{ . }}" /> |
||||
{{- end }} |
||||
{{- with .Site.Author.twitter }} |
||||
<meta name="twitter:creator" content="{{ . }}" /> |
||||
{{- end }} |
@ -1,26 +1,36 @@ |
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> |
||||
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0"> |
||||
<channel> |
||||
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title> |
||||
<link>{{ .Permalink }}</link> |
||||
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>{{ with .Site.LanguageCode }} |
||||
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }} |
||||
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }} |
||||
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }} |
||||
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }} |
||||
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} |
||||
{{ with .OutputFormats.Get "RSS" -}} |
||||
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description> |
||||
{{- with .Site.LanguageCode }} |
||||
<language>{{.}}</language> |
||||
{{- end }} |
||||
{{- with .Site.Author.email }} |
||||
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor> |
||||
{{- end }} |
||||
{{- with .Site.Author.email }} |
||||
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster> |
||||
{{- end }} |
||||
{{- with .Site.Copyright }} |
||||
<copyright>{{.}}</copyright> |
||||
{{- end }} |
||||
{{- if not .Date.IsZero }} |
||||
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate> |
||||
{{- end }} |
||||
{{- with .OutputFormats.Get "RSS" -}} |
||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} |
||||
{{ end -}} |
||||
{{ range .Pages }} |
||||
{{- end }} |
||||
{{- range .Pages }} |
||||
<item> |
||||
<title>{{ .Title }}</title> |
||||
<link>{{ .Permalink }}</link> |
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> |
||||
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} |
||||
<author>{{ .Site.Author.name }}</author> |
||||
<guid>{{ .Permalink }}</guid> |
||||
<description>{{ .Summary | html }}</description> |
||||
<content type="html">{{ printf `<![CDATA[%s]]>` .Content | safeHTML }}</content> |
||||
<description>{{ printf `<![CDATA[%s]]>` .Summary | safeHTML }}</description> |
||||
<content:encoded type="html">{{ printf `<![CDATA[%s]]>` .Content | safeHTML }}</content:encoded> |
||||
</item> |
||||
{{ end }} |
||||
{{- end }} |
||||
</channel> |
||||
</rss> |
||||
|
Loading…
Reference in new issue