Merge branch 'master' into opengraph
This commit is contained in:
@@ -1,18 +1,22 @@
|
||||
{{ define "title" }}{{ T "pageNotFound" }} | {{ .Site.Title }}{{ end -}}
|
||||
{{- define "title" }}
|
||||
{{- T "pageNotFound" | printf "404 %s" }} | {{ .Site.Title -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ define "content" }}
|
||||
{{- define "content" -}}
|
||||
<div class="notfound">
|
||||
<h1 class="error-emoji"></h1>
|
||||
<p class="error-text">/* 404 {{ T "pageNotFound" }}. */</p>
|
||||
<p class="error-link"><a href="{{ .Site.BaseURL }}">↑ {{ T "backToHome" }} ↑</a></p>
|
||||
<h1 id="error-emoji"></h1>
|
||||
<p class="error-text">
|
||||
{{- T "pageNotFoundText" -}}
|
||||
<a href="{{ .Site.BaseURL }}" title="{{ T "backToHome" }}">↩︎</a>
|
||||
</p>
|
||||
</div>
|
||||
<script>
|
||||
var errorEmojiContainer = document.getElementsByClassName('error-emoji')[0];
|
||||
var emojiArray = [
|
||||
const emojiArray = [
|
||||
'\\(o_o)/', '(o^^)o', '(˚Δ˚)b', '(^-^*)', '(≥o≤)', '(^_^)b', '(·_·)',
|
||||
'(=\'X\'=)', '(>_<)', '(;-;)', '\\(^Д^)/',
|
||||
];
|
||||
var errorEmoji = emojiArray[Math.floor(Math.random() * emojiArray.length)];
|
||||
const errorEmoji = emojiArray[Math.floor(Math.random() * emojiArray.length)];
|
||||
const errorEmojiContainer = document.getElementById('error-emoji');
|
||||
errorEmojiContainer.appendChild(document.createTextNode(errorEmoji));
|
||||
</script>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
11
layouts/_default/_markup/render-image.html
Normal file
11
layouts/_default/_markup/render-image.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<figure>
|
||||
{{- /* Lazyload */ -}}
|
||||
{{- $loading := resources.Get "svg/loading.svg" | minify -}}
|
||||
<img src="{{ $loading.RelPermalink | safeURL }}" data-sizes="auto" data-src="{{ .Destination | safeURL }}" alt="{{ .Text }}"{{ with .Title }} title="{{ . }}"{{ end }} class="lazyload">
|
||||
{{- $caption := .Title | default .Text -}}
|
||||
{{- with $caption -}}
|
||||
<figcaption class="image-caption">
|
||||
{{- . -}}
|
||||
</figcaption>
|
||||
{{- end -}}
|
||||
</figure>
|
||||
3
layouts/_default/_markup/render-link.html
Normal file
3
layouts/_default/_markup/render-link.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<a href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}>
|
||||
{{- .Text | safeHTML -}}
|
||||
</a>
|
||||
@@ -1,29 +1,42 @@
|
||||
{{ 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 -}}
|
||||
{{- /* LoveIt theme version detection */ -}}
|
||||
{{- if ne .Site.Params.version "0.1.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" . }}
|
||||
<title>
|
||||
{{- block "title" . }}{{ .Site.Title }}{{ end -}}
|
||||
</title>
|
||||
{{- partial "head.html" . -}}
|
||||
</head>
|
||||
<body>
|
||||
{{- /* Check theme isDark before body rendering */ -}}
|
||||
<script>
|
||||
window.isDark = (window.localStorage && window.localStorage.getItem('theme')) === 'dark';
|
||||
window.isDark && document.body.classList.add('dark-theme');
|
||||
</script>
|
||||
|
||||
{{- /* Body wrapper */ -}}
|
||||
<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" . -}}
|
||||
</div>
|
||||
<a href="#" class="dynamic-to-top" id="dynamic-to-top" data-scroll><span> </span></a>
|
||||
|
||||
{{- /* Dynamic to top button */ -}}
|
||||
<a href="#" class="dynamic-to-top" id="dynamic-to-top" data-scroll>
|
||||
<span> </span>
|
||||
</a>
|
||||
|
||||
{{- /* Load scripts */ -}}
|
||||
{{- partial "scripts.html" . -}}
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,17 +1,22 @@
|
||||
{{ define "title" }}{{ T "all" | humanize}}{{ T .Section | default .Section | humanize }} | {{ .Site.Title }}{{ end -}}
|
||||
{{- define "title" }}
|
||||
{{- T "all" | humanize}}{{ T .Section | default .Section | humanize }} | {{ .Site.Title -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ define "content" -}}
|
||||
{{ $data := .Data -}}
|
||||
<div class="post-warp archive">
|
||||
{{- define "content" -}}
|
||||
<div class="page archive">
|
||||
{{- /* Title */ -}}
|
||||
<h2 class="post-title animated pulse faster">
|
||||
{{ T "all" | humanize}}{{ T .Section | default .Section | humanize }}
|
||||
{{- T "all" | humanize}}{{ T .Section | default .Section | humanize -}}
|
||||
</h2>
|
||||
|
||||
{{- /* Paginate */ -}}
|
||||
{{- range (.Paginate (.Pages.GroupByDate "2006")).PageGroups -}}
|
||||
<h3>{{ .Key }}</h3>
|
||||
{{- range .Pages -}}
|
||||
<article class="archive-item">
|
||||
<a href="{{ .RelPermalink }}" class="archive-item-link">{{ .Title }}</a>
|
||||
<a href="{{ .RelPermalink }}" class="archive-item-link">
|
||||
{{- .Title -}}
|
||||
</a>
|
||||
<span class="archive-item-date">
|
||||
{{- .Date.Format (.Site.Params.dateFormatToUse | default "01-02") -}}
|
||||
</span>
|
||||
@@ -20,4 +25,4 @@
|
||||
{{- end -}}
|
||||
{{- partial "paginator.html" . -}}
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
@@ -1,35 +1,15 @@
|
||||
{{ define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end }}
|
||||
{{- define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end -}}
|
||||
|
||||
{{ define "content" }}
|
||||
<div class="post-warp single">
|
||||
<h1 class="post-title animated pulse faster">{{ .Title }}</h1>
|
||||
{{- define "content" -}}
|
||||
<div class="page single">
|
||||
{{- /* Title */ -}}
|
||||
<h1 class="post-title animated pulse faster">
|
||||
{{- .Title -}}
|
||||
</h1>
|
||||
|
||||
{{- /* Content */ -}}
|
||||
<div class="post-content">
|
||||
{{ $content := .Content }}
|
||||
{{ $REin := `<img src="([^"]+)" alt="([^"]+)?" />` }}
|
||||
{{ $REout := "<figure><img src=/images/loading.svg data-sizes=auto data-src=$1 alt=$2 class=lazyload><figcaption class=image-caption>$2</figcaption></figure>" }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<img src="([^"]+)" alt="([^"]+)?" title="([^"]+)?" />` }}
|
||||
{{ $REout = "<figure><img src=/images/loading.svg data-src=$1 data-sizes=auto alt=$2 title=$3 class=lazyload><figcaption class=image-caption>$2</figcaption></figure>" }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `:\(([\w- ]+?)\):` }}
|
||||
{{ $REout = `<i class="$1 fa-fw"></i>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `\[(.+?)\]\^\((.+?)\)` }}
|
||||
{{ $REout = `<strong><ruby>$1<rt>$2</rt></ruby></strong>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<sup>\[return\]</sup>` }}
|
||||
{{ $REout = printf "<sup>[%s]</sup>" (T "return") }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<(h[123456]) (id=".+?")>` }}
|
||||
{{ $REout = `<a class="post-dummy-target" $2></a><$1>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<(sup class="footnote-ref") (id="fnref:.+?")>` }}
|
||||
{{ $REout = `<a class="post-dummy-target" $2></a><$1>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<(li) (id="fn:.+?")>` }}
|
||||
{{ $REout = `<$1><a class="post-dummy-target" $2></a>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $content | safeHTML }}
|
||||
{{- partial "hook/content.html" .Content | safeHTML -}}
|
||||
</div>
|
||||
</div>
|
||||
{{end }}
|
||||
{{- end -}}
|
||||
@@ -1,3 +1,3 @@
|
||||
# {{ .Title }}
|
||||
|
||||
{{ .RawContent }}
|
||||
{{ .RawContent }}
|
||||
|
||||
@@ -1,59 +1,64 @@
|
||||
<article class="post" itemscope itemtype="http://schema.org/Article">
|
||||
{{ $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}
|
||||
{{ $author := .Site.Author.name }}
|
||||
{{ if isset .Params "author" }}
|
||||
{{ $author = .Site.Author.name }}
|
||||
{{ end }}
|
||||
|
||||
<!--featured_image-->
|
||||
{{ with .Params.featured_image }}
|
||||
{{ $image := $.Params.featured_image_preview | default . }}
|
||||
{{- /* Featured image */ -}}
|
||||
{{- with .Params.featured_image -}}
|
||||
<div class="post-featured-image-preview">
|
||||
<img src=/images/loading.svg data-sizes=auto data-src={{ $image }} alt="featured image" class="lazyload">
|
||||
{{- $image := $.Params.featured_image_preview | default . -}}
|
||||
{{- partial "image" $image -}}
|
||||
</div>
|
||||
{{ end }}
|
||||
<!-- end featured_image-->
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Title */ -}}
|
||||
<h1 class="post-title post-list-title" itemprop="name headline">
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</h1>
|
||||
|
||||
{{- /* Meta */ -}}
|
||||
<div class="post-meta">
|
||||
<a class="author" href="{{.Site.BaseURL }}" rel="author"><i class="fas fa-user-circle fa-fw"></i>{{ $author }} </a>
|
||||
{{ T "publish" }} <time datetime={{ $publish_date }}>{{ $publish_date }}</time>
|
||||
{{ with .Params.categories -}}
|
||||
{{- $author := .Params.author | default .Site.Author.name -}}
|
||||
{{- $author_link := .Params.author_link | default .Site.Author.link | default .Site.BaseURL -}}
|
||||
<a class="author" href="{{ $author_link }}" rel="author" target="_blank">
|
||||
<i class="fas fa-user-circle fa-fw"></i>{{ $author }}
|
||||
</a>
|
||||
|
||||
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
|
||||
{{ T "publish" }} <time datetime={{ $publish_date }}>{{ $publish_date }}</time>
|
||||
|
||||
{{- with .Params.categories -}}
|
||||
<span class="post-category">
|
||||
{{ T "included" }}
|
||||
{{ range . }}
|
||||
{{- T "included" -}}
|
||||
{{- range . -}}
|
||||
{{- $name := . -}}
|
||||
{{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}}
|
||||
<i class="far fa-folder fa-fw"></i><a href="{{ .Permalink }}">{{ $name }}</a>
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
<i class="far fa-folder fa-fw"></i>
|
||||
<a href="{{ .Permalink }}">{{ $name | humanize }}</a>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</span>
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
{{- /* Summary content */ -}}
|
||||
<div class="post-content">
|
||||
{{ if .Params.show_description }}
|
||||
<p>{{ .Params.description }}</p>
|
||||
{{ else }}
|
||||
{{ $summary := .Summary }}
|
||||
{{ $REin := `:\(([\w- ]+?)\):` }}
|
||||
{{ $REout := `<i class="$1 fa-fw"></i>` }}
|
||||
{{ $summary = replaceRE $REin $REout $summary }}
|
||||
{{ $REin = `\[(.+?)\]\^\((.+?)\)` }}
|
||||
{{ $REout = `<strong><ruby>$1<rt>$2</rt></ruby></strong>` }}
|
||||
{{ $summary = replaceRE $REin $REout $summary }}
|
||||
{{ $summary | safeHTML }}
|
||||
{{ end }}
|
||||
{{- if .Params.description_as_summary -}}
|
||||
<p>
|
||||
{{- .Params.description -}}
|
||||
</p>
|
||||
{{- else -}}
|
||||
{{- partial "hook/content.html" .Summary | safeHTML -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
{{- /* Footer */ -}}
|
||||
<div class="post-footer">
|
||||
<a href="{{ .Permalink }}">{{ T "readmore" }}</a>
|
||||
{{ with .Params.tags }}
|
||||
<a href="{{ .Permalink }}">{{ T "readMore" }}</a>
|
||||
{{- with .Params.tags -}}
|
||||
<div class="post-tags">
|
||||
{{ range . }}
|
||||
<span class="tag"><a href="{{ "tags/" | absURL }}{{ . | urlize }}/"><i class="fas fa-tag fa-fw"></i>{{ . }}</a></span>
|
||||
{{ end }}
|
||||
{{- range . -}}
|
||||
<span class="tag">
|
||||
<a href="{{ "tags/" | absURL }}{{ . | urlize }}/"><i class="fas fa-tag fa-fw"></i> {{ . }}</a>
|
||||
</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
</div>
|
||||
</article>
|
||||
@@ -1,37 +1,49 @@
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
{{ if .IsHome }}
|
||||
<title>{{ .Title }}</title>
|
||||
{{ else }}
|
||||
<title>{{ .Title }} - {{ .Site.Title }}</title>
|
||||
{{ end }}
|
||||
{{- with .Title }}{{ . }} | {{ end }}{{ .Site.Title -}}
|
||||
<link href="{{ .Permalink }}index.xml" rel="self"/>
|
||||
<link href="{{ .Permalink }}"/>
|
||||
{{ if not .Date.IsZero }}
|
||||
<updated>{{ .Date.Format "02-01-2006T15:04:05-07:00" | safeHTML }}</updated>
|
||||
{{ end }}
|
||||
<id>{{ .Permalink }}</id>
|
||||
{{- if not .Date.IsZero -}}
|
||||
<updated>
|
||||
{{- .Date.Format "02-01-2006T15:04:05-07:00" | safeHTML -}}
|
||||
</updated>
|
||||
{{- end -}}
|
||||
<id>
|
||||
{{- .Permalink -}}
|
||||
</id>
|
||||
<author>
|
||||
{{ with .Site.Author.name }}
|
||||
{{- with .Site.Author.name -}}
|
||||
<name>{{ . }}</name>
|
||||
{{ end }}
|
||||
{{ with $.Site.Author.email }}
|
||||
{{- end -}}
|
||||
{{- with .Site.Author.email -}}
|
||||
<email>{{ . }}</email>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
</author>
|
||||
<generator>Hugo -- gohugo.io</generator>
|
||||
{{ range first 15 (where .Data.Pages "Type" "in" .Site.Params.mainSections) }}
|
||||
{{- range first 15 (where .Data.Pages "Type" "in" .Site.Params.mainSections) -}}
|
||||
<entry>
|
||||
{{ `<title type="html"><![CDATA[` | safeHTML }}{{ .Title }}]]></title>
|
||||
<title type="html">
|
||||
{{- printf "<![CDATA[%s]]>" .Title | safeHTML -}}
|
||||
</title>
|
||||
<link href="{{ .Permalink }}"/>
|
||||
<id>{{ .Permalink }}</id>
|
||||
{{ with .Site.Author.name }}
|
||||
<id>
|
||||
{{- .Permalink -}}
|
||||
</id>
|
||||
{{- with .Site.Author.name -}}
|
||||
<author>
|
||||
<name>{{ . }}</name>
|
||||
<name>
|
||||
{{- . -}}
|
||||
</name>
|
||||
</author>
|
||||
{{ end }}
|
||||
<published>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published>
|
||||
<updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
|
||||
{{ `<content type="html"><![CDATA[` | safeHTML }}{{ .Content }}]]></content>
|
||||
{{- end -}}
|
||||
<published>
|
||||
{{- .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML -}}
|
||||
</published>
|
||||
<updated>
|
||||
{{- .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML -}}
|
||||
</updated>
|
||||
<content type="html">
|
||||
{{- printf "<![CDATA[%s]]>" .Content | safeHTML -}}
|
||||
</content>
|
||||
</entry>
|
||||
{{ end }}
|
||||
</feed>
|
||||
{{- end -}}
|
||||
</feed>
|
||||
@@ -1,22 +1,27 @@
|
||||
{{ define "content" -}}
|
||||
{{ if eq .Site.Params.home_mode "post" -}}
|
||||
<div class="post-warp">
|
||||
{{- define "content" -}}
|
||||
{{- /* Home mode [post] */ -}}
|
||||
{{- if eq .Site.Params.home_mode "post" -}}
|
||||
<div class="page">
|
||||
{{- /* Profile */ -}}
|
||||
{{- partial "home/profile.html" . -}}
|
||||
|
||||
{{ $paginator := where .Site.RegularPages "Type" "posts" -}}
|
||||
{{ $paginator = where $paginator "Params.show_in_homepage" "!=" false -}}
|
||||
{{ with .Site.Params.home_paginate -}}
|
||||
{{ $paginator = $.Paginate $paginator . -}}
|
||||
{{ else -}}
|
||||
{{ $paginator = $.Paginate $paginator -}}
|
||||
{{ end -}}
|
||||
{{ range $paginator.Pages -}}
|
||||
{{ .Render "summary" -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ partial "paginator.html" . -}}
|
||||
{{- /* Paginate */ -}}
|
||||
{{- $paginator := where .Site.RegularPages "Type" "posts" -}}
|
||||
{{- $paginator = where $paginator "Params.show_in_homepage" "!=" false -}}
|
||||
{{- with .Site.Params.home_paginate -}}
|
||||
{{- $paginator = $.Paginate $paginator . -}}
|
||||
{{- else -}}
|
||||
{{- $paginator = $.Paginate $paginator -}}
|
||||
{{- end -}}
|
||||
{{- range $paginator.Pages -}}
|
||||
{{- .Render "summary" -}}
|
||||
{{- end -}}
|
||||
{{- partial "paginator.html" . -}}
|
||||
</div>
|
||||
|
||||
{{- /* Home mode [other] */ -}}
|
||||
{{- else -}}
|
||||
{{ partial "home/profile.html" . -}}
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
{{- /* Profile */ -}}
|
||||
{{- partial "home/profile.html" . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -1,95 +1,107 @@
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .IsPage | and (ne .Params.comment false) -}}
|
||||
<!-- Disqus Comment System-->
|
||||
{{- if .Site.DisqusShortname -}}
|
||||
{{- if eq (getenv "HUGO_ENV") "production" | and .IsPage | and (ne .Params.comment false) -}}
|
||||
{{- /* Disqus Comment System */ -}}
|
||||
{{- if .Site.Params.disqus.shortname -}}
|
||||
<div id="disqus_thread"></div>
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
// Don't ever inject Disqus on localhost--it creates unwanted
|
||||
// discussions from "localhost:1313" on your Disqus account...
|
||||
// discussions from "localhost" on your Disqus account...
|
||||
if (window.location.hostname == "localhost")
|
||||
return;
|
||||
|
||||
var dsq = document.createElement("script"); dsq.type = "text/javascript"; dsq.async = true;
|
||||
var disqus_shortname = "{{ .Site.DisqusShortname }}";
|
||||
var disqus_shortname = "{{ .Site.Params.disqus.shortname }}";
|
||||
dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js";
|
||||
(document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
{{- end -}}
|
||||
|
||||
<!-- gitalk Comment System-->
|
||||
{{- /* Gitalk Comment System */ -}}
|
||||
{{- if .Site.Params.gitalk.owner -}}
|
||||
<div id="gitalk-container"></div>
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.gitalk_css }}
|
||||
{{ .Site.Params.cdn.gitalk_css | safeHTML }}
|
||||
{{ else }}
|
||||
{{- if .Site.Params.cdn.gitalk_css -}}
|
||||
{{- .Site.Params.cdn.gitalk_css | safeHTML -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "css/lib/gitalk/gitalk.css" | resources.Minify -}}
|
||||
<link rel="stylesheet" href="{{ $res.RelPermalink }}">
|
||||
{{ end }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.gitalk_js }}
|
||||
{{ .Site.Params.cdn.gitalk_js | safeHTML }}
|
||||
{{ else }}
|
||||
{{- end -}}
|
||||
{{- if .Site.Params.cdn.gitalk_js -}}
|
||||
{{ .Site.Params.cdn.gitalk_js | safeHTML -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "js/lib/gitalk/gitalk.min.js" | resources.Minify -}}
|
||||
<script src="{{ $res.RelPermalink }}"></script>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
<script type="text/javascript">
|
||||
var gitalk = new Gitalk({
|
||||
id: "{{ .Date }}",
|
||||
title: "{{ .Title }}",
|
||||
clientID: "{{ .Site.Params.gitalk.clientId }}",
|
||||
clientSecret: "{{ .Site.Params.gitalk.clientSecret }}",
|
||||
repo: "{{ .Site.Params.gitalk.repo }}",
|
||||
owner: "{{ .Site.Params.gitalk.owner }}",
|
||||
admin: ["{{ .Site.Params.gitalk.owner }}"],
|
||||
body: decodeURI(location.href)
|
||||
});
|
||||
gitalk.render("gitalk-container");
|
||||
(function () {
|
||||
// Don't ever inject Gitalk on localhost--it creates unwanted
|
||||
// discussions from "localhost" on your Gitalk account...
|
||||
if (window.location.hostname == "localhost")
|
||||
return;
|
||||
var gitalk = new Gitalk({
|
||||
id: "{{ .Date }}",
|
||||
title: "{{ .Title }}",
|
||||
clientID: "{{ .Site.Params.gitalk.clientId }}",
|
||||
clientSecret: "{{ .Site.Params.gitalk.clientSecret }}",
|
||||
repo: "{{ .Site.Params.gitalk.repo }}",
|
||||
owner: "{{ .Site.Params.gitalk.owner }}",
|
||||
admin: ["{{ .Site.Params.gitalk.owner }}"],
|
||||
body: decodeURI(location.href)
|
||||
});
|
||||
gitalk.render("gitalk-container");
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="https://github.com/gitalk/gitalk">comments powered by gitalk.</a></noscript>
|
||||
<noscript>Please enable JavaScript to view the <a href="https://github.com/gitalk/gitalk">comments powered by Gitalk.</a></noscript>
|
||||
{{- end -}}
|
||||
|
||||
<!-- valine -->
|
||||
{{- /* Valine Comment System */ -}}
|
||||
{{- if .Site.Params.valine.enable -}}
|
||||
<div id="vcomments"></div>
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.valine_js }}
|
||||
{{ .Site.Params.cdn.valine_js | safeHTML }}
|
||||
{{ else }}
|
||||
{{- if .Site.Params.cdn.valine_js -}}
|
||||
{{- .Site.Params.cdn.valine_js | safeHTML -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "js/lib/valine/Valine.min.js" | resources.Minify -}}
|
||||
<script src="{{ $res.RelPermalink }}"></script>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
<script type="text/javascript">
|
||||
new Valine({
|
||||
el: "#vcomments",
|
||||
appId: "{{ .Site.Params.valine.appId }}",
|
||||
appKey: "{{ .Site.Params.valine.appKey }}",
|
||||
meta: ["nick", "mail"],
|
||||
notify: "{{ .Site.Params.valine.notify }}",
|
||||
verify: "{{ .Site.Params.valine.verify }}",
|
||||
avatar: "{{ .Site.Params.valine.avatar }}",
|
||||
placeholder: "{{ .Site.Params.valine.placeholder }}",
|
||||
visitor: "{{ .Site.Params.valine.visitor }}",
|
||||
recordIP: "{{ .Site.Params.valine.recordIP }}",
|
||||
lang: "{{ T `valineLang` }}",
|
||||
});
|
||||
(function () {
|
||||
// Don't ever inject Valine on localhost--it creates unwanted
|
||||
// discussions from "localhost" on your Valine account...
|
||||
if (window.location.hostname == "localhost")
|
||||
return;
|
||||
new Valine({
|
||||
el: "#vcomments",
|
||||
appId: "{{ .Site.Params.valine.appId }}",
|
||||
appKey: "{{ .Site.Params.valine.appKey }}",
|
||||
meta: ["nick", "mail"],
|
||||
notify: "{{ .Site.Params.valine.notify }}",
|
||||
verify: "{{ .Site.Params.valine.verify }}",
|
||||
avatar: "{{ .Site.Params.valine.avatar }}",
|
||||
placeholder: "{{ .Site.Params.valine.placeholder }}",
|
||||
visitor: "{{ .Site.Params.valine.visitor }}",
|
||||
recordIP: "{{ .Site.Params.valine.recordIP }}",
|
||||
lang: "{{ T `valineLang` }}",
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="https://valine.js.org/">comments powered by Valine.</a></noscript>
|
||||
{{- end -}}
|
||||
|
||||
<!-- facebook comment -->
|
||||
{{- /* Facebook Comment System */ -}}
|
||||
{{- if .Site.Params.facebook.enable -}}
|
||||
<div id="fb-root"></div>
|
||||
<script
|
||||
async
|
||||
defer
|
||||
crossorigin="anonymous"
|
||||
<script
|
||||
async
|
||||
defer
|
||||
crossorigin="anonymous"
|
||||
src="https://connect.facebook.net/{{ .Site.Params.facebook.languageCode }}/sdk.js#xfbml=1&version=v5.0&appId={{ .Site.Params.facebook.appId }}&autoLogAppEvents=1"
|
||||
></script>
|
||||
<div
|
||||
class="fb-comments"
|
||||
<div
|
||||
class="fb-comments"
|
||||
data-href="{{ .Site.Params.baseURL }}{{ .Permalink | absURL }}"
|
||||
data-width="{{ .Site.Params.facebook.width }}"
|
||||
data-width="{{ .Site.Params.facebook.width }}"
|
||||
data-numposts="{{ .Site.Params.facebook.numPosts }}"
|
||||
></div>
|
||||
<noscript>Please enable JavaScript to view the <a href="https://developers.facebook.com/docs/plugins/comments/">comments powered by Facebook.</a></noscript>
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
@@ -1,23 +1,35 @@
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
{{- /* Hugo and LoveIt */ -}}
|
||||
<div class="copyright-line">
|
||||
{{ (printf (T "powered") `<a href="https://gohugo.io/" target="_blank" rel="external nofollow noopener noreffer">Hugo</a>`) | safeHTML }} | {{ T "theme" }}<a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="external nofollow noopener noreffer">LoveIt<i class="far fa-heart fa-fw"></i></a>
|
||||
{{- printf (T "powered") `<a href="https://gohugo.io/" target="_blank" rel="external nofollow noopener noreffer">Hugo</a>` | safeHTML }} | {{ T "theme" }}<a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="external nofollow noopener noreffer">LoveIt<i class="far fa-heart fa-fw"></i></a>
|
||||
</div>
|
||||
|
||||
<div class="copyright-line">
|
||||
{{- /* Copyright year */ -}}
|
||||
<i class="far fa-copyright fa-fw"></i>
|
||||
{{- with .Site.Params.since -}}
|
||||
<span itemprop="copyrightYear">{{ if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year }}</span>
|
||||
<span itemprop="copyrightYear">
|
||||
{{- if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year -}}
|
||||
</span>
|
||||
{{- else -}}
|
||||
<span itemprop="copyrightYear">{{ now.Year }}</span>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Author */ -}}
|
||||
{{- with .Site.Author.name -}}
|
||||
<span class="author" itemprop="copyrightHolder"> <a href="{{ $.Site.BaseURL }}">{{ . }}</a></span>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.icp -}}
|
||||
<span class="icp"> | {{ . | safeHTML }}</span>
|
||||
<span class="author" itemprop="copyrightHolder"> <a href="{{ $.Site.Author.link | default $.Site.BaseURL }}" target="_blank">{{ . }}</a></span>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* License */ -}}
|
||||
{{- with .Site.Params.license -}}
|
||||
<span class="license"> | {{ . | safeHTML }}</span>
|
||||
| <span class="license">{{ . | safeHTML }}</span>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* ICP */ -}}
|
||||
{{- with .Site.Params.icp -}}
|
||||
<span class="icp-splitter"> | </span><br class="icp-br"/>
|
||||
<span class="icp">{{ . | safeHTML }}</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="robots" content="noodp" />
|
||||
<meta name="Description" content="{{ .Params.description | default .Site.Params.description }}">
|
||||
{{ 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 -}}
|
||||
{{- end -}}
|
||||
{{- if .PrevInSection -}}
|
||||
<link rel="prev" href="{{ .PrevInSection.Permalink }}" />
|
||||
{{ end -}}
|
||||
{{ if .NextInSection -}}
|
||||
{{- 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">
|
||||
@@ -31,27 +31,39 @@
|
||||
<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" -}}
|
||||
{{- 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 -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ template "_internal/twitter_cards.html" . -}}
|
||||
{{ template "_internal/opengraph.html" . }}
|
||||
{{- template "_internal/opengraph.html" . -}}
|
||||
|
||||
{{ partial "seo.html" . -}}
|
||||
{{- $share := .Params.share.enable | default .Site.Params.share.enable | eq true -}}
|
||||
{{- if $share | and (.Params.Share.Twitter | default .Site.Params.Share.Twitter | eq true) -}}
|
||||
{{- template "_internal/twitter_cards.html" . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ $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 -}}
|
||||
{{ .Site.Params.cdn.fontawesome_free_css | safeHTML }}
|
||||
{{ else -}}
|
||||
{{ $res := resources.Get "css/lib/fontawesome-free/all.min.css" | resources.Minify -}}
|
||||
{{- partial "seo.html" . -}}
|
||||
|
||||
{{- $options := dict "targetPath" "css/style.min.css" "outputStyle" "compressed" "enableSourceMap" true -}}
|
||||
{{- if fileExists "config/css/_custom.scss" -}}
|
||||
{{- $options = dict "includePaths" (slice "config/css") | merge $options -}}
|
||||
{{- $res := resources.Get "css/custom-style.scss" | toCSS $options -}}
|
||||
<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 -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "css/style.scss" | toCSS $options -}}
|
||||
<link rel="stylesheet" href="{{ $res.RelPermalink }}">
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- 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" -}}
|
||||
<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" -}}
|
||||
<link rel="stylesheet" href="{{ $res.RelPermalink }}">
|
||||
{{- end -}}
|
||||
@@ -1,33 +1,44 @@
|
||||
{{- /* Desktop navbar */ -}}
|
||||
<nav class="navbar">
|
||||
<div class="navbar-container">
|
||||
<div class="navbar-header animated bounceIn">
|
||||
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
||||
<a href="{{ .Site.BaseURL }}">
|
||||
{{- .Site.Title -}}
|
||||
</a>
|
||||
</div>
|
||||
<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 | safeHTML }}</a>
|
||||
{{ end }}
|
||||
<a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180 fa-fw" title="Switch Theme"></i></a>
|
||||
{{- $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 }}">
|
||||
{{- .Pre | safeHTML }}{{ .Name -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
<a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180 fa-fw" title="{{ T "switchTheme" }}"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
{{- /* Mobile navbar */ -}}
|
||||
<nav class="navbar-mobile">
|
||||
<div class="navbar-container">
|
||||
<div class="navbar-container">
|
||||
<div class="navbar-header">
|
||||
<div class="navbar-header-title animated bounceIn">
|
||||
<a href="{{.Site.BaseURL}}">{{ .Site.Title }}</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="navbar-menu" id="mobile-menu">
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
<a class="menu-item" href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name | safeHTML }}</a>
|
||||
{{ end }}
|
||||
<a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180 fa-fw"></i></a>
|
||||
{{- $currentPage := . -}}
|
||||
{{- range .Site.Menus.main -}}
|
||||
<a class="menu-item" href="{{ .URL | absLangURL }}" title="{{ .Title }}">
|
||||
{{- .Name | safeHTML -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
<a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180 fa-fw" title="{{ T "switchTheme" }}"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -1,32 +1,34 @@
|
||||
<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)) }}
|
||||
{{ else if .Site.Params.avatar }}
|
||||
{{ $avatar = .Site.Params.avatar }}
|
||||
{{ end }}
|
||||
{{ if $avatar }}
|
||||
{{- $avatar := "" -}}
|
||||
{{- if .Site.Params.gravatar.email -}}
|
||||
{{- $avatar = (printf "https://www.gravatar.com/avatar/%s?s=240&d=mp" (md5 .Site.Params.gravatar.email)) -}}
|
||||
{{- else if .Site.Params.avatar -}}
|
||||
{{- $avatar = .Site.Params.avatar -}}
|
||||
{{- end -}}
|
||||
{{- if $avatar -}}
|
||||
<div class="home-avatar">
|
||||
<a href="/posts">
|
||||
<img src={{ $avatar | relURL }} alt="avatar">
|
||||
<img src={{ $avatar | relURL }} alt="avatar" title="{{ T "home" }}">
|
||||
</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{ with .Site.Params.subtitle }}
|
||||
{{- with .Site.Params.subtitle -}}
|
||||
<h2 class="home-description">
|
||||
{{ $id := md5 . | printf "tp-%s" }}
|
||||
<div id={{ printf "r%s" $id }} hidden=true>{{ . | safeHTML }}</div>
|
||||
{{- $id := md5 . | printf "tp-%s" -}}
|
||||
<div id={{ printf "r%s" $id }} hidden=true>
|
||||
{{- . | safeHTML -}}
|
||||
</div>
|
||||
<div id={{ $id }} class="typeit"></div>
|
||||
{{ with $.Scratch.Get "typeitMap" }}
|
||||
{{ $.Scratch.Set "typeitMap" (dict $id (slice $id) | merge .) }}
|
||||
{{ else }}
|
||||
{{ $.Scratch.Set "typeitMap" (dict $id (slice $id)) }}
|
||||
{{ end }}
|
||||
{{- with $.Scratch.Get "typeitMap" -}}
|
||||
{{- $.Scratch.Set "typeitMap" (dict $id (slice $id) | merge .) -}}
|
||||
{{- else -}}
|
||||
{{- $.Scratch.Set "typeitMap" (dict $id (slice $id)) -}}
|
||||
{{- end -}}
|
||||
</h2>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
<div class="home-social-links">
|
||||
{{ partial "home/social.html" . }}
|
||||
{{- partial "home/social.html" . -}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,171 +1,288 @@
|
||||
{{ with .Site.Params.Social.Github }}
|
||||
<a href="https://github.com/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-github-alt fa-fw" title="Github"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.LinkedIn }}
|
||||
<a href="https://linkedin.com/in/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-linkedin fa-fw" title="LinkedIn"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Twitter }}
|
||||
<a href="https://twitter.com/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-twitter fa-fw" title="Twitter"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Instagram }}
|
||||
<a href="https://www.instagram.com/{{.}}/" rel="me noopener noreffer" target="_blank"><i class="fab fa-instagram fa-fw" title="Instagram"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Facebook}}
|
||||
<a href="https://facebook.com/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-facebook fa-fw" title="Facebook"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Telegram}}
|
||||
<a href="https://t.me/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-telegram-plane fa-fw" title="Telegram"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Medium}}
|
||||
<a href="https://medium.com/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-medium fa-fw" title="Medium"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Gitlab}}
|
||||
<a href="https://gitlab.com/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-gitlab fa-fw" title="Gitlab"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Youtubelegacy}}
|
||||
<a href="https://www.youtube.com/user/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-youtube fa-fw" title="Youtube"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Youtubecustom}}
|
||||
<a href="https://www.youtube.com/c/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-youtube fa-fw" title="Youtube"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Youtubechannel}}
|
||||
<a href="https://www.youtube.com/channel/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-youtube fa-fw" title="Youtube"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Tumblr}}
|
||||
<a href="https://{{.}}.tumblr.com" rel="me noopener noreffer" target="_blank"><i class="fab fa-tumblr fa-fw" title="Tumblr"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Quora}}
|
||||
<a href="https://www.quora.com/profile/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-quora fa-fw" title="Quora"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Keybase}}
|
||||
<a href="https://keybase.io/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-keybase fa-fw" title="Keybase"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Pinterest}}
|
||||
<a href="https://www.pinterest.com/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-pinterest fa-fw" title="Pinterest"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Reddit}}
|
||||
<a href="https://www.reddit.com/user/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-reddit fa-fw" title="Reddit"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Codepen}}
|
||||
<a href="https://codepen.io/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-codepen fa-fw" title="Codepen"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.FreeCodeCamp}}
|
||||
<a href="https://freecodecamp.org/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-free-code-camp fa-fw"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Bitbucket}}
|
||||
<a href="https://bitbucket.org/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-bitbucket fa-fw" title="Bitbucket"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Stackoverflow}}
|
||||
<a href="https://stackoverflow.com/users/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-stack-overflow fa-fw" title="Stackoverflow"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Weibo}}
|
||||
<a href="https://weibo.com/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-weibo fa-fw" title="Weibo"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Odnoklassniki}}
|
||||
<a href="https://ok.ru/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-odnoklassniki fa-fw" title="Odnoklassniki"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.VKontakte}}
|
||||
<a href="https://vk.com/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-vk fa-fw" title="VKontakte"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Flickr}}
|
||||
<a href="https://www.flickr.com/photos/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-flickr fa-fw" title="Flickr"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Xing}}
|
||||
<a href="https://www.xing.com/profile/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-xing fa-fw" title="Xing"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Snapchat}}
|
||||
<a href="https://www.snapchat.com/add/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-snapchat fa-fw" title="Snapchat"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Soundcloud}}
|
||||
<a href="https://soundcloud.com/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-soundcloud fa-fw" title="Soundcloud"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Spotify}}
|
||||
<a href="https://open.spotify.com/user/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-spotify fa-fw" title="Spotify"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Bandcamp}}
|
||||
<a href="https://{{.}}.bandcamp.com/" rel="me noopener noreffer" target="_blank"><i class="fab fa-bandcamp fa-fw" title="Bandcamp"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Paypal}}
|
||||
<a href="https://paypal.me/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-paypal fa-fw" title="Paypal"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Fivehundredpx}}
|
||||
<a href="https://500px.com/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-500px fa-fw" title="Fivehundredpx"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Mix}}
|
||||
<a href="https://mix.com/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-mix fa-fw" title="Mix"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Goodreads}}
|
||||
<a href="https://www.goodreads.com/user/show/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-goodreads fa-fw" title="Goodreads"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Lastfm}}
|
||||
<a href="https://www.last.fm/user/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-POP_lastfm fa-fw" title="Lastfm"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Foursquare}}
|
||||
<a href="https://foursquare.com/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-foursquare fa-fw" title="Foursquare"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Hackernews}}
|
||||
<a href="https://news.ycombinator.com/user?id={{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-hacker-news fa-fw" title="Hackernews"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Kickstarter}}
|
||||
<a href="https://kickstarter.com/profile/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-kickstarter fa-fw" title="Kickstarter"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Patreon}}
|
||||
<a href="https://patreon.com/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-patreon fa-fw" title="Patreon"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Steam}}
|
||||
<a href="https://steamcommunity.com/id/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-steam fa-fw" title="Steam"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Twitch}}
|
||||
<a href="https://www.twitch.tv/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-twitch fa-fw" title="Twitch"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Strava}}
|
||||
<a href="https://www.strava.com/athletes/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-strava fa-fw" title="Strava"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Skype}}
|
||||
<a href="skype:{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-skype fa-fw" title="Skype"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Whatsapp}}
|
||||
<a href="https://wa.me/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-whatsapp fa-fw" title="Whatsapp"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Zhihu}}
|
||||
<a href="https://www.zhihu.com/people/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-zhihu fa-fw" title="Zhihu"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Angellist}}
|
||||
<a href="https://angel.co/{{.}}" rel="me noopener noreffer" target="_blank"><i class="fab fa-angellist fa-fw" title="Angellist"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Slideshare}}
|
||||
<a href="https://slideshare.com/{{ . }}" rel="me noopener noreffer" target="_blank"><i class="fab fa-slideshare fa-fw" title="Slideshare"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Jsfiddle}}
|
||||
<a href="https://jsfiddle.com/{{ . }}" rel="me noopener noreffer" target="_blank"><i class="fab fa-jsfiddle fa-fw" title="Jsfiddle"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Deviantart}}
|
||||
<a href="https://{{ . }}.deviantart.com/" rel="me noopener noreffer" target="_blank"><i class="fab fa-deviantart fa-fw" title="Deviantart"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Behance}}
|
||||
<a href="https://behance.net/{{ . }}" rel="me noopener noreffer" target="_blank"><i class="fab fa-behance fa-fw" title="Behance"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Dribble}}
|
||||
<a href="https://dribbble.com/{{ . }}" rel="me noopener noreffer" target="_blank"><i class="fab fa-dribbble fa-fw" title="Dribble"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Wordpress}}
|
||||
<a href="https://{{ . }}.wordpress.com" rel="me noopener noreffer" target="_blank"><i class="fab fa-wordpress fa-fw" title="Wordpress"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Vine}}
|
||||
<a href="https://vine.co/" rel="me noopener noreffer" target="_blank"><i class="fab fa-vine fa-fw" title="Vine"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Googlescholar}}
|
||||
<a href="https://scholar.google.com/citations?{{ . }}" rel="me noopener noreffer" target="_blank"><i class="fab fa-Googlescholar fa-fw" title="Googlescholar"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Researchgate}}
|
||||
<a href="https://www.researchgate.net/profile/{{ . }}" rel="me noopener noreffer" target="_blank"><i class="fab fa-researchgate fa-fw" title="Researchgate"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Mastodon}}
|
||||
<a href="https://mastodon.social/{{ . }}" rel="me noopener noreffer" target="_blank"><i class="fab fa-mastodon fa-fw" title="Mastodon"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Devto}}
|
||||
<a href="https://dev.to/{{ . }}" rel="me noopener noreffer" target="_blank"><i class="fab fa-dev fa-fw" title="Dev.To"></i></a>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.Social.Email}}
|
||||
<a href="mailto:{{.}}" rel="me noopener noreffer"><i class="far fa-envelope fa-fw" target="_blank" title="Email"></i></a>
|
||||
{{ end }}
|
||||
{{- with .Site.Params.Social.Github -}}
|
||||
<a href="https://github.com/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-github-alt fa-fw" title="Github"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.LinkedIn -}}
|
||||
<a href="https://linkedin.com/in/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-linkedin fa-fw" title="LinkedIn"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Twitter -}}
|
||||
<a href="https://twitter.com/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-twitter fa-fw" title="Twitter"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Instagram -}}
|
||||
<a href="https://www.instagram.com/{{ . }}/" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-instagram fa-fw" title="Instagram"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Facebook}}
|
||||
<a href="https://facebook.com/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-facebook fa-fw" title="Facebook"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Telegram}}
|
||||
<a href="https://t.me/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-telegram-plane fa-fw" title="Telegram"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Medium}}
|
||||
<a href="https://medium.com/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-medium fa-fw" title="Medium"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Gitlab}}
|
||||
<a href="https://gitlab.com/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-gitlab fa-fw" title="Gitlab"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Youtubelegacy}}
|
||||
<a href="https://www.youtube.com/user/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-youtube fa-fw" title="Youtube"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Youtubecustom}}
|
||||
<a href="https://www.youtube.com/c/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-youtube fa-fw" title="Youtube"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Youtubechannel}}
|
||||
<a href="https://www.youtube.com/channel/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-youtube fa-fw" title="Youtube"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Tumblr}}
|
||||
<a href="https://{{ . }}.tumblr.com" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-tumblr fa-fw" title="Tumblr"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Quora}}
|
||||
<a href="https://www.quora.com/profile/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-quora fa-fw" title="Quora"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Keybase}}
|
||||
<a href="https://keybase.io/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-keybase fa-fw" title="Keybase"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Pinterest}}
|
||||
<a href="https://www.pinterest.com/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-pinterest fa-fw" title="Pinterest"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Reddit}}
|
||||
<a href="https://www.reddit.com/user/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-reddit fa-fw" title="Reddit"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Codepen}}
|
||||
<a href="https://codepen.io/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-codepen fa-fw" title="Codepen"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.FreeCodeCamp}}
|
||||
<a href="https://freecodecamp.org/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-free-code-camp fa-fw"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Bitbucket}}
|
||||
<a href="https://bitbucket.org/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-bitbucket fa-fw" title="Bitbucket"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Stackoverflow}}
|
||||
<a href="https://stackoverflow.com/users/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-stack-overflow fa-fw" title="Stackoverflow"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Weibo}}
|
||||
<a href="https://weibo.com/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-weibo fa-fw" title="Weibo"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Odnoklassniki}}
|
||||
<a href="https://ok.ru/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-odnoklassniki fa-fw" title="Odnoklassniki"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.VKontakte}}
|
||||
<a href="https://vk.com/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-vk fa-fw" title="VKontakte"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Flickr}}
|
||||
<a href="https://www.flickr.com/photos/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-flickr fa-fw" title="Flickr"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Xing}}
|
||||
<a href="https://www.xing.com/profile/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-xing fa-fw" title="Xing"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Snapchat}}
|
||||
<a href="https://www.snapchat.com/add/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-snapchat fa-fw" title="Snapchat"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Soundcloud}}
|
||||
<a href="https://soundcloud.com/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-soundcloud fa-fw" title="Soundcloud"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Spotify}}
|
||||
<a href="https://open.spotify.com/user/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-spotify fa-fw" title="Spotify"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Bandcamp}}
|
||||
<a href="https://{{ . }}.bandcamp.com/" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-bandcamp fa-fw" title="Bandcamp"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Paypal}}
|
||||
<a href="https://paypal.me/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-paypal fa-fw" title="Paypal"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Fivehundredpx}}
|
||||
<a href="https://500px.com/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-500px fa-fw" title="Fivehundredpx"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Mix}}
|
||||
<a href="https://mix.com/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-mix fa-fw" title="Mix"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Goodreads}}
|
||||
<a href="https://www.goodreads.com/user/show/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-goodreads fa-fw" title="Goodreads"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Lastfm}}
|
||||
<a href="https://www.last.fm/user/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-POP_lastfm fa-fw" title="Lastfm"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Foursquare}}
|
||||
<a href="https://foursquare.com/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-foursquare fa-fw" title="Foursquare"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Hackernews}}
|
||||
<a href="https://news.ycombinator.com/user?id={{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-hacker-news fa-fw" title="Hackernews"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Kickstarter}}
|
||||
<a href="https://kickstarter.com/profile/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-kickstarter fa-fw" title="Kickstarter"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Patreon}}
|
||||
<a href="https://patreon.com/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-patreon fa-fw" title="Patreon"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Steam}}
|
||||
<a href="https://steamcommunity.com/id/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-steam fa-fw" title="Steam"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Twitch}}
|
||||
<a href="https://www.twitch.tv/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-twitch fa-fw" title="Twitch"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Strava}}
|
||||
<a href="https://www.strava.com/athletes/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-strava fa-fw" title="Strava"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Skype}}
|
||||
<a href="skype:{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-skype fa-fw" title="Skype"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Whatsapp}}
|
||||
<a href="https://wa.me/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-whatsapp fa-fw" title="Whatsapp"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Zhihu}}
|
||||
<a href="https://www.zhihu.com/people/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-zhihu fa-fw" title="Zhihu"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Angellist}}
|
||||
<a href="https://angel.co/{{ . }}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-angellist fa-fw" title="Angellist"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Slideshare}}
|
||||
<a href="https://slideshare.com/{{- . -}}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-slideshare fa-fw" title="Slideshare"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Jsfiddle}}
|
||||
<a href="https://jsfiddle.com/{{- . -}}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-jsfiddle fa-fw" title="Jsfiddle"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Deviantart}}
|
||||
<a href="https://{{- . -}}.deviantart.com/" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-deviantart fa-fw" title="Deviantart"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Behance}}
|
||||
<a href="https://behance.net/{{- . -}}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-behance fa-fw" title="Behance"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Dribble}}
|
||||
<a href="https://dribbble.com/{{- . -}}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-dribbble fa-fw" title="Dribble"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Wordpress}}
|
||||
<a href="https://{{- . -}}.wordpress.com" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-wordpress fa-fw" title="Wordpress"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Vine}}
|
||||
<a href="https://vine.co/" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-vine fa-fw" title="Vine"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Googlescholar}}
|
||||
<a href="https://scholar.google.com/citations?{{- . -}}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-Googlescholar fa-fw" title="Googlescholar"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Researchgate}}
|
||||
<a href="https://www.researchgate.net/profile/{{- . -}}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-researchgate fa-fw" title="Researchgate"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Mastodon}}
|
||||
<a href="https://mastodon.social/{{- . -}}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-mastodon fa-fw" title="Mastodon"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Devto}}
|
||||
<a href="https://dev.to/{{- . -}}" rel="me noopener noreffer" target="_blank">
|
||||
<i class="fab fa-dev fa-fw" title="Dev.To"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Email}}
|
||||
<a href="mailto:{{ . }}" rel="me noopener noreffer">
|
||||
<i class="far fa-envelope fa-fw" target="_blank" title="Email"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.Social.Custom}}
|
||||
{{- . | safeHTML -}}
|
||||
{{- end -}}
|
||||
43
layouts/partials/hook/content.html
Normal file
43
layouts/partials/hook/content.html
Normal file
@@ -0,0 +1,43 @@
|
||||
{{- /* Font Awesome */ -}}
|
||||
{{- /* :(far fa-circle): -> <i class="far fa-circle fa-fw"></i> */ -}}
|
||||
{{- $REin := `:\(([\w- ]+?)\):` -}}
|
||||
{{- $REout := `<i class="$1 fa-fw"></i>` -}}
|
||||
{{- $content := replaceRE $REin $REout . -}}
|
||||
|
||||
{{- /* Ruby */ -}}
|
||||
{{- /* [EN]^(English) -> <strong><ruby>EN<rt>English</rt></ruby></strong> */ -}}
|
||||
{{- $REin = `\[(.+?)\]\^\((.+?)\)` -}}
|
||||
{{- $REout = `<strong><ruby>$1<rt>$2</rt></ruby></strong>` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
|
||||
{{- /* Checkbox */ -}}
|
||||
{{- $REin = `<input disabled="" type="checkbox">` -}}
|
||||
{{- $REout = `<i class="far fa-check-square fa-fw"></i>` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
|
||||
{{- /* Checkbox checked */ -}}
|
||||
{{- $REin = `<input checked="" disabled="" type="checkbox">` -}}
|
||||
{{- $REout = `<i class="far fa-square fa-fw"></i>` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
|
||||
{{- /* Fix <sup>[return]</sup> */ -}}
|
||||
{{- $REin = `<sup>\[return\]</sup>` -}}
|
||||
{{- $REout = `↩︎` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
|
||||
{{- /* Dummy target */ -}}
|
||||
{{- $REin = `<(h[23456]) (id=".+?")>` -}}
|
||||
{{- $REout = `<a class="post-dummy-target" $2></a><$1>` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
|
||||
{{- /* Dummy target */ -}}
|
||||
{{- $REin = `<(.+) (id="fnref:.+?")>` -}}
|
||||
{{- $REout = `<a class="post-dummy-target" $2></a><$1>` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
|
||||
{{- /* Dummy target */ -}}
|
||||
{{- $REin = `<li (id="fn:.+?")(.*?)>\s?<p>` -}}
|
||||
{{- $REout = `<li $2><p><a class="post-dummy-target" $1></a>` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
|
||||
{{- return $content -}}
|
||||
3
layouts/partials/image.html
Normal file
3
layouts/partials/image.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{{- /* Lazyload */ -}}
|
||||
{{- $res := resources.Get "svg/loading.svg" | minify -}}
|
||||
<img src="{{ $res.RelPermalink | safeURL }}" data-sizes="auto" data-src="{{ . | safeURL }}" alt="featured image" class="lazyload">
|
||||
@@ -1,26 +1,30 @@
|
||||
{{ if gt $.Paginator.TotalPages 1 -}}
|
||||
{{- if gt $.Paginator.TotalPages 1 -}}
|
||||
<ul class="pagination">
|
||||
{{- $.Scratch.Set "paginator.ellipsed" false -}}
|
||||
{{ range $.Paginator.Pagers -}}
|
||||
{{ $right := sub .TotalPages .PageNumber -}}
|
||||
{{ $showNumber := or (le .PageNumber 1) (eq $right 0) -}}
|
||||
{{ $showNumber := or $showNumber (and (gt .PageNumber (sub $.Paginator.PageNumber 3)) (lt .PageNumber (add $.Paginator.PageNumber 3))) -}}
|
||||
{{ if $showNumber -}}
|
||||
{{ $.Scratch.Set "paginator.ellipsed" false -}}
|
||||
{{ $.Scratch.Set "paginator.shouldEllipse" false -}}
|
||||
{{ else -}}
|
||||
{{ $.Scratch.Set "paginator.shouldEllipse" (not ($.Scratch.Get "paginator.ellipsed") ) -}}
|
||||
{{ $.Scratch.Set "paginator.ellipsed" true -}}
|
||||
{{ end -}}
|
||||
{{ if $showNumber -}}
|
||||
{{- range $.Paginator.Pagers -}}
|
||||
{{- $right := sub .TotalPages .PageNumber -}}
|
||||
{{- $showNumber := or (le .PageNumber 1) (eq $right 0) -}}
|
||||
{{- $showNumber := or $showNumber (and (gt .PageNumber (sub $.Paginator.PageNumber 3)) (lt .PageNumber (add $.Paginator.PageNumber 3))) -}}
|
||||
{{- if $showNumber -}}
|
||||
{{- $.Scratch.Set "paginator.ellipsed" false -}}
|
||||
{{- $.Scratch.Set "paginator.shouldEllipse" false -}}
|
||||
{{- else -}}
|
||||
{{- $.Scratch.Set "paginator.shouldEllipse" (not ($.Scratch.Get "paginator.ellipsed") ) -}}
|
||||
{{- $.Scratch.Set "paginator.ellipsed" true -}}
|
||||
{{- end -}}
|
||||
{{- if $showNumber -}}
|
||||
<li class="page-item {{ if eq . $.Paginator }}active{{ end }}">
|
||||
<span class="page-link">
|
||||
<a href="{{ .URL }}">{{ .PageNumber }}</a>
|
||||
<a href="{{ .URL }}">
|
||||
{{- .PageNumber -}}
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
{{- else if ($.Scratch.Get "paginator.shouldEllipse") -}}
|
||||
<li class="page-item "><span class="page-link" aria-hidden="true">…</span></li>
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
<li class="page-item ">
|
||||
<span class="page-link" aria-hidden="true">…</span>
|
||||
</li>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</ul>
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
@@ -1,41 +1,51 @@
|
||||
{{ $modify_date := .Lastmod.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
|
||||
{{- $modify_date := .Lastmod.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
|
||||
<div class="post-footer" id="post-footer">
|
||||
<div class="post-info">
|
||||
<div class="post-info-line">
|
||||
<div class="post-info-mod">
|
||||
<span>{{ printf (T "lastMod") $modify_date }}</span>
|
||||
<span>
|
||||
{{- printf (T "lastMod") $modify_date -}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="post-info-license">
|
||||
{{ if .Params.license }}
|
||||
<span>{{ printf (T "license") .Params.license | safeHTML }}</span>
|
||||
{{ end }}
|
||||
{{- if .Params.license -}}
|
||||
<span>
|
||||
{{- printf (T "license") .Params.license | safeHTML -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="post-info-line">
|
||||
<div class="post-info-md">
|
||||
{{ if .Site.Params.linkToMarkdown }}
|
||||
{{ with .OutputFormats.Get "markdown" }}
|
||||
<span><a class="link-to-markdown" href="{{ .Permalink }}" target="_blank">{{ T "seeMarkDown" }}</a></span>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- if .Site.Params.linkToMarkdown -}}
|
||||
{{- with .OutputFormats.Get "markdown" -}}
|
||||
<span>
|
||||
<a class="link-to-markdown" href="{{ .Permalink }}" target="_blank">
|
||||
{{- T "seeMarkDown" -}}
|
||||
</a>
|
||||
</span>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
<div class="post-info-share">
|
||||
{{ if and ( .Param "socialShare" ) (gt (len (.Param "share")) 0) }}
|
||||
<span>{{ partial "post/share.html" . }}</span>
|
||||
{{ end }}
|
||||
{{- if and ( .Param "socialShare" ) (gt (len (.Param "share")) 0) -}}
|
||||
<span>
|
||||
{{- partial "post/share.html" . -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="post-info-more">
|
||||
<section>
|
||||
{{ with .Params.tags }}
|
||||
{{ range . }}
|
||||
{{- with .Params.tags -}}
|
||||
{{- range . -}}
|
||||
<span class="tag">
|
||||
<a href="{{ "tags/" | absURL }}{{ . | urlize }}/"><i class="fas fa-tag fa-fw"></i>{{ . }}</a>
|
||||
<a href="{{ "tags/" | absURL }}{{ . | urlize }}/"><i class="fas fa-tag fa-fw"></i> {{ . }}</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</section>
|
||||
<section>
|
||||
<span><a href="javascript:window.history.back();">{{ T "back" }}</a></span> | <span><a href="{{ .Site.BaseURL }}">{{ T "home" }}</a></span>
|
||||
@@ -43,11 +53,11 @@
|
||||
</div>
|
||||
|
||||
<div class="post-nav">
|
||||
{{ if .PrevInSection }}
|
||||
{{- if .PrevInSection -}}
|
||||
<a href="{{ .PrevInSection.Permalink }}" class="prev" rel="prev" title="{{ .PrevInSection.Title }}"><i class="fas fa-angle-left fa-fw"></i>{{ .PrevInSection.Title }}</a>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
{{ if .NextInSection }}
|
||||
<a href="{{ .NextInSection.Permalink }}" class="next" rel="next" title="{{ .NextInSection.Title }}">{{ .NextInSection.Title }}<i class="fas fa-angle-right fa-fw"></i></a>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,52 +1,71 @@
|
||||
{{ if or (eq .Params.share.enable false) (eq .Site.Params.share.enable false) | not }}
|
||||
{{ if or .Params.Share.Twitter (and .Site.Params.Share.Twitter (ne .Params.Share.Twitter false)) }}
|
||||
<a href="//twitter.com/share?url={{ .Permalink }}&text={{ .Title }}&via={{ .Site.Params.Social.Twitter }}" target="_blank" title="Share on Twitter">
|
||||
{{- if .Params.share.enable | default .Site.Params.share.enable | eq true -}}
|
||||
{{- /* Share on Twitter */ -}}
|
||||
{{- if .Params.Share.Twitter | default .Site.Params.Share.Twitter | eq true -}}
|
||||
<a href="//twitter.com/share?url={{ .Permalink }}&text={{ .Title }}&via={{ .Site.Params.Social.Twitter }}" target="_blank" title="{{ T "share" }} Twitter">
|
||||
<i class="fab fa-twitter fa-fw"></i>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ if or .Params.Share.Facebook (and .Site.Params.Share.Facebook (ne .Params.Share.Facebook false)) }}
|
||||
<a href="//www.facebook.com/sharer/sharer.php?u={{ .Permalink }}" target="_blank" title="Share on Facebook">
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Share on Facebook */ -}}
|
||||
{{- if .Params.Share.Facebook | default .Site.Params.Share.Facebook | eq true -}}
|
||||
<a href="//www.facebook.com/sharer/sharer.php?u={{ .Permalink }}" target="_blank" title="{{ T "share" }} Facebook">
|
||||
<i class="fab fa-facebook-square fa-fw"></i>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ if or .Params.Share.Reddit (and .Site.Params.Share.Reddit (ne .Params.Share.Reddit false)) }}
|
||||
<a href="//reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}" target="_blank" title="Share on Reddit">
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Share on Reddit */ -}}
|
||||
{{- if .Params.Share.Reddit | default .Site.Params.Share.Reddit | eq true -}}
|
||||
<a href="//reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}" target="_blank" title="{{ T "share" }} Reddit">
|
||||
<i class="fab fa-reddit fa-fw"></i>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ if or .Params.Share.Linkedin (and .Site.Params.Share.Linkedin (ne .Params.Share.Linkedin false)) }}
|
||||
<a href="//www.linkedin.com/shareArticle?url={{ .Permalink }}&title={{ .Title }}" target="_blank" title="Share on LinkedIn">
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Share on Linkedin */ -}}
|
||||
{{- if .Params.Share.Linkedin | default .Site.Params.Share.Linkedin | eq true -}}
|
||||
<a href="//www.linkedin.com/shareArticle?url={{ .Permalink }}&title={{ .Title }}" target="_blank" title="{{ T "share" }} LinkedIn">
|
||||
<i class="fab fa-linkedin fa-fw"></i>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ if or .Params.Share.Pinterest (and .Site.Params.Share.Pinterest (ne .Params.Share.Pinterest false)) }}
|
||||
<a href="//www.pinterest.com/pin/create/button/?url={{ .Permalink }}&description={{ .Title }}" target="_blank" title="Share on Pinterest">
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Share on Pinterest */ -}}
|
||||
{{- if .Params.Share.Pinterest | default .Site.Params.Share.Pinterest | eq true -}}
|
||||
<a href="//www.pinterest.com/pin/create/button/?url={{ .Permalink }}&description={{ .Title }}" target="_blank" title="{{ T "share" }} Pinterest">
|
||||
<i class="fab fa-pinterest fa-fw"></i>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ if or .Params.Share.YCombinator (and .Site.Params.Share.YCombinator (ne .Params.Share.YCombinator false)) }}
|
||||
<a href="//news.ycombinator.com/submitlink?u={{ .Permalink }}&description={{ .Title }}" target="_blank" title="Share on Hacker News">
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Share on Hacker News */ -}}
|
||||
{{- if .Params.Share.Hackernews | default .Site.Params.Share.Hackernews | eq true -}}
|
||||
<a href="//news.ycombinator.com/submitlink?u={{ .Permalink }}&description={{ .Title }}" target="_blank" title="{{ T "share" }} Hacker News">
|
||||
<i class="fab fa-y-combinator fa-fw"></i>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ if or .Params.Share.Mix (and .Site.Params.Share.Mix (ne .Params.Share.Mix false)) }}
|
||||
<a href="//mix.com/add?url={{ .Permalink }}&description={{ .Title }}" target="_blank" title="Share on Mix">
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Share on Mix */ -}}
|
||||
{{- if .Params.Share.Mix | default .Site.Params.Share.Mix | eq true -}}
|
||||
<a href="//mix.com/add?url={{ .Permalink }}&description={{ .Title }}" target="_blank" title="{{ T "share" }} Mix">
|
||||
<i class="fab fa-mix fa-fw"></i>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ if or .Params.Share.Tumblr (and .Site.Params.Share.Tumblr (ne .Params.Share.Tumblr false)) }}
|
||||
<a href="//www.tumblr.com/widgets/share/tool?canonicalUrl={{ .Permalink }}&title={{ .Title }}" target="_blank" title="Share on Tumblr">
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Share on Tumblr */ -}}
|
||||
{{- if .Params.Share.Tumblr | default .Site.Params.Share.Tumblr | eq true -}}
|
||||
<a href="//www.tumblr.com/widgets/share/tool?canonicalUrl={{ .Permalink }}&title={{ .Title }}" target="_blank" title="{{ T "share" }} Tumblr">
|
||||
<i class="fab fa-tumblr fa-fw"></i>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ if or .Params.Share.VK (and .Site.Params.Share.VK (ne .Params.Share.VK false)) }}
|
||||
<a href="//vk.com/share.php?url={{ .Permalink }}&title={{ .Title }}" target="_blank" title="Share on VKontakte ">
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Share on VKontakte */ -}}
|
||||
{{- if .Params.Share.VKontakte | default .Site.Params.Share.VKontakte | eq true -}}
|
||||
<a href="//vk.com/share.php?url={{ .Permalink }}&title={{ .Title }}" target="_blank" title="{{ T "share" }} VKontakte ">
|
||||
<i class="fab fa-vk fa-fw"></i>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ if or .Params.Share.Weibo (and .Site.Params.Share.Weibo (ne .Params.Share.Weibo false)) }}
|
||||
<a href="//service.weibo.com/share/share.php?url={{ .Permalink }}&appkey=&title={{ .Title }}{{ with $.Params.featured_image }}&pic={{ . }}{{ end }}" target="_blank" title="Share on Weibo">
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Share on Weibo */ -}}
|
||||
{{- if .Params.Share.Weibo | default .Site.Params.Share.Weibo | eq true -}}
|
||||
<a href="//service.weibo.com/share/share.php?url={{ .Permalink }}&appkey=&title={{ .Title }}{{ with $.Params.featured_image }}&pic={{ . }}{{- end -}}" target="_blank" title="{{ T "share" }} Weibo">
|
||||
<i class="fab fa-weibo fa-fw"></i>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -1,169 +1,224 @@
|
||||
<!-- jQuery https://github.com/jquery/jquery -->
|
||||
{{ $jquery := "" }}
|
||||
{{ 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.slim.min.js" | resources.Minify }}
|
||||
{{ $jquery = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ end }}
|
||||
<!-- lazysizes https://github.com/aFarkas/lazysizes -->
|
||||
{{ $lazysizes := "" }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.lazysizes_js }}
|
||||
{{ $lazysizes = .Site.Params.cdn.lazysizes_js }}
|
||||
{{ else }}
|
||||
{{ $res := resources.Get "js/lib/lazysizes/lazysizes.min.js" | resources.Minify }}
|
||||
{{ $lazysizes = 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 }}
|
||||
{{ $smooth_scroll = delimit (slice $smooth_scroll "<script>window.scroll = new SmoothScroll('[data-scroll]', {speed: 300, speedAsDuration: true});</script>") "" }}
|
||||
<!-- KaTeX https://github.com/KaTeX/KaTeX -->
|
||||
{{ $katex_css := "" }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_css }}
|
||||
{{ $katex_css = .Site.Params.cdn.katex_css }}
|
||||
{{ else }}
|
||||
{{ $res := resources.Get "css/lib/katex/katex.min.css" | resources.Minify }}
|
||||
{{ $katex_css = printf "<link rel=\"stylesheet\" href=\"%s\">" $res.RelPermalink }}
|
||||
{{ end }}
|
||||
{{ $katex_js := "" }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_js }}
|
||||
{{ $katex_js = .Site.Params.cdn.katex_js }}
|
||||
{{ else }}
|
||||
{{ $res := resources.Get "js/lib/katex/katex.min.js" | resources.Minify }}
|
||||
{{ $katex_js = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ end }}
|
||||
{{ $katex_auto_render_js := "" }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_auto_render_js }}
|
||||
{{ $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 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 -->
|
||||
{{ $mermaid := "" }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.mermaid_js }}
|
||||
{{ $mermaid = .Site.Params.cdn.mermaid_js }}
|
||||
{{ else }}
|
||||
{{ $res := resources.Get "js/lib/mermaid/mermaid.min.js" | resources.Minify }}
|
||||
{{ $mermaid = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ end }}
|
||||
{{ $mermaidInit := "<script>mermaid.initialize({startOnLoad: false, theme: null});</script>" }}
|
||||
{{ $mermaid = delimit (slice $mermaid $mermaidInit) "" }}
|
||||
<!-- ECharts https://github.com/apache/incubator-echarts -->
|
||||
{{ $echarts_js := "" }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .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_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 }}
|
||||
{{ $typeit = .Site.Params.cdn.typeit_js }}
|
||||
{{ else }}
|
||||
{{ $res := resources.Get "js/lib/typeit/typeit.min.js" | resources.Minify }}
|
||||
{{ $typeit = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ end }}
|
||||
<!-- jQuery.countdown https://github.com/hilios/jQuery.countdown -->
|
||||
{{ $countdown := "" }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.jquery_countdown_js }}
|
||||
{{ $countdown = .Site.Params.cdn.jquery_countdown_js }}
|
||||
{{ else }}
|
||||
{{ $res := resources.Get "js/lib/jquery-countdown/jquery.countdown.min.js" | resources.Minify }}
|
||||
{{ $countdown = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ end }}
|
||||
<!-- 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 }}
|
||||
{{ else }}
|
||||
{{ $res := resources.Get "css/lib/aplayer/APlayer.min.css" | resources.Minify }}
|
||||
{{ $aplayer_css = printf "<link rel=\"stylesheet\" href=\"%s\">" $res.RelPermalink }}
|
||||
{{ end }}
|
||||
{{ $aplayer_js := "" }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.aplayer_js }}
|
||||
{{ $aplayer_js = .Site.Params.cdn.aplayer_js }}
|
||||
{{ else }}
|
||||
{{ $res := resources.Get "js/lib/aplayer/APlayer.min.js" | resources.Minify }}
|
||||
{{ $aplayer_js = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ end }}
|
||||
{{ $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 = .Site.Params.cdn.meting_js }}
|
||||
{{ else }}
|
||||
{{ $res := resources.Get "js/lib/meting/Meting.min.js" | resources.Minify }}
|
||||
{{ $meting = printf "<script src=\"%s\"></script>" $res.RelPermalink }}
|
||||
{{ end }}
|
||||
{{- /* Google analytics async */ -}}
|
||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.GoogleAnalytics -}}
|
||||
{{- template "_internal/google_analytics_async.html" . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ $jquery | safeHTML }}
|
||||
{{ $lazysizes | safeHTML }}
|
||||
{{ $smooth_scroll | safeHTML }}
|
||||
{{- /* jQuery https://github.com/jquery/jquery */ -}}
|
||||
{{- $jquery := "" -}}
|
||||
{{- 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.slim.min.js" -}}
|
||||
{{- $jquery = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- $jquery | safeHTML -}}
|
||||
|
||||
{{ if .IsPage }}
|
||||
{{/* dev feature */}}
|
||||
{{ if .Params.dev }}
|
||||
{{ with .Scratch.Get "echartsMap" }}
|
||||
{{ $echarts | safeHTML }}
|
||||
<script>window.echartsMap = {
|
||||
{{ range $key, $var := . }}
|
||||
{{ $key }}: {{ $var | safeJS }},
|
||||
{{ end }}
|
||||
};window.echartsArr=[];</script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{/* dev feature */}}
|
||||
{{- /* lazysizes https://github.com/aFarkas/lazysizes */ -}}
|
||||
{{- $lazysizes := "" -}}
|
||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.lazysizes_js -}}
|
||||
{{- $lazysizes = .Site.Params.cdn.lazysizes_js -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "js/lib/lazysizes/lazysizes.min.js" -}}
|
||||
{{- $lazysizes = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- $lazysizes | safeHTML -}}
|
||||
|
||||
{{ with .Scratch.Get "mermaidMap" }}
|
||||
{{ $mermaid | safeHTML }}
|
||||
<script>window.mermaidMap = {{ . | jsonify | safeJS }};</script>
|
||||
{{ 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" -}}
|
||||
{{- $smooth_scroll = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- $smooth_scroll = delimit (slice $smooth_scroll "<script>window.scroll = new SmoothScroll('[data-scroll]', {speed: 300, speedAsDuration: true});</script>") "" -}}
|
||||
{{- $smooth_scroll | safeHTML -}}
|
||||
|
||||
{{ if or .Params.math .Site.Params.math }}
|
||||
{{ $katex | safeHTML }}
|
||||
{{ end }}
|
||||
{{- /* TypeIt https://github.com/alexmacarthur/typeit */ -}}
|
||||
{{- with .Scratch.Get "typeitMap" -}}
|
||||
{{- $typeit := "" -}}
|
||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.typeit_js -}}
|
||||
{{- $typeit = .Site.Params.cdn.typeit_js -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "js/lib/typeit/typeit.min.js" -}}
|
||||
{{- $typeit = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- $typeit | safeHTML -}}
|
||||
{{- $typeitArr := slice -}}
|
||||
{{- range $key, $val := . -}}
|
||||
{{- $typeitArr = $typeitArr | append (slice $val) -}}
|
||||
{{- end -}}
|
||||
<script>
|
||||
{{- printf "window.typeitArr=%s;" (jsonify $typeitArr) | safeJS -}}
|
||||
</script>
|
||||
{{- end -}}
|
||||
|
||||
{{ if .Scratch.Get "music" }}
|
||||
{{ $aplayer | safeHTML }}
|
||||
{{ $meting | safeHTML }}
|
||||
{{ end }}
|
||||
{{- /* KaTeX https://github.com/KaTeX/KaTeX */ -}}
|
||||
{{- if .Site.Params.math.enable | and (ne .Params.math false) -}}
|
||||
{{- $math := .Site.Params.math -}}
|
||||
{{- $katex_css := "" -}}
|
||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_css -}}
|
||||
{{- $katex_css = .Site.Params.cdn.katex_css -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "css/lib/katex/katex.min.css" -}}
|
||||
{{- $katex_css = printf "<link rel=\"stylesheet\" href=\"%s\">" $res.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- $katex_js := "" -}}
|
||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_js -}}
|
||||
{{- $katex_js = .Site.Params.cdn.katex_js -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "js/lib/katex/katex.min.js" -}}
|
||||
{{- $katex_js = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- $katex_auto_render_js := "" -}}
|
||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_auto_render_js -}}
|
||||
{{- $katex_auto_render_js = .Site.Params.cdn.katex_auto_render_js -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "js/lib/katex/auto-render.min.js" -}}
|
||||
{{- $katex_auto_render_js = printf "<script defer src=\"%s\"></script>" $res.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- $katex := delimit (slice $katex_css $katex_js $katex_auto_render_js) "" -}}
|
||||
{{- if $math.copy_tex -}}
|
||||
{{- $katex_copy_tex_css := "" -}}
|
||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_copy_tex_css -}}
|
||||
{{- $katex_copy_tex_css = .Site.Params.cdn.katex_copy_tex_css -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "css/lib/katex/copy-tex.min.css" -}}
|
||||
{{- $katex_copy_tex_css = printf "<link rel=\"stylesheet\" href=\"%s\">" $res.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- $katex_copy_tex_js := "" -}}
|
||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_copy_tex_js -}}
|
||||
{{- $katex_copy_tex_js = .Site.Params.cdn.katex_copy_tex_js -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "js/lib/katex/copy-tex.min.js" -}}
|
||||
{{- $katex_copy_tex_js = printf "<script defer src=\"%s\"></script>" $res.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- $katex = delimit (slice $katex $katex_copy_tex_css $katex_copy_tex_js) "" -}}
|
||||
{{- end -}}
|
||||
{{- if $math.mhchem -}}
|
||||
{{- $katex_mhchem_js := "" -}}
|
||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_mhchem_js -}}
|
||||
{{- $katex_mhchem_js = .Site.Params.cdn.katex_mhchem_js -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "js/lib/katex/mhchem.min.js" -}}
|
||||
{{- $katex_mhchem_js = printf "<script defer src=\"%s\"></script>" $res.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- $katex = delimit (slice $katex $katex_mhchem_js) "" -}}
|
||||
{{- end -}}
|
||||
{{- $katex | safeHTML -}}
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
renderMathInElement(document.body, {
|
||||
delimiters: [
|
||||
{ left: "$$", right: "$$", display: true },
|
||||
{ left: "\\(", right: "\\)", display: false },
|
||||
{ left: "\\[", right: "\\]", display: true },
|
||||
{{- if and $math.block_left_delimiter $math.block_right_delimiter -}}
|
||||
{ left: "{{ $math.block_left_delimiter }}", right: "{{ $math.block_right_delimiter }}", display: true },
|
||||
{{- end -}}
|
||||
{{- if and $math.inline_left_delimiter $math.inline_right_delimiter -}}
|
||||
{ left: "{{ $math.inline_left_delimiter }}", right: "{{ $math.inline_right_delimiter }}", display: false },
|
||||
{{- end -}}
|
||||
]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{{- end -}}
|
||||
|
||||
{{ with .Scratch.Get "countdownMap" }}
|
||||
{{ $countdown | safeHTML }}
|
||||
<script>window.countdownMap = {{ . | jsonify | safeJS }};</script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- /* mermaid https://github.com/knsv/mermaid */ -}}
|
||||
{{- with .Scratch.Get "mermaidMap" -}}
|
||||
{{- $mermaid := "" -}}
|
||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.mermaid_js -}}
|
||||
{{- $mermaid = .Site.Params.cdn.mermaid_js -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "js/lib/mermaid/mermaid.min.js" -}}
|
||||
{{- $mermaid = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- $mermaidInit := "<script>mermaid.initialize({startOnLoad: false, theme: null});</script>" -}}
|
||||
{{- $mermaid = delimit (slice $mermaid $mermaidInit) "" -}}
|
||||
{{- $mermaid | safeHTML -}}
|
||||
<script>
|
||||
{{- printf "window.mermaidMap=%s;" (jsonify .) | safeJS -}}
|
||||
</script>
|
||||
{{- end -}}
|
||||
|
||||
{{ $typeitMap := .Scratch.Get "typeitMap" }}
|
||||
{{ if $typeitMap }}
|
||||
{{ $typeit | safeHTML }}
|
||||
{{ $typeitArr := slice }}
|
||||
{{ range $key, $val := $typeitMap }}
|
||||
{{ $typeitArr = $typeitArr | append (slice $val) }}
|
||||
{{ end }}
|
||||
<script>window.typeitArr = {{ $typeitArr | jsonify | safeJS }};</script>
|
||||
{{ end }}
|
||||
{{- /* Music */ -}}
|
||||
{{- if .Scratch.Get "music" -}}
|
||||
{{- /* 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 -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "css/lib/aplayer/APlayer.min.css" -}}
|
||||
{{- $aplayer_css = printf "<link rel=\"stylesheet\" href=\"%s\">" $res.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- $aplayer_js := "" -}}
|
||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.aplayer_js -}}
|
||||
{{- $aplayer_js = .Site.Params.cdn.aplayer_js -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "js/lib/aplayer/APlayer.min.js" -}}
|
||||
{{- $aplayer_js = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- $aplayer := delimit (slice $aplayer_css $aplayer_js) "" -}}
|
||||
{{- $aplayer | safeHTML -}}
|
||||
|
||||
{{ $res := resources.Get "/js/blog.js" | resources.Minify }}
|
||||
<script src="{{ $res.RelPermalink }}"></script>
|
||||
{{- /* MetingJS https://github.com/metowolf/MetingJS */ -}}
|
||||
{{- $meting := "" -}}
|
||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.meting_js -}}
|
||||
{{- $meting = .Site.Params.cdn.meting_js -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "js/lib/meting/Meting.min.js" -}}
|
||||
{{- $meting = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- $meting | safeHTML -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ if not .Site.IsServer }}
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
{{ end }}
|
||||
{{- /* jQuery.countdown https://github.com/hilios/jQuery.countdown */ -}}
|
||||
{{- with .Scratch.Get "countdownMap" -}}
|
||||
{{- $countdown := "" -}}
|
||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.jquery_countdown_js -}}
|
||||
{{- $countdown = .Site.Params.cdn.jquery_countdown_js -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "js/lib/jquery-countdown/jquery.countdown.min.js" -}}
|
||||
{{- $countdown = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- $countdown | safeHTML -}}
|
||||
<script>
|
||||
{{- printf "window.countdownMap=%s;" (jsonify .) | safeJS -}}
|
||||
</script>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* dev feature */ -}}
|
||||
{{- if .Params.dev -}}
|
||||
{{- /* ECharts https://github.com/apache/incubator-echarts */ -}}
|
||||
{{- with .Scratch.Get "echartsMap" -}}
|
||||
{{- $echarts_js := "" -}}
|
||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.echarts_js -}}
|
||||
{{- $echarts_js = .Site.Params.cdn.echarts_js -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "js/lib/echarts/echarts.min.js" -}}
|
||||
{{- $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" | minify -}}
|
||||
{{- $echarts_macarons_js = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- $echarts := delimit (slice $echarts_js $echarts_macarons_js) "" -}}
|
||||
{{- $echarts | safeHTML -}}
|
||||
<script>
|
||||
window.echartsMap = {
|
||||
{{- range $key, $var := . -}}
|
||||
{{- $key }}: {{ $var | safeJS -}},
|
||||
{{- end -}}
|
||||
};
|
||||
window.echartsArr = [];
|
||||
</script>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Blog script */ -}}
|
||||
{{- $res := resources.Get "/js/blog.js" | minify -}}
|
||||
<script src="{{ $res.RelPermalink }}"></script>
|
||||
@@ -1,91 +1,94 @@
|
||||
{{ if .IsHome -}}
|
||||
{{- /* Home SEO */ -}}
|
||||
{{- if .IsHome -}}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "WebSite",
|
||||
"url": "{{ .Site.BaseURL }}",
|
||||
{{ with .Site.Author.name }}
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "{{ . }}"
|
||||
},
|
||||
{{ end }}
|
||||
{{ with .Site.Params.description }}
|
||||
"description": "{{ . }}",
|
||||
{{ end }}
|
||||
{{ with .Site.Params.image }}
|
||||
"image": "{{ .url | absURL }}",
|
||||
{{ end }}
|
||||
{{ with .Site.Params.logo }}
|
||||
"thumbnailUrl": "{{ .url | absURL }}",
|
||||
{{ end }}
|
||||
{{ with .Site.Copyright }}
|
||||
"license": "{{ . }}",
|
||||
{{ end }}
|
||||
"name": "{{ .Site.Title }}"
|
||||
"@context": "http://schema.org",
|
||||
"@type": "WebSite",
|
||||
"url": "{{ .Site.BaseURL }}",
|
||||
{{- with .Site.Author.name -}}
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "{{ . }}"
|
||||
},
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.description -}}
|
||||
"description": "{{ . }}",
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.image -}}
|
||||
"image": "{{ .url | absURL }}",
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.logo -}}
|
||||
"thumbnailUrl": "{{ .url | absURL }}",
|
||||
{{- end -}}
|
||||
{{- with .Site.Copyright -}}
|
||||
"license": "{{ . }}",
|
||||
{{- end -}}
|
||||
"name": "{{ .Site.Title }}"
|
||||
}
|
||||
</script>
|
||||
{{ else if .IsPage -}}
|
||||
|
||||
{{- /* Page SEO */ -}}
|
||||
{{- else if .IsPage -}}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "BlogPosting",
|
||||
"headline": "{{ .Title }}",
|
||||
"mainEntityOfPage": {
|
||||
"@type": "WebPage",
|
||||
"@id": "{{ .Permalink }}"
|
||||
},
|
||||
{{ if ge (.Param "lua.image.width") 696 }}
|
||||
"image": {
|
||||
"@type": "ImageObject",
|
||||
"url": "{{ .Param "lua.image.url" | absURL }}",
|
||||
"width": {{ .Param "lua.image.width" }},
|
||||
"height": {{ .Param "lua.image.height" }}
|
||||
"@context": "http://schema.org",
|
||||
"@type": "BlogPosting",
|
||||
"headline": "{{ .Title }}",
|
||||
"mainEntityOfPage": {
|
||||
"@type": "WebPage",
|
||||
"@id": "{{ .Permalink }}"
|
||||
},
|
||||
{{ else if ge .Site.Params.image.width 696 }}
|
||||
"image": {
|
||||
"@type": "ImageObject",
|
||||
"url": "{{ .Site.Params.image.url | absURL }}",
|
||||
"width": {{ .Site.Params.image.width }},
|
||||
"height": {{ .Site.Params.image.height }}
|
||||
},
|
||||
{{ end }}
|
||||
"genre": "{{ .Type }}",
|
||||
{{ with .Params.tags }}
|
||||
"keywords": "{{ delimit . ", " }}",
|
||||
{{ end }}
|
||||
"wordcount": {{ .WordCount }},
|
||||
"url": "{{ .Permalink }}",
|
||||
{{ if not .PublishDate.IsZero }}
|
||||
"datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTML }}",
|
||||
{{ else if not .Date.IsZero }}
|
||||
"datePublished": "{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}",
|
||||
{{ end }}
|
||||
{{ with .Lastmod }}
|
||||
"dateModified": "{{ .Format "2006-01-02T15:04:05-07:00" | safeHTML }}",
|
||||
{{ end }}
|
||||
{{ with .Site.Copyright }}
|
||||
"license": "{{ . }}",
|
||||
{{ end }}
|
||||
{{ with .Site.Params.publisher }}
|
||||
"publisher": {
|
||||
"@type": "Organization",
|
||||
"name": "{{ .name }}",
|
||||
"logo": {
|
||||
"@type": "ImageObject",
|
||||
"url": "{{ .logo.url | absURL }}",
|
||||
"width": {{ .logo.width }},
|
||||
"height": {{ .logo.height }}
|
||||
}
|
||||
},
|
||||
{{ end }}
|
||||
{{ with .Site.Author.Name }}
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "{{ . }}"
|
||||
},
|
||||
{{ end }}
|
||||
"description": "{{ .Description }}"
|
||||
{{- if ge (.Param "lua.image.width") 696 -}}
|
||||
"image": {
|
||||
"@type": "ImageObject",
|
||||
"url": "{{ .Param "lua.image.url" | absURL }}",
|
||||
"width": {{ .Param "lua.image.width" }},
|
||||
"height": {{ .Param "lua.image.height" }}
|
||||
},
|
||||
{{- else if ge .Site.Params.image.width 696 -}}
|
||||
"image": {
|
||||
"@type": "ImageObject",
|
||||
"url": "{{ .Site.Params.image.url | absURL }}",
|
||||
"width": {{ .Site.Params.image.width }},
|
||||
"height": {{ .Site.Params.image.height }}
|
||||
},
|
||||
{{- end -}}
|
||||
"genre": "{{ .Type }}",
|
||||
{{- with .Params.tags -}}
|
||||
"keywords": "{{ delimit . ", " }}",
|
||||
{{- end -}}
|
||||
"wordcount": {{ .WordCount }},
|
||||
"url": "{{ .Permalink }}",
|
||||
{{- if not .PublishDate.IsZero -}}
|
||||
"datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTML }}",
|
||||
{{- else if not .Date.IsZero -}}
|
||||
"datePublished": "{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}",
|
||||
{{- end -}}
|
||||
{{- with .Lastmod -}}
|
||||
"dateModified": "{{ .Format "2006-01-02T15:04:05-07:00" | safeHTML }}",
|
||||
{{- end -}}
|
||||
{{- with .Site.Copyright -}}
|
||||
"license": "{{ . }}",
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.publisher -}}
|
||||
"publisher": {
|
||||
"@type": "Organization",
|
||||
"name": "{{ .name }}",
|
||||
"logo": {
|
||||
"@type": "ImageObject",
|
||||
"url": "{{ .logo.url | absURL }}",
|
||||
"width": {{ .logo.width }},
|
||||
"height": {{ .logo.height }}
|
||||
}
|
||||
},
|
||||
{{- end -}}
|
||||
{{- with .Site.Author.Name -}}
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "{{ . }}"
|
||||
},
|
||||
{{- end -}}
|
||||
"description": "{{ .Description }}"
|
||||
}
|
||||
</script>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
@@ -1,31 +1,32 @@
|
||||
{{ define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end }}
|
||||
{{- define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end -}}
|
||||
|
||||
{{ define "content" }}
|
||||
{{ $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}
|
||||
{{ $author := .Site.Author.name }}
|
||||
{{ if isset .Params "author" }}
|
||||
{{ $author = .Site.Author.name }}
|
||||
{{ end }}
|
||||
|
||||
<article class="post-warp">
|
||||
{{- define "content" -}}
|
||||
<article class="page">
|
||||
{{- /* Title */ -}}
|
||||
<h1 class="post-title animated flipInX">{{ .Title }}</h1>
|
||||
|
||||
{{- /* Meta */ -}}
|
||||
<div class="post-meta">
|
||||
<div class="post-meta-main">
|
||||
<a class="author" href="{{.Site.BaseURL }}" rel="author"><i class="fas fa-user-circle fa-fw"></i>{{ $author }} </a>
|
||||
{{ with .Params.categories -}}
|
||||
{{- $author := .Params.author | default .Site.Author.name -}}
|
||||
{{- $author_link := .Params.author_link | default .Site.Author.link | default .Site.BaseURL -}}
|
||||
<a class="author" href="{{ $author_link }}" rel="author" target="_blank">
|
||||
<i class="fas fa-user-circle fa-fw"></i>{{ $author }}
|
||||
</a>
|
||||
{{- with .Params.categories -}}
|
||||
<span class="post-category">
|
||||
{{ T "included" }}
|
||||
{{ range . }}
|
||||
{{- T "included" -}}
|
||||
{{- range . -}}
|
||||
{{- $name := . -}}
|
||||
{{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}}
|
||||
<i class="far fa-folder fa-fw"></i><a href="{{ .Permalink }}">{{ $name }}</a>
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
<i class="far fa-folder fa-fw"></i><a href="{{ .Permalink }}">{{ $name | humanize }}</a>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</span>
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
</div>
|
||||
<div class="post-meta-other">
|
||||
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
|
||||
<i class="far fa-calendar-alt fa-fw"></i><time datetime={{ $publish_date }}>{{ $publish_date }}</time>
|
||||
<i class="fas fa-pencil-alt fa-fw"></i>{{ T "wordCount" .WordCount }}
|
||||
<i class="far fa-clock fa-fw"></i>{{ T "readingTime" .ReadingTime }}
|
||||
@@ -37,67 +38,52 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ with .Params.featured_image }}
|
||||
{{- /* Featured image */ -}}
|
||||
{{- with .Params.featured_image -}}
|
||||
<div class="post-featured-image">
|
||||
<img src=/images/loading.svg data-sizes=auto data-src={{ . }} alt="featured image" class="lazyload">
|
||||
{{- partial "image" . -}}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{ if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}}
|
||||
{{- /* TOC */ -}}
|
||||
{{- if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}}
|
||||
<div class="post-toc" id="post-toc">
|
||||
<h2 class="post-toc-title">{{ T "toc" }}</h2>
|
||||
{{- $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default true }}
|
||||
<div class="post-toc-content{{ if not (and $globalAutoCollapseToc (ne .Params.autoCollapseToc false)) }} always-active{{ end }}">
|
||||
{{ .TableOfContents }}
|
||||
{{- $globalAutoCollapseToc := .Site.Params.auto_collapse_toc | default true }}
|
||||
<div class="post-toc-content{{ if not (and $globalAutoCollapseToc (ne .Params.auto_collapse_toc false)) }} always-active{{ end }}">
|
||||
{{- .TableOfContents -}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="post-toc-mobile" id="post-toc-mobile">
|
||||
<details>
|
||||
<summary><div class="post-toc-title"><span>{{ T "toc" }}</span><span><i class="details icon fas fa-angle-down"></i></span></div></summary>
|
||||
<summary>
|
||||
<div class="post-toc-title">
|
||||
<span>{{ T "toc" }}</span>
|
||||
<span><i class="details icon fas fa-angle-down"></i></span>
|
||||
</div>
|
||||
</summary>
|
||||
<div class="post-toc-content">
|
||||
{{ $toc := .TableOfContents }}
|
||||
{{ $toc = replaceRE `id="TableOfContents"` `id="TableOfContentsMobile"` $toc }}
|
||||
{{ $toc | safeHTML }}
|
||||
{{- $toc := .TableOfContents -}}
|
||||
{{- $toc = replaceRE `id="TableOfContents"` `id="TableOfContentsMobile"` $toc -}}
|
||||
{{- $toc | safeHTML -}}
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Content */ -}}
|
||||
<div class="post-content">
|
||||
{{ $content := .Content }}
|
||||
{{ $REin := `<img src="([^"]+)" alt="([^"]+)?" />` }}
|
||||
{{ $REout := "<figure><img src=/images/loading.svg data-sizes=auto data-src=$1 alt=$2 class=lazyload><figcaption class=image-caption>$2</figcaption></figure>" }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<img src="([^"]+)" alt="([^"]+)?" title="([^"]+)?" />` }}
|
||||
{{ $REout = "<figure><img src=/images/loading.svg data-src=$1 data-sizes=auto alt=$2 title=$3 class=lazyload><figcaption class=image-caption>$2</figcaption></figure>" }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `:\(([\w- ]+?)\):` }}
|
||||
{{ $REout = `<i class="$1 fa-fw"></i>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `\[(.+?)\]\^\((.+?)\)` }}
|
||||
{{ $REout = `<strong><ruby>$1<rt>$2</rt></ruby></strong>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<sup>\[return\]</sup>` }}
|
||||
{{ $REout = printf "<sup>[%s]</sup>" (T "return") }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<(h[123456]) (id=".+?")>` }}
|
||||
{{ $REout = `<a class="post-dummy-target" $2></a><$1>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<(sup class="footnote-ref") (id="fnref:.+?")>` }}
|
||||
{{ $REout = `<a class="post-dummy-target" $2></a><$1>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<(li) (id="fn:.+?")>` }}
|
||||
{{ $REout = `<$1><a class="post-dummy-target" $2></a>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $content | safeHTML }}
|
||||
{{- partial "hook/content.html" .Content | safeHTML -}}
|
||||
</div>
|
||||
|
||||
{{ partial "post/footer.html" . }}
|
||||
{{- /* Footer */ -}}
|
||||
{{- partial "post/footer.html" . -}}
|
||||
|
||||
{{- /* Comment */ -}}
|
||||
<div class="post-comment">
|
||||
{{ if ( .Params.comment | default true ) }}
|
||||
{{ partial "comments.html" . }}
|
||||
{{ end }}
|
||||
{{- if ( .Params.comment | default true ) -}}
|
||||
{{- partial "comments.html" . -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
</article>
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
@@ -1,34 +1,62 @@
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<description>Recent content {{ with .Title }}in {{ . }} {{ end }}on {{ .Site.Title }}</description>
|
||||
<title>
|
||||
{{- with .Title }}{{ . }} | {{ end }}{{ .Site.Title -}}
|
||||
</title>
|
||||
<link>
|
||||
{{- .Permalink -}}
|
||||
</link>
|
||||
<description>
|
||||
{{- with .Title }}{{ . }} | {{ end }}{{ .Site.Title -}}
|
||||
</description>
|
||||
<generator>Hugo -- gohugo.io</generator>
|
||||
{{ with .Site.LanguageCode }}
|
||||
<language>{{ . }}</language>
|
||||
{{ end }}
|
||||
{{ with .Site.Author.email }}
|
||||
<managingEditor>{{ . }}{{ with .Site.Author.name }} ({{ . }}){{ end }}</managingEditor>
|
||||
<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 .Site.LanguageCode -}}
|
||||
<language>
|
||||
{{- . -}}
|
||||
</language>
|
||||
{{- end -}}
|
||||
{{- with .Site.Author.email -}}
|
||||
<managingEditor>
|
||||
{{- . }}{{ with .Site.Author.name }} ({{ . }}){{ end -}}
|
||||
</managingEditor>
|
||||
<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 -}}
|
||||
<atom:link href="{{.Permalink}}" rel="self" type="application/rss+xml" />
|
||||
{{ range first 15 (where .Data.Pages "Type" "!=" "home") }}
|
||||
{{- range first 15 (where .Data.Pages "Type" "!=" "home") -}}
|
||||
<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 }}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>{{ .Content | html }}</description>
|
||||
<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 -}}
|
||||
<guid>
|
||||
{{- .Permalink -}}
|
||||
</guid>
|
||||
<description>
|
||||
{{- .Content | html -}}
|
||||
</description>
|
||||
</item>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
</channel>
|
||||
</rss>
|
||||
</rss>
|
||||
@@ -1,42 +1,54 @@
|
||||
{{ $_hugo_config := `{ "version": 1 }` -}}
|
||||
{{ $iconMap := dict "note" "fas fa-pencil-alt" -}}
|
||||
{{ $iconMap = dict "abstract" "fas fa-list-ul" | merge $iconMap -}}
|
||||
{{ $iconMap = dict "info" "fas fa-info-circle" | merge $iconMap -}}
|
||||
{{ $iconMap = dict "tip" "fas fa-lightbulb" | merge $iconMap -}}
|
||||
{{ $iconMap = dict "success" "fas fa-check-circle" | merge $iconMap -}}
|
||||
{{ $iconMap = dict "question" "fas fa-question-circle" | merge $iconMap -}}
|
||||
{{ $iconMap = dict "warning" "fas fa-exclamation-triangle" | merge $iconMap -}}
|
||||
{{ $iconMap = dict "failure" "fas fa-times-circle" | merge $iconMap -}}
|
||||
{{ $iconMap = dict "danger" "fas fa-skull-crossbones" | merge $iconMap -}}
|
||||
{{ $iconMap = dict "bug" "fas fa-bug" | merge $iconMap -}}
|
||||
{{ $iconMap = dict "example" "fas fa-list-ol" | merge $iconMap -}}
|
||||
{{ $iconMap = dict "quote" "fas fa-quote-right" | merge $iconMap -}}
|
||||
{{ $iconMap = dict "details" "fas fa-angle-down" | merge $iconMap -}}
|
||||
{{- $_hugo_config := `{ "version": 1 }` -}}
|
||||
{{- $iconMap := dict "note" "fas fa-pencil-alt" -}}
|
||||
{{- $iconMap = dict "abstract" "fas fa-list-ul" | merge $iconMap -}}
|
||||
{{- $iconMap = dict "info" "fas fa-info-circle" | merge $iconMap -}}
|
||||
{{- $iconMap = dict "tip" "fas fa-lightbulb" | merge $iconMap -}}
|
||||
{{- $iconMap = dict "success" "fas fa-check-circle" | merge $iconMap -}}
|
||||
{{- $iconMap = dict "question" "fas fa-question-circle" | merge $iconMap -}}
|
||||
{{- $iconMap = dict "warning" "fas fa-exclamation-triangle" | merge $iconMap -}}
|
||||
{{- $iconMap = dict "failure" "fas fa-times-circle" | merge $iconMap -}}
|
||||
{{- $iconMap = dict "danger" "fas fa-skull-crossbones" | merge $iconMap -}}
|
||||
{{- $iconMap = dict "bug" "fas fa-bug" | merge $iconMap -}}
|
||||
{{- $iconMap = dict "example" "fas fa-list-ol" | merge $iconMap -}}
|
||||
{{- $iconMap = dict "quote" "fas fa-quote-right" | merge $iconMap -}}
|
||||
{{- $iconDetails := "fas fa-angle-down" -}}
|
||||
|
||||
{{ if .IsNamedParams -}}
|
||||
{{ $type := .Get "type" }}
|
||||
{{ if eq (.Get "details") "true" -}}
|
||||
{{- if .IsNamedParams -}}
|
||||
{{- $type := .Get "type" | default "note" -}}
|
||||
{{- if eq (.Get "details") "true" -}}
|
||||
<details class="admonition {{ $type }}">
|
||||
{{- with .Get "title" }}<summary class="admonition-title"><i class="icon {{ index $iconMap $type }}"></i>{{ . }}<i class="details {{ index $iconMap "details" }}"></i></summary>{{ end }}
|
||||
{{- with .Get "title" -}}
|
||||
<summary class="admonition-title">
|
||||
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ . }}<i class="details {{ $iconDetails }}"></i>
|
||||
</summary>
|
||||
{{- end -}}
|
||||
{{- .Inner -}}
|
||||
</details>
|
||||
{{- else -}}
|
||||
<div class="admonition {{ $type }}">
|
||||
{{- with .Get "title" }}<p class="admonition-title"><i class="icon {{ index $iconMap $type }}"></i>{{ . }}</p>{{ end }}
|
||||
{{- with .Get "title" -}}
|
||||
<p class="admonition-title"><i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ . }}</p>
|
||||
{{- end -}}
|
||||
{{- .Inner -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{ else -}}
|
||||
{{ $type := .Get 0 }}
|
||||
{{ if eq (.Get 2) "true" }}
|
||||
{{- else -}}
|
||||
{{- $type := .Get 0 -}}
|
||||
{{- if eq (.Get 2) "true" -}}
|
||||
<details class="admonition {{ $type }}">
|
||||
{{- with .Get 1 }}<summary class="admonition-title"><i class="icon {{ index $iconMap $type }}"></i>{{ . }}<i class="details {{ index $iconMap "details" }}"></i></summary>{{ end }}
|
||||
{{- with .Get 1 -}}
|
||||
<summary class="admonition-title">
|
||||
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ . }}<i class="details {{ $iconDetails }}"></i>
|
||||
</summary>
|
||||
{{- end -}}
|
||||
{{- .Inner -}}
|
||||
</details>
|
||||
{{- else -}}
|
||||
<div class="admonition {{ $type }}">
|
||||
{{- with .Get 1 }}<p class="admonition-title"><i class="icon {{ index $iconMap $type }}"></i>{{ . }}</p>{{ end }}
|
||||
{{- with .Get 1 -}}
|
||||
<p class="admonition-title"><i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ . }}</p>
|
||||
{{- end -}}
|
||||
{{- .Inner -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
@@ -1,12 +1,12 @@
|
||||
{{ if .Get "date" -}}
|
||||
{{ $date := .Get "date" }}
|
||||
{{ $id := delimit (split (md5 $date) "" | shuffle) "" | printf "countdown-%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 -}}
|
||||
{{- if .Get "date" -}}
|
||||
{{- $date := .Get "date" -}}
|
||||
{{- $id := delimit (split (md5 $date) "" | shuffle) "" | printf "countdown-%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 -}}
|
||||
<div id="{{ $id }}" style={{ .Get "style" | safeCSS }}></div>
|
||||
{{ end -}}
|
||||
{{- end -}}
|
||||
@@ -1,10 +1,10 @@
|
||||
<!-- shuffle md5 as id -->
|
||||
{{ $id := delimit (split (md5 .Inner) "" | shuffle) "" | printf "echarts-%s" -}}
|
||||
{{ $echartsMap := .Page.Scratch.Get "echartsMap" -}}
|
||||
{{ if $echartsMap -}}
|
||||
{{- $id := delimit (split (md5 .Inner) "" | shuffle) "" | printf "echarts-%s" -}}
|
||||
{{- $echartsMap := .Page.Scratch.Get "echartsMap" -}}
|
||||
{{- if $echartsMap -}}
|
||||
{{ $echartsMap = .Inner | printf "{%s}" | dict $id | merge $echartsMap -}}
|
||||
{{ else -}}
|
||||
{{- else -}}
|
||||
{{ $echartsMap = .Inner | printf "{%s}" | dict $id -}}
|
||||
{{ end -}}
|
||||
{{ .Page.Scratch.Set "echartsMap" $echartsMap -}}
|
||||
{{- end -}}
|
||||
{{- .Page.Scratch.Set "echartsMap" $echartsMap -}}
|
||||
<div class="echarts" id="{{ $id }}"></div>
|
||||
@@ -1,10 +1,10 @@
|
||||
<!-- shuffle md5 as id -->
|
||||
{{ $id := delimit (split (md5 .Inner) "" | shuffle) "" | printf "mermaid-%s" -}}
|
||||
{{ $mermaidMap := .Page.Scratch.Get "mermaidMap" -}}
|
||||
{{ if $mermaidMap -}}
|
||||
{{ $mermaidMap = trim .Inner "\n" | dict $id | merge $mermaidMap -}}
|
||||
{{ else -}}
|
||||
{{ $mermaidMap = trim .Inner "\n" | dict $id -}}
|
||||
{{ end -}}
|
||||
{{ .Page.Scratch.Set "mermaidMap" $mermaidMap -}}
|
||||
{{- $id := delimit (split (md5 .Inner) "" | shuffle) "" | printf "mermaid-%s" -}}
|
||||
{{- $mermaidMap := .Page.Scratch.Get "mermaidMap" -}}
|
||||
{{- if $mermaidMap -}}
|
||||
{{- $mermaidMap = trim .Inner "\n" | dict $id | merge $mermaidMap -}}
|
||||
{{- else -}}
|
||||
{{- $mermaidMap = trim .Inner "\n" | dict $id -}}
|
||||
{{- end -}}
|
||||
{{- .Page.Scratch.Set "mermaidMap" $mermaidMap -}}
|
||||
<div class="mermaid" id="{{ $id }}"></div>
|
||||
@@ -1,22 +1,12 @@
|
||||
{{ .Page.Scratch.Set "music" "true" -}}
|
||||
{{ if .IsNamedParams }}
|
||||
<meting-js server={{ .Get "server" }} type={{ .Get "type" }} id={{ .Get "id" }}
|
||||
{{ with .Get "autoplay" }}
|
||||
autoplay={{ . }}
|
||||
{{ end }}
|
||||
{{ with .Get "mini" }}
|
||||
mini={{ . }}
|
||||
{{ end }}
|
||||
{{ with .Get "fixed" }}
|
||||
fixed={{ . }}
|
||||
{{ end }}
|
||||
{{ with .Get "list-folded" }}
|
||||
list-folded={{ . }}
|
||||
{{ end }}
|
||||
{{ with .Get "list-max-height" }}
|
||||
list-max-height={{ . }}
|
||||
{{ end }}
|
||||
theme="#A9A9B3"></meting-js>
|
||||
{{ else }}
|
||||
<meting-js server={{ .Get 0 }} type={{ .Get 1 }} id={{ .Get 2 }} theme="#A9A9B3"></meting-js>></meting-js>
|
||||
{{ end }}
|
||||
{{- .Page.Scratch.Set "music" "true" -}}
|
||||
{{- if .IsNamedParams -}}
|
||||
<meting-js server="{{ .Get "server" }}" type="{{ .Get "type" }}" id="{{ .Get "id" }}" theme="#A9A9B3"
|
||||
{{- with .Get "autoplay" }} autoplay="{{ . }}"{{ end -}}
|
||||
{{- with .Get "mini" }} mini="{{ . }}"{{ end -}}
|
||||
{{- with .Get "fixed" }} fixed="{{ . }}"{{ end -}}
|
||||
{{- with .Get "list-folded" }} list-folded="{{ . }}"{{ end -}}
|
||||
{{- with .Get "list-max-height" }} list-max-height="{{ . }}"{{ end -}}
|
||||
></meting-js>
|
||||
{{- else -}}
|
||||
<meting-js server="{{ .Get 0 }}" type="{{ .Get 1 }}" id="{{ .Get 2 }}" theme="#A9A9B3"></meting-js>
|
||||
{{- end -}}
|
||||
@@ -1,50 +1,56 @@
|
||||
<!-- only the trailing newline is retained -->
|
||||
{{ $content := replaceRE `(?s)^\n*(.*?)\n*$` "$1\n" .Inner }}
|
||||
{{- $content := replaceRE `(?s)^\n*(.*?)\n*$` "$1\n" .Inner -}}
|
||||
<!-- shuffle md5 as id -->
|
||||
{{ $id := delimit (split (md5 $content) "" | shuffle) "" | printf "typeit-%s" }}
|
||||
{{- $id := delimit (split (md5 $content) "" | shuffle) "" | printf "typeit-%s" -}}
|
||||
|
||||
<div class={{ .Get "class" | default "typeit" }}>
|
||||
<!-- raw html content -->
|
||||
{{ if .Get "raw" }}
|
||||
<div id={{ printf "r%s" $id }} hidden=true>{{ $content | safeHTML }}</div>
|
||||
{{- if .Get "raw" -}}
|
||||
<div id={{ printf "r%s" $id }} hidden=true>
|
||||
{{- $content | safeHTML -}}
|
||||
</div>
|
||||
<div id={{ $id }}></div>
|
||||
{{ else if .Get "code" }}
|
||||
{{- else if .Get "code" -}}
|
||||
<!-- highlight code content without line number -->
|
||||
{{ $content = highlight $content (.Get "code") "linenos=false" }}
|
||||
{{- $content = highlight $content (.Get "code") "linenos=false" -}}
|
||||
<!-- delete outer label -->
|
||||
{{ $content = replaceRE `<div class="highlight"><pre class="chroma"><code[^<>]*>(?s)(.*)</code></pre></div>` "$1" $content }}
|
||||
{{- $content = replaceRE `<div class="highlight"><pre class="chroma"><code[^<>]*>(?s)(.*)</code></pre></div>` "$1" $content -}}
|
||||
<!-- parsing markdown links -->
|
||||
{{ $content = replaceRE `(<span[^<>]*>)([^<>]*)\[([^<>]+)\]\(([^<>]+)\)([^<>]*)(</span>)` "$1$2$6<a href=$4>$3</a>$1$5$6" $content }}
|
||||
{{- $content = replaceRE `(<span[^<>]*>)([^<>]*)\[([^<>]+)\]\(([^<>]+)\)([^<>]*)(</span>)` "$1$2$6<a href=$4>$3</a>$1$5$6" $content -}}
|
||||
<!-- replace " " to " " and replace "\n" to "<br />" -->
|
||||
{{ $content = replaceRE ` ` " " $content | replaceRE `(<\w+) ` "$1 " | replaceRE `\n` "<br />" }}
|
||||
{{- $content = replaceRE ` ` " " $content | replaceRE `(<\w+) ` "$1 " | replaceRE `\n` "<br />" -}}
|
||||
<!-- fix "<br />" location error which is a bug of Typeit HTML parser -->
|
||||
{{ $content = replaceRE `<br /></span>` "</span><br />" $content }}
|
||||
<div id={{ printf "r%s" $id }} hidden=true>{{ $content | safeHTML }}</div>
|
||||
<div class="code" id={{ $id }}></div>
|
||||
{{ else }}
|
||||
{{ $tag := .Get "tag" | default "p" }}
|
||||
{{ $content = $content | markdownify | chomp }}
|
||||
<div id={{ printf "r%s" $id }} hidden=true>{{ $content | safeHTML }}</div>
|
||||
{{ printf "<%s id=%s></%s>" $tag $id $tag | safeHTML }}
|
||||
{{ end }}
|
||||
{{- $content = replaceRE `<br /></span>` "</span><br />" $content -}}
|
||||
<div id={{ printf "r%s" $id }} hidden=true>
|
||||
{{- $content | safeHTML -}}
|
||||
</div>
|
||||
<div class="highlight" id={{ $id }}></div>
|
||||
{{- else -}}
|
||||
{{- $tag := .Get "tag" | default "p" -}}
|
||||
{{- $content = $content | markdownify | chomp -}}
|
||||
<div id={{ printf "r%s" $id }} hidden=true>
|
||||
{{- $content | safeHTML -}}
|
||||
</div>
|
||||
{{- printf "<%s id=%s></%s>" $tag $id $tag | safeHTML -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ $typeitMap := .Page.Scratch.Get "typeitMap" }}
|
||||
{{ $group := slice $id }}
|
||||
{{ with .Get "group" }}
|
||||
{{ if $typeitMap }}
|
||||
{{ if index $typeitMap . }}
|
||||
{{ $group = index $typeitMap . | append $id }}
|
||||
{{ end }}
|
||||
{{ $typeitMap = dict . $group | merge $typeitMap }}
|
||||
{{ else }}
|
||||
{{ $typeitMap = dict . $group }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ if $typeitMap }}
|
||||
{{ $typeitMap = dict $id $group | merge $typeitMap }}
|
||||
{{ else }}
|
||||
{{ $typeitMap = dict $id $group }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ .Page.Scratch.Set "typeitMap" $typeitMap }}
|
||||
{{- $typeitMap := .Page.Scratch.Get "typeitMap" -}}
|
||||
{{- $group := slice $id -}}
|
||||
{{- with .Get "group" -}}
|
||||
{{- if $typeitMap -}}
|
||||
{{- if index $typeitMap . -}}
|
||||
{{- $group = index $typeitMap . | append $id -}}
|
||||
{{- end -}}
|
||||
{{- $typeitMap = dict . $group | merge $typeitMap -}}
|
||||
{{- else -}}
|
||||
{{- $typeitMap = dict . $group -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if $typeitMap -}}
|
||||
{{- $typeitMap = dict $id $group | merge $typeitMap -}}
|
||||
{{- else -}}
|
||||
{{- $typeitMap = dict $id $group -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- .Page.Scratch.Set "typeitMap" $typeitMap -}}
|
||||
</div>
|
||||
|
||||
@@ -1,22 +1,41 @@
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||
{{ range (where .Data.Pages "Section" "!=" "gallery") }}
|
||||
<urlset
|
||||
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||
>
|
||||
{{- range (where .Data.Pages "Section" "!=" "gallery") -}}
|
||||
<url>
|
||||
<loc>{{ .Permalink }}</loc>
|
||||
{{ if not .Lastmod.IsZero }}
|
||||
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>
|
||||
{{ end }}
|
||||
{{ with .Sitemap.ChangeFreq }}
|
||||
<changefreq>{{ . }}</changefreq>
|
||||
{{ end }}
|
||||
{{ if ge .Sitemap.Priority 0.0 }}
|
||||
<priority>{{ .Sitemap.Priority }}</priority>
|
||||
{{ end }}
|
||||
{{ if .IsTranslated }}
|
||||
{{ range .Translations }}
|
||||
<xhtml:link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}"/>
|
||||
{{ end }}
|
||||
<xhtml:link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}"/>
|
||||
{{ end }}
|
||||
<loc>
|
||||
{{- .Permalink -}}
|
||||
</loc>
|
||||
{{- if not .Lastmod.IsZero -}}
|
||||
<lastmod>
|
||||
{{- safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) -}}
|
||||
</lastmod>
|
||||
{{- end -}}
|
||||
{{- with .Sitemap.ChangeFreq -}}
|
||||
<changefreq>
|
||||
{{- . -}}
|
||||
</changefreq>
|
||||
{{- end -}}
|
||||
{{- if ge .Sitemap.Priority 0.0 -}}
|
||||
<priority>
|
||||
{{- .Sitemap.Priority -}}
|
||||
</priority>
|
||||
{{- end -}}
|
||||
{{- if .IsTranslated -}}
|
||||
{{- range .Translations -}}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Lang }}"
|
||||
href="{{ .Permalink }}"
|
||||
/>
|
||||
{{- end -}}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Lang }}"
|
||||
href="{{ .Permalink }}"
|
||||
/>
|
||||
{{- end -}}
|
||||
</url>
|
||||
{{ end }}
|
||||
</urlset>
|
||||
{{- end -}}
|
||||
</urlset>
|
||||
@@ -1,29 +1,35 @@
|
||||
{{ define "title" }}{{ .Title }} | {{ T .Data.Singular | default (humanize .Data.Singular) }} | {{ .Site.Title }}{{ end }}
|
||||
{{- define "title" -}}
|
||||
{{- .Title }} | {{ T .Data.Singular | default (humanize .Data.Singular) }} | {{ .Site.Title -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ define "content" }}
|
||||
<div class="post-warp archive">
|
||||
{{- define "content" -}}
|
||||
<div class="page archive">
|
||||
{{- /* Title */ -}}
|
||||
<h2 class="post-title animated pulse faster">
|
||||
{{ $taxonomy := .Data.Singular }}
|
||||
{{ if eq $taxonomy "category" }}
|
||||
<i class="far fa-folder-open fa-fw"></i>{{ .Title }}
|
||||
{{ else if eq $taxonomy "tag" }}
|
||||
<i class="fas fa-tag fa-fw"></i>{{ .Title }}
|
||||
{{ else }}
|
||||
{{ printf "%s - %s" (T $taxonomy | default (humanize $taxonomy)) .Title }}
|
||||
{{ end }}
|
||||
{{- $taxonomy := .Data.Singular -}}
|
||||
{{- if eq $taxonomy "category" -}}
|
||||
<i class="far fa-folder-open fa-fw"></i> {{ humanize .Title }}
|
||||
{{- else if eq $taxonomy "tag" -}}
|
||||
<i class="fas fa-tag fa-fw"></i> {{ humanize .Title }}
|
||||
{{- else -}}
|
||||
{{- printf "%s - %s" (T $taxonomy | default (humanize $taxonomy)) .Title -}}
|
||||
{{- end -}}
|
||||
</h2>
|
||||
|
||||
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
|
||||
{{- /* Paginate */ -}}
|
||||
{{- range (.Paginate (.Pages.GroupByDate "2006")).PageGroups -}}
|
||||
<h3>{{ .Key }}</h3>
|
||||
{{ range .Pages }}
|
||||
{{- range .Pages -}}
|
||||
<article class="archive-item">
|
||||
<a href="{{ .RelPermalink }}" class="archive-item-link">{{ .Title }}</a>
|
||||
<a href="{{ .RelPermalink }}" class="archive-item-link">
|
||||
{{- .Title -}}
|
||||
</a>
|
||||
<span class="archive-item-date">
|
||||
{{ .Date.Format (.Site.Params.dateFormatToUse | default "01-02") }}
|
||||
{{- .Date.Format (.Site.Params.dateFormatToUse | default "01-02") -}}
|
||||
</span>
|
||||
</article>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ partial "paginator.html" . }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- partial "paginator.html" . -}}
|
||||
</div>
|
||||
{{end }}
|
||||
{{- end -}}
|
||||
@@ -1,51 +1,57 @@
|
||||
{{ define "title" }}{{ T "all" | humanize}}{{ T .Data.Plural | default .Data.Plural | humanize }} | {{ .Site.Title }}{{ end }}
|
||||
{{- define "title" -}}
|
||||
{{- T "all" | humanize }}{{ T .Data.Plural | default .Data.Plural | humanize }} | {{ .Site.Title -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ define "content" }}
|
||||
{{ $taxonomies := .Data.Plural }}
|
||||
{{ $terms := .Data.Terms.ByCount }}
|
||||
{{ $type := .Type }}
|
||||
{{- define "content" -}}
|
||||
{{- $taxonomies := .Data.Plural -}}
|
||||
{{- $terms := .Data.Terms.ByCount -}}
|
||||
{{- $type := .Type -}}
|
||||
|
||||
<div class="post-warp archive">
|
||||
<div class="page archive">
|
||||
{{- /* Title */ -}}
|
||||
<h2 class="post-title animated pulse faster">
|
||||
{{ T "all" | humanize}}{{ T $taxonomies | default $taxonomies | humanize }}
|
||||
{{- T "all" | humanize}}{{ T $taxonomies | default $taxonomies | humanize -}}
|
||||
</h2>
|
||||
|
||||
<!-- Categories Page -->
|
||||
{{ if eq $taxonomies "categories" }}
|
||||
{{- /* Categories Page */ -}}
|
||||
{{- if eq $taxonomies "categories" -}}
|
||||
<div class="categories-card">
|
||||
{{ range $terms }}
|
||||
{{ $term := .Term }}
|
||||
{{ $pages := .Pages }}
|
||||
{{ with $.Site.GetPage "taxonomy" (printf "%s/%s" $type $term) }}
|
||||
{{- range $terms -}}
|
||||
{{- $term := .Term -}}
|
||||
{{- $pages := .Pages -}}
|
||||
{{- with $.Site.GetPage "taxonomy" (printf "%s/%s" $type $term) -}}
|
||||
<div class="card-item">
|
||||
<div class="categories">
|
||||
<a href="{{ .Permalink }}">
|
||||
<h3><i class="far fa-folder fa-fw"></i>{{ $term | humanize}}</h3>
|
||||
</a>
|
||||
{{ range first 5 $pages }}
|
||||
<div class="card-item-wrapper">
|
||||
<h3 class="card-item-title">
|
||||
<a href="{{ .Permalink }}">
|
||||
<i class="far fa-folder fa-fw"></i> {{ $term | humanize}}
|
||||
</a>
|
||||
</h3>
|
||||
{{- range first 5 $pages -}}
|
||||
<article class="archive-item">
|
||||
<a href="{{ .Permalink }}" class="archive-item-link">{{ .Title }}</a>
|
||||
<a href="{{ .Permalink }}" class="archive-item-link">
|
||||
{{- .Title -}}
|
||||
</a>
|
||||
</article>
|
||||
{{ end }}
|
||||
{{ if gt (len $pages) 5 }}
|
||||
{{- end -}}
|
||||
{{- if gt (len $pages) 5 -}}
|
||||
<span class="more-post">
|
||||
<a href="{{ .Permalink }}" class="more-post-link">{{ T "More" }} >></a>
|
||||
<a href="{{ .Permalink }}" class="more-post-link">{{ T "more" }} >></a>
|
||||
</span>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
<!-- Tag Cloud Page -->
|
||||
{{ else if eq $taxonomies "tags" }}
|
||||
{{- /* Tag Cloud Page */ -}}
|
||||
{{- else if eq $taxonomies "tags" -}}
|
||||
<div class="tag-cloud-tags">
|
||||
{{ range $.Site.Taxonomies.tags.ByCount }}
|
||||
{{- range $.Site.Taxonomies.tags.ByCount -}}
|
||||
<a href="{{ .Page.Permalink }}"> {{ .Page.Title }} <small>({{ .Count }})</small></a>
|
||||
{{end}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{end }}
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user