Theme Files Update
This commit is contained in:
parent
ac9e5c8d09
commit
579ab59b6e
6 changed files with 67 additions and 65 deletions
|
@ -74,7 +74,8 @@ enableEmoji = true
|
||||||
scrollToTop = true
|
scrollToTop = true
|
||||||
global_mathjax = false
|
global_mathjax = false
|
||||||
readTime = true
|
readTime = true
|
||||||
readTimeSeparator = "\u002F||\u005C Reading Time:"
|
readTimeSeparator = "\u2026 \u23F2 Reading Time:"
|
||||||
|
# legacyLayout = false
|
||||||
|
|
||||||
[[params.social]]
|
[[params.social]]
|
||||||
name = "twitter"
|
name = "twitter"
|
||||||
|
|
|
@ -2,29 +2,25 @@
|
||||||
<html lang="{{.Site.LanguageCode}}">
|
<html lang="{{.Site.LanguageCode}}">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
{{- partial "analytics.html" . }}
|
{{- partial "analytics.html" . }}
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
{{- with .Site.Params.themeColor }}
|
{{- with .Site.Params.themeColor }}
|
||||||
<meta name="theme-color" content="{{.}}">
|
<meta name="theme-color" content="{{.}}">
|
||||||
<meta name="msapplication-TileColor" content="{{.}}">
|
<meta name="msapplication-TileColor" content="{{.}}">
|
||||||
{{- end }}
|
{{- end -}}
|
||||||
{{- partial "structured-data.html" . }}
|
{{- partial "structured-data.html" . -}}
|
||||||
{{- partial "favicons.html" }}
|
{{- partial "favicons.html" -}}
|
||||||
<title>{{.Title}}</title>
|
<title>{{.Title}}</title>
|
||||||
{{ range .AlternativeOutputFormats -}}
|
{{ range .AlternativeOutputFormats -}}
|
||||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Title | safeHTML }}
|
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Title | safeHTML }}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ $style := resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "css/style.css" . | toCSS | minify | fingerprint -}}
|
{{ $style := resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "css/style.css" . | toCSS | minify | fingerprint -}}
|
||||||
<link rel="stylesheet" href="{{ $style.Permalink }}" {{ printf "integrity=%q" $style.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous">
|
<link rel="stylesheet" href="{{ $style.Permalink }}" {{ printf "integrity=%q" $style.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous">
|
||||||
{{- range .Params.custom_css }}
|
{{- range .Params.custom_css -}}<link rel="stylesheet" href="{{ . | absURL }}">{{- end -}}
|
||||||
<link rel="stylesheet" href="{{ . | absURL }}">
|
{{- block "head" . -}}{{- end }}
|
||||||
{{- end }}
|
{{- if templates.Exists "partials/extra-head.html" -}}{{ partial "extra-head.html" . }}{{- end }}
|
||||||
{{- block "head" . -}}{{- end }}
|
|
||||||
{{- if templates.Exists "partials/extra-head.html" -}}
|
|
||||||
{{ partial "extra-head.html" . }}
|
|
||||||
{{- end }}
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="page">
|
<body id="page">
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="{{"apple-touch-icon.png" | relURL}}">
|
<link rel="apple-touch-icon" sizes="180x180" href="{{"apple-touch-icon.png" | relURL}}">
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="{{"favicon-32x32.png" | relURL}}">
|
<link rel="icon" type="image/png" sizes="32x32" href="{{"favicon-32x32.png" | relURL}}">
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="{{"favicon-16x16.png" | relURL}}">
|
<link rel="icon" type="image/png" sizes="16x16" href="{{"favicon-16x16.png" | relURL}}">
|
||||||
<link rel="manifest" href="{{"site.webmanifest" | relURL}}">
|
<link rel="manifest" href="{{"site.webmanifest" | relURL}}">
|
||||||
<link rel="mask-icon" href="{{"safari-pinned-tab.svg" | relURL}}" color="{{.Site.Params.themeColor}}">
|
<link rel="mask-icon" href="{{"safari-pinned-tab.svg" | relURL}}" color="{{.Site.Params.themeColor}}">
|
||||||
<link rel="shortcut icon" href="{{"favicon.ico" | relURL}}">
|
<link rel="shortcut icon" href="{{"favicon.ico" | relURL}}">
|
||||||
|
|
20
layouts/partials/posts_single_info.html
Normal file
20
layouts/partials/posts_single_info.html
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{{- with .Params.description }}<p>{{.}}</p>{{- end }}
|
||||||
|
{{- if and .Params.author .Params.authorLink}}{{ $relreflink := relref . .Params.authorLink }}<p>{{ partial "svg.html" (dict "context" . "name" "author") }}<a href="{{ $relreflink }}" target="_blank">{{ .Params.author }}</a></p>
|
||||||
|
{{- else if .Params.author }}{{ $relreflink := relref . .Site.Author.about }}<p>{{ partial "svg.html" (dict "context" . "name" "author") }}<a href="{{ $relreflink }}" target="_blank">{{ .Params.author }}</a></p>
|
||||||
|
{{- else }}{{ $relreflink := relref . .Site.Author.about }}<p>{{ partial "svg.html" (dict "context" . "name" "author") }}<a href="{{ $relreflink }}" target="_blank">{{ .Site.Author.name }}</a></p>
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Params.tags }}
|
||||||
|
<p>{{- partial "svg.html" (dict "context" . "name" "posts_single_tags") -}}{{- range . -}}<span class="tag"><a href="{{ "tags/" | absLangURL }}{{ . | urlize }}">{{.}}</a></span>{{- end }}</p>
|
||||||
|
{{- end }}
|
||||||
|
<p>{{- partial "svg.html" (dict "context" . "name" "posts_single_wordcount") }}{{ i18n "wordCount" . -}} {{- partial "readTime.html" . -}}</p>
|
||||||
|
<p>{{- partial "svg.html" (dict "context" . "name" "posts_single_date") }}{{ dateFormat .Site.Params.dateformNumTime .Date.Local -}}
|
||||||
|
{{- if and (not (eq .Page.Params.ShowLastmod nil)) (.Page.Params.ShowLastmod) -}}
|
||||||
|
{{- if and .GitInfo .Site.Params.gitUrl -}}
|
||||||
|
[{{- partial "svg.html" (dict "context" . "name" "posts_single_git_commit") -}}<a href="{{ .Site.Params.gitUrl -}}{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.AbbreviatedHash -}}</a> @ {{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local -}}]
|
||||||
|
{{- else if not (eq .Lastmod .Date ) -}}
|
||||||
|
[Modified : {{ dateFormat .Site.Params.dateformNumTime .Lastmod.Local -}}]
|
||||||
|
{{- else -}}
|
||||||
|
{{ errorf "Lastmod is not found in Page Frontmatter or Lastmod is same as Date" }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
</p>
|
|
@ -76,6 +76,8 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-calendar"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-calendar"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
|
||||||
{{- else if (eq .name "posts_single_git_commit") -}}
|
{{- else if (eq .name "posts_single_git_commit") -}}
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-git-commit"><circle cx="12" cy="12" r="4"></circle><line x1="1.05" y1="12" x2="7" y2="12"></line><line x1="17.01" y1="12" x2="22.96" y2="12"></line></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-git-commit"><circle cx="12" cy="12" r="4"></circle><line x1="1.05" y1="12" x2="7" y2="12"></line><line x1="17.01" y1="12" x2="22.96" y2="12"></line></svg>
|
||||||
|
{{- else if (eq .name "posts_single_tags") -}}
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-tag meta-icon"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path><line x1="7" y1="7" x2="7" y2="7"></line></svg>
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="feather feather-link" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" class="feather feather-link" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
|
@ -17,47 +17,29 @@
|
||||||
<div class="bg-img"></div>
|
<div class="bg-img"></div>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<main class="site-main section-inner animated fadeIn faster">
|
<main class="site-main section-inner animated fadeIn faster">
|
||||||
|
{{- if and (not (eq .Site.Params.legacyLayout nil)) (.Site.Params.legacyLayout) -}}
|
||||||
<article class="thin">
|
<article class="thin">
|
||||||
<header class="post-header">
|
<header class="post-header">
|
||||||
<div class="post-meta"><span>{{ .Date.Format .Site.Params.dateform }}</span></div>
|
<div class="post-meta"><span>{{ .Date.Format .Site.Params.dateform }}</span></div>
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="post-info">
|
<div class="content">
|
||||||
{{- with .Params.description }}
|
{{ .Content | replaceRE "(<h[1-6] id=\"([^\"]+)\".+)(</h[1-6]+>)" `${1}<a href="#${2}" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path><line x1="8" y1="12" x2="16" y2="12"></line></svg></a>${3}` | safeHTML }}
|
||||||
<p>{{.}}</p>
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- if and .Params.author .Params.authorLink}}
|
|
||||||
{{ $relreflink := relref . .Params.authorLink }}
|
|
||||||
<p>{{ partial "svg.html" (dict "context" . "name" "author") }}<a href="{{ $relreflink }}" target="_blank">{{ .Params.author }}</a></p>
|
|
||||||
{{- else if .Params.author }}
|
|
||||||
{{ $relreflink := relref . .Site.Author.about }}
|
|
||||||
<p>{{ partial "svg.html" (dict "context" . "name" "author") }}<a href="{{ $relreflink }}" target="_blank">{{ .Params.author }}</a></p>
|
|
||||||
{{- else }}
|
|
||||||
{{ $relreflink := relref . .Site.Author.about }}
|
|
||||||
<p>{{ partial "svg.html" (dict "context" . "name" "author") }}<a href="{{ $relreflink }}" target="_blank">{{ .Site.Author.name }}</a></p>
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Params.tags }}
|
|
||||||
<p>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-tag meta-icon"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path><line x1="7" y1="7" x2="7" y2="7"></line></svg>
|
|
||||||
{{- range . -}}
|
|
||||||
<span class="tag"><a href="{{ "tags/" | absLangURL }}{{ . | urlize }}">{{.}}</a></span>
|
|
||||||
{{- end }}
|
|
||||||
</p>
|
|
||||||
{{- end }}
|
|
||||||
<p>{{- partial "svg.html" (dict "context" . "name" "posts_single_wordcount") }}{{ i18n "wordCount" . -}} {{- partial "readTime.html" . -}}</p>
|
|
||||||
<p>{{- partial "svg.html" (dict "context" . "name" "posts_single_date") }}{{ dateFormat .Site.Params.dateformNumTime .Date.Local -}}
|
|
||||||
{{- if and (not (eq .Page.Params.ShowLastmod nil)) (.Page.Params.ShowLastmod) -}}
|
|
||||||
{{- if and .GitInfo .Site.Params.gitUrl -}}
|
|
||||||
[{{- partial "svg.html" (dict "context" . "name" "posts_single_git_commit") -}}<a href="{{ .Site.Params.gitUrl -}}{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.AbbreviatedHash -}}</a> @ {{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local -}}]
|
|
||||||
{{- else if not (eq .Lastmod .Date ) -}}
|
|
||||||
[Modified : {{ dateFormat .Site.Params.dateformNumTime .Lastmod.Local -}}]
|
|
||||||
{{- else -}}
|
|
||||||
{{ errorf "Lastmod is not found in Page Frontmatter or Lastmod is same as Date" }}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
{{- if .Site.Params.relatedPosts }}
|
||||||
|
{{- partial "related-posts.html" . -}}
|
||||||
|
{{- end }}
|
||||||
|
<hr class="art-end">
|
||||||
|
<footer class="post-info">{{- partial "posts_single_info.html" . -}}</footer>
|
||||||
|
<hr class="post-end">
|
||||||
|
</article>
|
||||||
|
{{- else -}}
|
||||||
|
<article class="thin">
|
||||||
|
<header class="post-header">
|
||||||
|
<div class="post-meta"><span>{{ .Date.Format .Site.Params.dateform }}</span></div>
|
||||||
|
<h1>{{ .Title }}</h1>
|
||||||
|
</header>
|
||||||
|
<div class="post-info">{{- partial "posts_single_info.html" . -}}</div>
|
||||||
<hr class="post-end">
|
<hr class="post-end">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
{{ .Content | replaceRE "(<h[1-6] id=\"([^\"]+)\".+)(</h[1-6]+>)" `${1}<a href="#${2}" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path><line x1="8" y1="12" x2="16" y2="12"></line></svg></a>${3}` | safeHTML }}
|
{{ .Content | replaceRE "(<h[1-6] id=\"([^\"]+)\".+)(</h[1-6]+>)" `${1}<a href="#${2}" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path><line x1="8" y1="12" x2="16" y2="12"></line></svg></a>${3}` | safeHTML }}
|
||||||
|
@ -67,6 +49,7 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<hr class="art-end">
|
<hr class="art-end">
|
||||||
</article>
|
</article>
|
||||||
|
{{- end -}}
|
||||||
{{- if .Params.toc }}
|
{{- if .Params.toc }}
|
||||||
<aside id="toc">
|
<aside id="toc">
|
||||||
<div class="toc-title">{{ i18n "tableOfContents" }}</div>
|
<div class="toc-title">{{ i18n "tableOfContents" }}</div>
|
||||||
|
|
Loading…
Reference in a new issue