feat: tidy style and layout
This commit is contained in:
@@ -1,26 +1,29 @@
|
||||
{{ if ne .Site.Params.version "5.x" -}}
|
||||
{{ errorf "\n\nThere are two possible situations that led to this error:\n 1. You haven't copied the config.toml yet. See https://github.com/dillonzq/LoveIt#installation \n 2. You have an incompatible update. See https://github.com//dillonzq/LoveIt/blob/master/CHANGELOG.md \n\n有两种可能的情况会导致这个错误发生:\n 1. 你还没有复制 config.toml 参考 https://github.com/dillonzq/LoveIt#installation \n 2. 你进行了一次不兼容的更新 参考 https://github.com//dillonzq/LoveIt/blob/master/CHANGELOG.md \n" -}}
|
||||
{{ end -}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.LanguageCode }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
|
||||
{{ partial "head.html" . }}
|
||||
{{- partial "head.html" . }}
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
var isDark = (window.localStorage && window.localStorage.getItem('theme')) === 'dark';
|
||||
if (isDark) document.body.classList.add('dark-theme');
|
||||
window.isDark = (window.localStorage && window.localStorage.getItem('theme')) === 'dark';
|
||||
window.isDark && document.body.classList.add('dark-theme');
|
||||
</script>
|
||||
<div class="wrapper">
|
||||
{{ partial "header.html" . }}
|
||||
{{ partial "header.html" . -}}
|
||||
<main class="main">
|
||||
<div class="container">
|
||||
{{ block "content" . }}{{ end }}
|
||||
{{ block "content" . }}{{ end -}}
|
||||
</div>
|
||||
</main>
|
||||
{{ partial "footer.html" . }}
|
||||
{{ partial "scripts.html" . }}
|
||||
{{ partial "footer.html" . -}}
|
||||
{{ partial "scripts.html" . -}}
|
||||
</div>
|
||||
<a href="#" id="dynamic-to-top"><span> </span></a>
|
||||
<a href="#" class="dynamic-to-top" id="dynamic-to-top"><span> </span></a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,11 +1,12 @@
|
||||
{{ define "title" }}{{ T .Section | default (humanize .Section) }} | {{ .Site.Title }}{{ end -}}
|
||||
{{ define "title" }}{{ T "all" }}{{ T .Section | default (humanize .Section) }} | {{ .Site.Title }}{{ end -}}
|
||||
|
||||
{{ define "content" -}}
|
||||
{{ $data := .Data -}}
|
||||
<div class="post-warp archive">
|
||||
<h2 class="post-title">
|
||||
<h2 class="post-title animated pulse faster">
|
||||
{{ printf "%s%s" (T "all") (T .Section | default (humanize .Section)) }}
|
||||
</h2>
|
||||
|
||||
{{- range (.Paginate (.Pages.GroupByDate "2006")).PageGroups -}}
|
||||
<h3>{{ .Key }}</h3>
|
||||
{{- range .Pages -}}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
{{ define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end }}
|
||||
|
||||
{{ define "content" }}
|
||||
<div class="post-warp">
|
||||
<header class="post-header">
|
||||
<div class="align-right"><h1 class="post-title">{{ .Title }}</h1></div>
|
||||
</header>
|
||||
<div class="post-warp single">
|
||||
<h1 class="post-title animated pulse faster">{{ .Title }}</h1>
|
||||
<div class="post-content">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
# {{ .Title }}
|
||||
|
||||
{{ .RawContent }}
|
||||
@@ -13,11 +13,10 @@
|
||||
</div>
|
||||
{{ end }}
|
||||
<!-- end featured_image-->
|
||||
<header class="post-header">
|
||||
<h1 class="post-title post-list-title" itemprop="name headline">
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</h1>
|
||||
</header>
|
||||
<h1 class="post-title post-list-title" itemprop="name headline">
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</h1>
|
||||
|
||||
<div class="post-meta">
|
||||
<a class="author" href="{{.Site.BaseURL }}" rel="author"><i class="fas fa-user-circle"></i> {{ $author }} </a>
|
||||
{{ T "publish" }}<span class="post-time"> <time datetime={{ $publish_date }}>{{ $publish_date }}</time> </span>
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="robots" content="noodp" />
|
||||
{{ with .Site.Params.google_verification }}
|
||||
{{ with .Site.Params.google_verification -}}
|
||||
<meta name="google-site-verification" content="{{ . }}" />
|
||||
{{ end }}
|
||||
{{ with .Site.Params.bing_verification }}
|
||||
{{ end -}}
|
||||
{{ with .Site.Params.bing_verification -}}
|
||||
<meta name="msvalidate.01" content="{{ . }}" />
|
||||
{{end}}
|
||||
{{ with .Site.Params.yandex_verification }}
|
||||
{{ end -}}
|
||||
{{ with .Site.Params.yandex_verification -}}
|
||||
<meta name="yandex-verification" content="{{ . }}" />
|
||||
{{ end }}
|
||||
{{ with .Site.Params.pinterest_verification }}
|
||||
{{ end -}}
|
||||
{{ with .Site.Params.pinterest_verification -}}
|
||||
<meta name="p:domain_verify" content="{{ . }}" />
|
||||
{{ end }}
|
||||
{{ with .Site.Params.baidu_verification }}
|
||||
{{ end -}}
|
||||
{{ with .Site.Params.baidu_verification -}}
|
||||
<meta name=”baidu-site-verification” content="{{ . }}" />
|
||||
{{ end }}
|
||||
{{ if .PrevInSection }}
|
||||
<link rel="prev" href="{{.PrevInSection.Permalink}}" />
|
||||
{{ end }}
|
||||
{{ if .NextInSection}}
|
||||
{{ end -}}
|
||||
{{ if .PrevInSection -}}
|
||||
<link rel="prev" href="{{ .PrevInSection.Permalink }}" />
|
||||
{{ end -}}
|
||||
{{ if .NextInSection -}}
|
||||
<link rel="next" href="{{ .NextInSection.Permalink }}" />
|
||||
{{end}}
|
||||
{{ end -}}
|
||||
<link rel="canonical" href="{{ .Permalink }}" />
|
||||
<link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
||||
@@ -30,20 +30,26 @@
|
||||
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
{{- with .OutputFormats.Get "RSS" -}}
|
||||
<link rel="alternate" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ site.Title }}">
|
||||
<link rel="feed" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ site.Title }}">
|
||||
{{- end -}}
|
||||
{{ with .OutputFormats.Get "RSS" -}}
|
||||
<link rel="alternate" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ $.Site.Title }}">
|
||||
<link rel="feed" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ $.Site.Title }}">
|
||||
{{ end -}}
|
||||
|
||||
{{- template "_internal/twitter_cards.html" . -}}
|
||||
{{ template "_internal/twitter_cards.html" . -}}
|
||||
|
||||
{{- partial "seo_schema.html" . -}}
|
||||
{{ partial "seo.html" . -}}
|
||||
|
||||
{{- $res := resources.Get "css/style.scss" | resources.ToCSS | resources.Minify -}}
|
||||
{{ $res := resources.Get "css/style.scss" | resources.ToCSS | resources.Minify -}}
|
||||
<link rel="stylesheet" href="{{ $res.RelPermalink }}">
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.fontawesome_free_css }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.fontawesome_free_css -}}
|
||||
{{ .Site.Params.cdn.fontawesome_free_css | safeHTML }}
|
||||
{{ else }}
|
||||
{{- $res := resources.Get "css/lib/fontawesome-free/all.min.css" | resources.Minify | resources.Fingerprint "sha512" -}}
|
||||
{{ else -}}
|
||||
{{ $res := resources.Get "css/lib/fontawesome-free/all.min.css" | resources.Minify -}}
|
||||
<link rel="stylesheet" href="{{ $res.RelPermalink }}">
|
||||
{{ end }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.animate_css -}}
|
||||
{{ .Site.Params.cdn.animate_css | safeHTML }}
|
||||
{{ else -}}
|
||||
{{ $res := resources.Get "css/lib/animate/animate.min.css" | resources.Minify -}}
|
||||
<link rel="stylesheet" href="{{ $res.RelPermalink }}">
|
||||
{{ end }}
|
||||
@@ -1,10 +1,9 @@
|
||||
<nav class="navbar">
|
||||
<div class="container">
|
||||
<div class="navbar-header header-logo">
|
||||
<div class="navbar-container">
|
||||
<div class="navbar-header">
|
||||
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
||||
</div>
|
||||
|
||||
<div class="menu navbar-right">
|
||||
<div class="navbar-menu">
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
<a class="menu-item{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) | or (eq $currentPage.RelPermalink .URL) }} active{{ end }}" href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a>
|
||||
@@ -13,19 +12,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<nav class="navbar-mobile" id="nav-mobile" style="display: none">
|
||||
<div class="container">
|
||||
<nav class="navbar-mobile">
|
||||
<div class="navbar-container">
|
||||
<div class="navbar-header">
|
||||
<div><a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180"></i></a> <a href="{{.Site.BaseURL}}">{{ .Site.Title }}</a></div>
|
||||
<div class="menu-toggle">
|
||||
<div><a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180"></i></a> <a href="{{.Site.BaseURL}}">{{ .Site.Title }}</a></div>
|
||||
<div class="menu-toggle" id="menu-toggle">
|
||||
<span></span><span></span><span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="menu" id="mobile-menu">
|
||||
<div class="navbar-menu" id="mobile-menu">
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
<a class="menu-item{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{ end }}" href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a>
|
||||
<a class="menu-item" href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="intro">
|
||||
<div class="home-intro">
|
||||
{{ $avatar := "" }}
|
||||
{{ if .Site.Params.gravatar.email }}
|
||||
{{ $avatar = (printf "https://www.gravatar.com/avatar/%s?s=240&d=mp" (md5 .Site.Params.gravatar.email)) }}
|
||||
@@ -6,7 +6,7 @@
|
||||
{{ $avatar = .Site.Params.avatar }}
|
||||
{{ end }}
|
||||
{{ if $avatar }}
|
||||
<div class="avatar">
|
||||
<div class="home-avatar">
|
||||
<a href="/posts/">
|
||||
<img src={{ $avatar }} alt="avatar">
|
||||
</a>
|
||||
@@ -14,7 +14,7 @@
|
||||
{{ end }}
|
||||
|
||||
{{ with .Site.Params.subtitle }}
|
||||
<h2 class="description">
|
||||
<h2 class="home-description">
|
||||
{{ $id := md5 . | printf "tp-%s" }}
|
||||
<div id={{ printf "r%s" $id }} hidden=true>{{ . | safeHTML }}</div>
|
||||
<div id={{ $id }} class="typeit"></div>
|
||||
@@ -26,7 +26,7 @@
|
||||
</h2>
|
||||
{{ end }}
|
||||
|
||||
<div class="social-links">
|
||||
<div class="home-social-links">
|
||||
{{ partial "home/social.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{ $modify_date := .Lastmod.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
|
||||
<div class="post-footer">
|
||||
<div class="post-footer" id="post-footer">
|
||||
<div class="post-info">
|
||||
<div class="post-info-line">
|
||||
<div class="post-info-mod">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.jquery_js }}
|
||||
{{ $jquery = .Site.Params.cdn.jquery_js }}
|
||||
{{ else }}
|
||||
{{ $res := resources.Get "js/lib/jquery/jquery.min.js" | resources.Minify }}
|
||||
{{ $res := resources.Get "js/lib/jquery/jquery.slim.min.js" | resources.Minify }}
|
||||
{{ $jquery = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ end }}
|
||||
<!-- lazysizes https://github.com/aFarkas/lazysizes -->
|
||||
@@ -34,26 +34,34 @@
|
||||
{{ $katex_auto_render_js = .Site.Params.cdn.katex_auto_render_js }}
|
||||
{{ else }}
|
||||
{{ $res := resources.Get "js/lib/katex/auto-render.min.js" | resources.Minify }}
|
||||
{{ $katex_auto_render_js = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ $katex_auto_render_js = printf "<script defer src=\"%s\" onload=\"renderMathInElement(document.body);\"></script>" $res.RelPermalink }}
|
||||
{{ end }}
|
||||
{{ $katex := delimit (slice $katex_css $katex_js $katex_auto_render_js) "" }}
|
||||
<!-- mermaid https://github.com/knsv/mermaid -->
|
||||
{{ $diagram := "" }}
|
||||
{{ $mermaid := "" }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.mermaid_js }}
|
||||
{{ $diagram = .Site.Params.cdn.mermaid_js }}
|
||||
{{ $mermaid = .Site.Params.cdn.mermaid_js }}
|
||||
{{ else }}
|
||||
{{ $res := resources.Get "js/lib/mermaid/mermaid.min.js" | resources.Minify }}
|
||||
{{ $diagram = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ $mermaid = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ end }}
|
||||
{{ $diagram = delimit (slice $diagram "<script>mermaid.initialize({startOnLoad: true, theme: null,});</script>") "" }}
|
||||
{{ $mermaid = delimit (slice $mermaid "<script>mermaid.initialize({startOnLoad: true, theme: null,});</script>") "" }}
|
||||
<!-- ECharts https://github.com/apache/incubator-echarts -->
|
||||
{{ $echarts := "" }}
|
||||
{{ $echarts_js := "" }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.echarts_js }}
|
||||
{{ $echarts = .Site.Params.cdn.echarts_js }}
|
||||
{{ $echarts_js = .Site.Params.cdn.echarts_js }}
|
||||
{{ else }}
|
||||
{{ $res := resources.Get "js/lib/echarts/echarts.min.js" | resources.Minify }}
|
||||
{{ $echarts = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ $echarts_js = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ end }}
|
||||
{{ $echarts_macarons_js := "" }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.echarts_macarons_js }}
|
||||
{{ $echarts_macarons_js = .Site.Params.cdn.echarts_macarons_js }}
|
||||
{{ else }}
|
||||
{{ $res := resources.Get "js/lib/echarts/macarons.js" | resources.Minify }}
|
||||
{{ $echarts_macarons_js = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ end }}
|
||||
{{ $echarts := delimit (slice $echarts_js $echarts_macarons_js) "" }}
|
||||
<!-- TypeIt https://github.com/alexmacarthur/typeit -->
|
||||
{{ $typeit := "" }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.typeit_js }}
|
||||
@@ -70,7 +78,7 @@
|
||||
{{ $res := resources.Get "js/lib/jquery-countdown/jquery.countdown.min.js" | resources.Minify }}
|
||||
{{ $countdown = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ end }}
|
||||
<!-- MetingJS https://github.com/metowolf/MetingJS -->
|
||||
<!-- APlayer https://github.com/MoePlayer/APlayer -->
|
||||
{{ $aplayer_css := "" }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.aplayer_css }}
|
||||
{{ $aplayer_css = .Site.Params.cdn.aplayer_css }}
|
||||
@@ -85,31 +93,44 @@
|
||||
{{ $res := resources.Get "js/lib/aplayer/APlayer.min.js" | resources.Minify }}
|
||||
{{ $aplayer_js = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ end }}
|
||||
{{ $meting_js := "" }}
|
||||
{{ $aplayer := delimit (slice $aplayer_css $aplayer_js) "" }}
|
||||
<!-- MetingJS https://github.com/metowolf/MetingJS -->
|
||||
{{ $meting := "" }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.meting_js }}
|
||||
{{ $meting_js = .Site.Params.cdn.meting_js }}
|
||||
{{ $meting = .Site.Params.cdn.meting_js }}
|
||||
{{ else }}
|
||||
{{ $res := resources.Get "js/lib/meting/Meting.min.js" | resources.Minify }}
|
||||
{{ $meting_js = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ $meting = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ end }}
|
||||
<!-- Smooth Scroll https://github.com/cferdinandi/smooth-scroll -->
|
||||
{{ $smooth_scroll := "" }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.smooth_scroll_js }}
|
||||
{{ $smooth_scroll = .Site.Params.cdn.smooth_scroll_js }}
|
||||
{{ else }}
|
||||
{{ $res := resources.Get "js/lib/smooth-scroll/smooth-scroll.polyfills.min.js" | resources.Minify }}
|
||||
{{ $smooth_scroll = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ end }}
|
||||
{{ $metingjs := delimit (slice $aplayer_css $aplayer_js $meting_js) "" }}
|
||||
|
||||
{{ $jquery | safeHTML }}
|
||||
{{ $lazysizes | safeHTML }}
|
||||
{{ $smooth_scroll | safeHTML }}
|
||||
|
||||
{{ if .IsPage }}
|
||||
{{ if .Scratch.Get "diagram" }}
|
||||
{{ $diagram | safeHTML }}
|
||||
{{/* dev feature */}}
|
||||
{{ if .Params.dev }}
|
||||
{{ with .Scratch.Get "echartsMap" }}
|
||||
{{ $echarts | safeHTML }}
|
||||
{{ $echartsMap := . }}
|
||||
<script>window.echartsMap = {
|
||||
{{ range $key, $var := $echartsMap }}
|
||||
{{ $key }}: {{ $var | safeJS }},
|
||||
{{ end }}
|
||||
};window.echartsArr=[];</script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ with .Scratch.Get "echartsMap" }}
|
||||
{{ $echarts | safeHTML }}
|
||||
{{ $echartsMap := . }}
|
||||
<script>var echartsMap = {
|
||||
{{ range $key, $var := $echartsMap }}
|
||||
{{ $key }}: {{ $var | safeJS }},
|
||||
{{ end }}
|
||||
};var echartsArr=[];</script>
|
||||
{{ if .Scratch.Get "diagram" }}
|
||||
{{ $mermaid | safeHTML }}
|
||||
{{ end }}
|
||||
|
||||
{{ if or .Params.math .Site.Params.math }}
|
||||
@@ -117,12 +138,13 @@
|
||||
{{ end }}
|
||||
|
||||
{{ if .Scratch.Get "music" }}
|
||||
{{ $metingjs | safeHTML }}
|
||||
{{ $aplayer | safeHTML }}
|
||||
{{ $meting | safeHTML }}
|
||||
{{ end }}
|
||||
|
||||
{{ with .Scratch.Get "countdownMap" }}
|
||||
{{ $countdown | safeHTML }}
|
||||
<script>var countdownMap = {{ . | jsonify | safeJS }};</script>
|
||||
<script>window.countdownMap = {{ . | jsonify | safeJS }};</script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
@@ -133,7 +155,7 @@
|
||||
{{ range $key, $val := $typeitMap }}
|
||||
{{ $typeitArr = $typeitArr | append (slice $val) }}
|
||||
{{ end }}
|
||||
<script>var typeitArr = {{ $typeitArr | jsonify | safeJS }};</script>
|
||||
<script>window.typeitArr = {{ $typeitArr | jsonify | safeJS }};</script>
|
||||
{{ end }}
|
||||
|
||||
{{ $res := resources.Get "/js/blog.js" | resources.Minify }}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{{ if .IsHome }}
|
||||
{{ if .IsHome -}}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "WebSite",
|
||||
"url": "{{ .Site.BaseURL }}",
|
||||
{{ if .Site.Author.name }}
|
||||
{{ with .Site.Author.name }}
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "{{ .Site.Author.name }}"
|
||||
"name": "{{ . }}"
|
||||
},
|
||||
{{ end }}
|
||||
{{ if .Site.Params.description }}
|
||||
"description": "{{ .Site.Params.description }}",
|
||||
{{ with .Site.Params.description }}
|
||||
"description": "{{ . }}",
|
||||
{{ end }}
|
||||
{{ with .Site.Params.image }}
|
||||
"image": "{{ .url | absURL }}",
|
||||
@@ -25,8 +25,7 @@
|
||||
"name": "{{ .Site.Title }}"
|
||||
}
|
||||
</script>
|
||||
|
||||
{{ else if .IsPage }}
|
||||
{{ else if .IsPage -}}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
@@ -80,13 +79,13 @@
|
||||
}
|
||||
},
|
||||
{{ end }}
|
||||
{{ if .Site.Author.Name }}
|
||||
{{ with .Site.Author.Name }}
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "{{ .Site.Author.Name }}"
|
||||
"name": "{{ . }}"
|
||||
},
|
||||
{{ end }}
|
||||
"description": "{{ .Description }}"
|
||||
}
|
||||
</script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -8,9 +8,7 @@
|
||||
{{ end }}
|
||||
|
||||
<article class="post-warp">
|
||||
<header class="post-header">
|
||||
<h1 class="post-title">{{ .Title }}</h1>
|
||||
</header>
|
||||
<h1 class="post-title animated flipInX">{{ .Title }}</h1>
|
||||
|
||||
<div class="post-meta">
|
||||
<div class="post-meta-main">
|
||||
@@ -41,7 +39,7 @@
|
||||
|
||||
{{ with .Params.featured_image }}
|
||||
<div class="post-featured-image">
|
||||
<img src=/images/loading.svg data-sizes=auto data-src={{ . }} alt="featured image" class="featured_image lazyload">
|
||||
<img src=/images/loading.svg data-sizes=auto data-src={{ . }} alt="featured image" class="lazyload">
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
{{ if .Get "id" -}}
|
||||
{{ $id := .Get "id" -}}
|
||||
{{ if .Get "date" -}}
|
||||
{{ $date := .Get "date" -}}
|
||||
{{ with .Page.Scratch.Get "countdownMap" -}}
|
||||
{{ .Page.Scratch.Set "countdownMap" (dict $id $date | merge .) -}}
|
||||
{{ else -}}
|
||||
{{ .Page.Scratch.Set "countdownMap" (dict $id $date) -}}
|
||||
{{ end -}}
|
||||
{{ with .Get "class" -}}
|
||||
<div id={{ $id }} class="{{ . }}"></div>
|
||||
{{- else -}}
|
||||
<div id={{ $id }}></div>
|
||||
{{- end -}}
|
||||
{{ if .Get "date" -}}
|
||||
{{ $date := .Get "date" }}
|
||||
{{ $id := delimit (split (md5 $date) "" | shuffle) "" | printf "cd-%s" -}}
|
||||
{{ $defaultPattern := printf "%%D %s %%H %s %%M %s %%S %s" (T "day") (T "hour") (T "minute") (T "second") }}
|
||||
{{ $new := dict $id (dict "date" $date "pattern" (.Get "pattern" | default $defaultPattern)) }}
|
||||
{{ with .Page.Scratch.Get "countdownMap" -}}
|
||||
{{ .Page.Scratch.Set "countdownMap" (merge . $new) -}}
|
||||
{{ else -}}
|
||||
{{ .Page.Scratch.Set "countdownMap" $new -}}
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
<div id="{{ $id }}"></div>
|
||||
{{ end -}}
|
||||
@@ -7,8 +7,4 @@
|
||||
{{ $echartsMap = dict $id .Inner -}}
|
||||
{{ end -}}
|
||||
{{ .Page.Scratch.Set "echartsMap" $echartsMap -}}
|
||||
{{ if .IsNamedParams }}
|
||||
<div class="echarts" id="{{ $id }}" style="width: {{ .Get "width" }}; height: {{ .Get "height" }};"></div>
|
||||
{{ else }}
|
||||
<div class="echarts" id="{{ $id }}" style="width: {{ .Get 0 }}; height: {{ .Get 1 }};"></div>
|
||||
{{ end }}
|
||||
<div class="echarts" id="{{ $id }}"></div>
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
{{ define "content" }}
|
||||
<div class="post-warp archive">
|
||||
<h2 class="post-title">
|
||||
<h2 class="post-title animated pulse faster">
|
||||
{{ $taxonomy := .Data.Singular }}
|
||||
{{ if eq $taxonomy "category" }}
|
||||
<i class="far fa-folder-open"></i> {{ .Title }}
|
||||
@@ -12,6 +12,7 @@
|
||||
{{ printf "%s - %s" (T $taxonomy | default (humanize $taxonomy)) .Title }}
|
||||
{{ end }}
|
||||
</h2>
|
||||
|
||||
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
|
||||
<h3>{{ .Key }}</h3>
|
||||
{{ range .Pages }}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{ define "title" }}{{ T .Data.Plural | default (humanize .Data.Plural) }} | {{ .Site.Title }}{{ end }}
|
||||
{{ define "title" }}{{ T "all" }}{{ T .Data.Plural | default (humanize .Data.Plural) }} | {{ .Site.Title }}{{ end }}
|
||||
|
||||
{{ define "content" }}
|
||||
{{ $taxonomies := .Data.Plural }}
|
||||
@@ -6,7 +6,7 @@
|
||||
{{ $type := .Type }}
|
||||
|
||||
<div class="post-warp archive">
|
||||
<h2 class="post-title">
|
||||
<h2 class="post-title animated pulse faster">
|
||||
{{- printf "%s%s" (T "all") (T $taxonomies | default (humanize $taxonomies)) -}}
|
||||
</h2>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user