Merge branch 'master' into opengraph
This commit is contained in:
@@ -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 -}}
|
||||
Reference in New Issue
Block a user