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 charset="UTF-8"> |
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> |
<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="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" |
<link rel="preload" href="{{ .Site.BaseURL }}fonts/Inter-UI-Regular.woff2" as="font" type="font/woff2" |
||||||
crossorigin="anonymous"> |
crossorigin="anonymous"> |
||||||
<link rel="preload" href="{{ .Site.BaseURL }}fonts/Inter-UI-Bold.woff2" as="font" type="font/woff2" |
<link rel="preload" href="{{ .Site.BaseURL }}fonts/Inter-UI-Bold.woff2" as="font" type="font/woff2" |
||||||
crossorigin="anonymous"> |
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) }} |
{{ $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 }}"> |
<link rel="stylesheet" href="{{ $style.RelPermalink }}"> |
||||||
|
|
||||||
{{ range $val := $.Site.Params.customCSS }} |
{{- range $val := $.Site.Params.customCSS }} |
||||||
{{ if gt (len $val) 0 }} |
{{- if gt (len $val) 0 }} |
||||||
<link rel="stylesheet" type="text/css" href="{{ $val }}"> |
<link rel="stylesheet" type="text/css" href="{{ $val }}"> |
||||||
{{ end }} |
{{- end }} |
||||||
{{ end }} |
{{- end }} |
||||||
|
|
||||||
<!-- Icons --> |
|
||||||
{{- partial "favicons.html" . }} |
|
||||||
|
|
||||||
{{ template "_internal/schema.html" . }} |
{{- partial "favicons.html" . -}} |
||||||
{{ template "_internal/twitter_cards.html" . }} |
|
||||||
|
|
||||||
{{ if isset .Site.Taxonomies "series" }} |
<!-- Meta tags --> |
||||||
{{ template "_internal/opengraph.html" . }} |
{{- partial "meta-tags.html" . -}} |
||||||
{{ end }} |
|
||||||
|
|
||||||
{{ range .Params.categories }} |
|
||||||
<meta property="article:section" content="{{ . }}" /> |
|
||||||
{{ end }} |
|
||||||
|
|
||||||
{{ if isset .Params "date" }} |
|
||||||
<meta property="article:published_time" content="{{ time .Date }}" /> |
|
||||||
{{ end }} |
|
||||||
|
|
||||||
<!-- RSS --> |
<!-- 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 }} |
{{ 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 --> |
<!-- JSON Feed --> |
||||||
{{ if .OutputFormats.Get "json" }} |
{{- if .OutputFormats.Get "json" }} |
||||||
<link href="{{ if .OutputFormats.Get "json" }}{{ .Site.BaseURL }}feed.json{{ end }}" rel="alternate" |
<link href="{{ if .OutputFormats.Get "json" }}{{ .Site.BaseURL }}feed.json{{ end }}" rel="alternate" |
||||||
type="application/json" title="{{ .Site.Title }}" /> |
type="application/json" title="{{ .Site.Title }}" /> |
||||||
{{ end }} |
{{- 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 || []; |
|
||||||
|
|
||||||
function gtag() { |
{{- block "title" . }} |
||||||
dataLayer.push(arguments); |
<title> |
||||||
} |
{{- if .IsHome }} |
||||||
gtag('js', new Date()); |
{{- $.Site.Title }} {{ with $.Site.Params.Subtitle }} — {{ . }} {{ end }} |
||||||
|
{{- else }} |
||||||
gtag('config', '{{ .Site.GoogleAnalytics }}'); |
{{- .Title }} :: {{ $.Site.Title }} {{ with $.Site.Params.Subtitle }} — {{ . }}{{ end }} |
||||||
</script> |
{{- end -}} |
||||||
{{ end }} |
</title> |
||||||
|
{{- end }} |
@ -1,15 +1,26 @@ |
|||||||
{{ $main := resources.Get "js/main.js" }} |
{{- $main := resources.Get "js/main.js" }} |
||||||
{{ $menu := resources.Get "js/menu.js" }} |
{{- $menu := resources.Get "js/menu.js" }} |
||||||
{{ $theme := resources.Get "js/theme.js" }} |
{{- $theme := resources.Get "js/theme.js" }} |
||||||
{{ $secureJS := slice $main $menu $theme | resources.Concat "bundle.js" | resources.Minify | resources.Fingerprint "sha512" }} |
{{- $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> |
<script type="text/javascript" src="{{ $secureJS.RelPermalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script> |
||||||
|
|
||||||
{{- if .Site.GoogleAnalytics }} |
{{- 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 }} |
{{- end }} |
||||||
|
|
||||||
{{ range $val := $.Site.Params.customJS }} |
{{- range $val := $.Site.Params.customJS }} |
||||||
{{ if gt (len $val) 0 }} |
{{- if gt (len $val) 0 }} |
||||||
<script src="{{ $val }}"></script> |
<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 }}" |
<a href="{{ if .Site.Params.Logo.LogoHomeLink }}{{ .Site.Params.Logo.LogoHomeLink }}{{else}}{{ .Site.BaseURL }}{{ end }}" |
||||||
style="text-decoration: none;"> |
style="text-decoration: none;"> |
||||||
<div class="logo"> |
<div class="logo"> |
||||||
{{ if .Site.Params.Logo.path }} |
{{- if .Site.Params.Logo.path }} |
||||||
<img src="{{ .Site.Params.Logo.path }}" alt="{{ .Site.Params.Logo.alt }}" /> |
<img src="{{ .Site.Params.Logo.path }}" alt="{{ .Site.Params.Logo.alt }}" /> |
||||||
{{ else }} |
{{- else }} |
||||||
<span class="logo__mark">></span> |
<span class="logo__mark">></span> |
||||||
<span class="logo__text">{{ with .Site.Params.Logo.logoText }}{{ . }}{{ else }}hello{{ end }}</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 }} |
<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.logoCursorColor }}background-color:{{ . }};{{ end -}} |
||||||
{{ with.Site.Params.Logo.logoCursorAnimate }}animation-duration:{{ . }};{{ end }}"> |
{{- with.Site.Params.Logo.logoCursorAnimate }}animation-duration:{{ . }};{{ end -}}"> |
||||||
</span> |
</span> |
||||||
{{ end }} |
{{- end }} |
||||||
</div> |
</div> |
||||||
</a> |
</a> |
@ -1,7 +1,7 @@ |
|||||||
<nav class="menu"> |
<nav class="menu"> |
||||||
<ul class="menu__inner"> |
<ul class="menu__inner"> |
||||||
{{- $currentPage := . -}} |
{{- $currentPage := . -}} |
||||||
{{ range .Site.Menus.main -}} |
{{ range .Site.Menus.main }} |
||||||
<li><a href="{{ .URL | absLangURL }}">{{ .Name }}</a></li> |
<li><a href="{{ .URL | absLangURL }}">{{ .Name }}</a></li> |
||||||
{{- end }} |
{{- end }} |
||||||
</ul> |
</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> |
<channel> |
||||||
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title> |
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title> |
||||||
<link>{{ .Permalink }}</link> |
<link>{{ .Permalink }}</link> |
||||||
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>{{ with .Site.LanguageCode }} |
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description> |
||||||
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }} |
{{- with .Site.LanguageCode }} |
||||||
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }} |
<language>{{.}}</language> |
||||||
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }} |
{{- end }} |
||||||
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }} |
{{- with .Site.Author.email }} |
||||||
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} |
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor> |
||||||
{{ with .OutputFormats.Get "RSS" -}} |
{{- 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 }} |
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} |
||||||
{{ end -}} |
{{- end }} |
||||||
{{ range .Pages }} |
{{- range .Pages }} |
||||||
<item> |
<item> |
||||||
<title>{{ .Title }}</title> |
<title>{{ .Title }}</title> |
||||||
<link>{{ .Permalink }}</link> |
<link>{{ .Permalink }}</link> |
||||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> |
<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> |
<guid>{{ .Permalink }}</guid> |
||||||
<description>{{ .Summary | html }}</description> |
<description>{{ printf `<![CDATA[%s]]>` .Summary | safeHTML }}</description> |
||||||
<content type="html">{{ printf `<![CDATA[%s]]>` .Content | safeHTML }}</content> |
<content:encoded type="html">{{ printf `<![CDATA[%s]]>` .Content | safeHTML }}</content:encoded> |
||||||
</item> |
</item> |
||||||
{{ end }} |
{{- end }} |
||||||
</channel> |
</channel> |
||||||
</rss> |
</rss> |
||||||
|
Loading…
Reference in new issue