mirror of
https://github.com/davegallant/davegallant.github.io.git
synced 2025-08-07 09:02:29 +00:00
port to gitlab.
This commit is contained in:
18
themes/custom/layouts/404.html
Normal file
18
themes/custom/layouts/404.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{{ define "title" }}404 page not found - {{ .Site.Title }}{{ end }}
|
||||
|
||||
{{ define "content" }}
|
||||
<div class="not-found">
|
||||
<h1 class="error-emoji"></h1>
|
||||
<p class="error-text">/* 404 page not found. */</p>
|
||||
<p class="error-link"><a href="{{ "/" | relLangURL }}">↑ Back Home ↑</a></p>
|
||||
</div>
|
||||
<script>
|
||||
var errorEmojiContainer = document.getElementsByClassName('error-emoji')[0];
|
||||
var emojiArray = [
|
||||
'\\(o_o)/', '(o^^)o', '(˚Δ˚)b', '(^-^*)', '(≥o≤)', '(^_^)b', '(·_·)',
|
||||
'(=\'X\'=)', '(>_<)', '(;-;)', '\\(^Д^)/',
|
||||
];
|
||||
var errorEmoji = emojiArray[Math.floor(Math.random() * emojiArray.length)];
|
||||
errorEmojiContainer.appendChild(document.createTextNode(errorEmoji));
|
||||
</script>
|
||||
{{ end }}
|
47
themes/custom/layouts/_default/baseof.html
Normal file
47
themes/custom/layouts/_default/baseof.html
Normal file
@@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.Language }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>
|
||||
{{- block "title" . -}}
|
||||
{{ if .IsPage }}{{ .Title }} - {{ .Site.Title }}{{ else }}{{ .Site.Title }}{{ end }}
|
||||
{{- end -}}
|
||||
</title>
|
||||
{{ partial "head.html" . }}
|
||||
</head>
|
||||
<body>
|
||||
{{ partial "slideout.html" . }}
|
||||
<header id="header" class="header">
|
||||
<div class="header-div">
|
||||
{{ partial "header.html" . }}
|
||||
</div>
|
||||
</header>
|
||||
{{/*
|
||||
{{ partial "search.html" . }}
|
||||
*/}}
|
||||
<div class="container" >
|
||||
<main id="main" class="main">
|
||||
<!-- sidebar -->
|
||||
{{ if or .IsHome .Params.sidebar }}
|
||||
{{ partial "sidebar.html" . }}
|
||||
{{ end }}
|
||||
<div class="content-wrapper" id="mobile-panel">
|
||||
<div id="content" class="content">
|
||||
{{ block "content" . }}{{ end }}
|
||||
</div>
|
||||
{{ partial "comments.html" . }}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer id="footer" class="footer">
|
||||
{{ partial "footer.html" . }}
|
||||
</footer>
|
||||
|
||||
<div class="back-to-top" id="back-to-top">
|
||||
<i class="iconfont icon-up"></i>
|
||||
</div>
|
||||
</div>
|
||||
{{ partial "scripts.html" . }}
|
||||
</body>
|
||||
</html>
|
25
themes/custom/layouts/_default/search.html
Normal file
25
themes/custom/layouts/_default/search.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{{ define "content" }}
|
||||
<section>
|
||||
<div class="query-div">
|
||||
<span class="query-icon" id="query-icon">
|
||||
<i class="fa fa-search"></i>
|
||||
</span>
|
||||
<div class="query-input">
|
||||
<input id="search-query" name="s" class="search-query" placeholder="请输入要搜索的文字..." />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="search-results">
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- this template is sucked in by search.js and appended to the search-results div above. So editing here will adjust style -->
|
||||
<script id="search-result-template" type="text/x-js-template">
|
||||
<li id="summary-${key}">
|
||||
<a href="${link}/" class="search-result-title">${title}</a>
|
||||
<a href="${link}">
|
||||
<p class="search-result">${snippet}</p>
|
||||
</a>
|
||||
</li>
|
||||
</script>
|
||||
{{ end }}
|
50
themes/custom/layouts/_default/section.html
Normal file
50
themes/custom/layouts/_default/section.html
Normal file
@@ -0,0 +1,50 @@
|
||||
{{ define "title" }}{{ T "archive" }} - {{ .Site.Title }}{{ end }}
|
||||
|
||||
{{ define "content"}}
|
||||
{{- $paginator := .Paginate (where .Data.Pages.ByDate.Reverse "Type" "post") .Site.Params.archivePaginate }}
|
||||
<section id="archive" class="archive">
|
||||
{{- if not $paginator.HasPrev }}
|
||||
<div class="archive-title">
|
||||
<span class="archive-post-counter">
|
||||
{{ T "archiveCounter" (len .Data.Pages) }}
|
||||
</span>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
{{- range $index, $element := $paginator.Pages -}}
|
||||
{{- $thisYear := $element.Date.Format "2006" }}
|
||||
{{- $lastElement := $index | add -1 | index $paginator.Pages }}
|
||||
{{ if or (eq $index 0) ( ne ($lastElement.Date.Format "2006") $thisYear ) }}
|
||||
<div class="collection-title">
|
||||
<h2 class="archive-year">{{ $thisYear }}</h2>
|
||||
</div>
|
||||
{{- end }}
|
||||
|
||||
<div class="archive-post">
|
||||
<span class="archive-post-time">
|
||||
{{ $element.Date.Format "01-02" }}
|
||||
</span>
|
||||
<span class="archive-post-title">
|
||||
<a href="{{ $element.URL }}" class="archive-post-link">
|
||||
{{ .Title }}
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
{{- end -}}
|
||||
</section>
|
||||
<!-- pagination -->
|
||||
<nav class="pagination">
|
||||
{{ with $paginator.Prev -}}
|
||||
<a class="prev" href="{{ .URL }}">
|
||||
<i class="iconfont icon-left"></i>
|
||||
<span class="prev-text">{{ T "prevPage" }}</span>
|
||||
</a>
|
||||
{{- end }}
|
||||
{{ with $paginator.Next -}}
|
||||
<a class="next" href="{{ .URL }}">
|
||||
<span class="next-text">{{ T "nextPage" }}</span>
|
||||
<i class="iconfont icon-right"></i>
|
||||
</a>
|
||||
{{- end }}
|
||||
</nav>
|
||||
{{ end }}
|
7
themes/custom/layouts/_default/single.html
Normal file
7
themes/custom/layouts/_default/single.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{{ define "content" -}}
|
||||
<article class="post">
|
||||
<div class="post-content">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</article>
|
||||
{{- end }}
|
1
themes/custom/layouts/_default/single.md
Normal file
1
themes/custom/layouts/_default/single.md
Normal file
@@ -0,0 +1 @@
|
||||
{{ .RawContent }}
|
46
themes/custom/layouts/_default/taxonomy.html
Normal file
46
themes/custom/layouts/_default/taxonomy.html
Normal file
@@ -0,0 +1,46 @@
|
||||
{{ define "title" }}{{ .Title }} · {{ .Site.Title }}{{ end }}
|
||||
|
||||
{{ define "content"}}
|
||||
{{ $paginator := .Paginate (where .Data.Pages.ByDate.Reverse "Type" "post") .Site.Params.archivePaginate }}
|
||||
<section id="archive" class="archive">
|
||||
{{ if not $paginator.HasPrev }}
|
||||
{{ if eq .Data.Plural "tags" }}
|
||||
<div class="archive-title tag">
|
||||
<h2 class="archive-name">{{ .Title }}</h2>
|
||||
</div>
|
||||
{{ else if eq .Data.Plural "categories" }}
|
||||
<div class="archive-title category">
|
||||
<h2 class="archive-name">{{ .Title }}</h2>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ range $paginator.Pages }}
|
||||
<div class="archive-post">
|
||||
<span class="archive-post-time">
|
||||
{{ .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}
|
||||
</span>
|
||||
<span class="archive-post-title">
|
||||
<a href="{{ .URL }}" class="archive-post-link">
|
||||
{{ .Title }}
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
{{ end }}
|
||||
</section>
|
||||
<!-- pagination -->
|
||||
<nav class="pagination">
|
||||
{{ with $paginator.Prev }}
|
||||
<a class="prev" href="{{ .URL }}">
|
||||
<i class="iconfont icon-left"></i>
|
||||
<span class="prev-text">{{ T "prevPage" }}</span>
|
||||
</a>
|
||||
{{- end }}
|
||||
{{ with $paginator.Next }}
|
||||
<a class="next" href="{{ .URL }}">
|
||||
<span class="next-text">{{ T "nextPage" }}</span>
|
||||
<i class="iconfont icon-right"></i>
|
||||
</a>
|
||||
{{- end }}
|
||||
</nav>
|
||||
{{ end }}
|
44
themes/custom/layouts/_default/terms.html
Normal file
44
themes/custom/layouts/_default/terms.html
Normal file
@@ -0,0 +1,44 @@
|
||||
{{ define "title" }}{{ T .Data.Plural }} - {{ .Site.Title }}{{ end }}
|
||||
|
||||
{{ define "content" }}
|
||||
{{ $name := .Data.Plural -}}
|
||||
{{ $terms := .Data.Terms.ByCount -}}
|
||||
{{ $length := len $terms -}}
|
||||
{{ if eq $name "categories" }}
|
||||
<div class="categories">
|
||||
<div class="categories-title">
|
||||
{{ if eq $length 0 }}
|
||||
{{ T "zeroCategoryCounter" }}
|
||||
{{ else }}
|
||||
{{ T "categoryCounter" $length }}
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="categories-tags">
|
||||
{{ range $key, $value := $terms }}
|
||||
<a class="category-link" href="{{ $name | relLangURL }}/{{ $value.Term | urlize }}/">
|
||||
{{ $value.Term }}
|
||||
<span class="category-count">{{ len $value.Pages }}</span>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ else if eq $name "tags" }}
|
||||
<div class="tag-cloud">
|
||||
<div class="tag-cloud-title">
|
||||
{{ if eq $length 0 }}
|
||||
{{ T "zeroTagCounter" }}
|
||||
{{ else }}
|
||||
{{ T "tagCounter" $length }}
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="tag-cloud-tags">
|
||||
{{ range $key, $value := $terms }}
|
||||
<a href="{{ $name | relLangURL }}/{{ $value.Term | urlize }}/">
|
||||
{{ $value.Term }}
|
||||
<span class="tag-count">{{ len $value.Pages }}</span>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
24
themes/custom/layouts/index.html
Normal file
24
themes/custom/layouts/index.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{{ define "content" }}
|
||||
<section id="posts" class="posts">
|
||||
{{/* (index .Site.Paginate) */}}
|
||||
{{ $paginator := .Paginate (where (where .Data.Pages "Type" "post") ".Params.hiddenfromhomepage" "!=" true) }}
|
||||
{{ range $paginator.Pages }}
|
||||
{{ .Render "summary" }}
|
||||
{{ end }}
|
||||
</section>
|
||||
<!-- pagination -->
|
||||
<nav class="pagination">
|
||||
{{ with $paginator.Prev }}
|
||||
<a class="prev" href="{{ .URL }}">
|
||||
<i class="iconfont icon-left"></i>
|
||||
<span class="prev-text">{{ T "prevPage" }}</span>
|
||||
</a>
|
||||
{{- end }}
|
||||
{{ with $paginator.Next }}
|
||||
<a class="next" href="{{ .URL }}">
|
||||
<span class="next-text">{{ T "nextPage" }}</span>
|
||||
<i class="iconfont icon-right"></i>
|
||||
</a>
|
||||
{{- end }}
|
||||
</nav>
|
||||
{{ end }}
|
5
themes/custom/layouts/index.json
Normal file
5
themes/custom/layouts/index.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{{- $.Scratch.Add "index" slice -}}
|
||||
{{- range .Site.RegularPages -}}
|
||||
{{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "categories" .Params.categories "contents" .Plain "permalink" .Permalink) -}}
|
||||
{{- end -}}
|
||||
{{- $.Scratch.Get "index" | jsonify -}}
|
137
themes/custom/layouts/partials/comments.html
Normal file
137
themes/custom/layouts/partials/comments.html
Normal file
@@ -0,0 +1,137 @@
|
||||
{{ if and .IsPage (ne .Params.comment false) }}
|
||||
|
||||
{{- if and .Site.Params.disqus.name .Site.Params.disqus.lazy -}}
|
||||
<div onclick="showDisqus();" id="disqus_title" class="disqus_title">Load Comments</div>
|
||||
{{- end -}}
|
||||
|
||||
<!-- gitalk -->
|
||||
{{- if .Site.Params.gitalk.owner -}}
|
||||
<div id="gitalk-container" class="gitalk-container"></div>
|
||||
<link rel="stylesheet" href="{{ "lib/gitalk/gitalk-1.2.2.min.css" | relURL }}">
|
||||
<script src="{{ "lib/gitalk/gitalk-1.2.2.min.js" | relURL }}"></script>
|
||||
<script type="text/javascript">
|
||||
var gitalk = new Gitalk({
|
||||
id: '{{md5 .URL}}',
|
||||
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>
|
||||
{{- end -}}
|
||||
|
||||
<!-- Disqus -->
|
||||
{{- if .Site.Params.disqus.name -}}
|
||||
<div id="disqus_thread"></div>
|
||||
<script type="text/javascript">
|
||||
// function checkDisqus() {
|
||||
// // var dsp = $.trim($("#dsq-app1").attr("id"));
|
||||
// var dsp = $.trim($('iframe[id^=dsq-app]').attr("id"));
|
||||
// if (dsp == "") {
|
||||
// $("#disqus_thread").append('<div style="text-align: center;" id="reload_div">Loaded Disqus Failured. Please Ensure You Can Access [disqus.com] ! Then <a href="javascript:void(0);" onclick="showDisqus();">Reload</a>!</div>');
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
function showDisqus() {
|
||||
$("#disqus_title").attr("style", "display:none");
|
||||
|
||||
// Don't ever inject Disqus on localhost--it creates unwanted
|
||||
// discussions from 'localhost:1313' on your Disqus account...
|
||||
// if (window.location.hostname === 'localhost') return;
|
||||
// setTimeout("checkDisqus()", 20000);
|
||||
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = false;
|
||||
var disqus_shortname = '{{ .Site.Params.disqus.name }}';
|
||||
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
|
||||
window.location.hash = "#disqus_thread";
|
||||
}
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
|
||||
{{- if not .Site.Params.disqus.lazy -}}
|
||||
<script type="text/javascript">
|
||||
// $(document).ready(function () {
|
||||
window.onload = function () {
|
||||
|
||||
showDisqus();
|
||||
}
|
||||
// })
|
||||
</script>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
<!-- changyan -->
|
||||
{{- if and .Site.Params.changyanAppid .Site.Params.changyanAppkey -}}
|
||||
<div id="SOHUCS"></div>
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
if (window.location.hostname === 'localhost') return;
|
||||
|
||||
var appid = '{{ .Site.Params.changyanAppid }}';
|
||||
var conf = '{{ .Site.Params.changyanAppkey }}';
|
||||
var width = window.innerWidth || document.documentElement.clientWidth;
|
||||
if (width < 960) {window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>'); } else { var loadJs=function(d,a){var c=document.getElementsByTagName("head")[0]||document.head||document.documentElement;var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("charset","UTF-8");b.setAttribute("src",d);if(typeof a==="function"){if(window.attachEvent){b.onreadystatechange=function(){var e=b.readyState;if(e==="loaded"||e==="complete"){b.onreadystatechange=null;a()}}}else{b.onload=a}}c.appendChild(b)};loadJs("https://changyan.sohu.com/upload/changyan.js",function(){window.changyan.api.config({appid:appid,conf:conf})}); }
|
||||
})();
|
||||
</script>
|
||||
{{- end -}}
|
||||
|
||||
<!-- LiveRe -->
|
||||
{{- if .Site.Params.livereUID -}}
|
||||
<div id="lv-container" data-id="city" data-uid="{{ .Site.Params.livereUID }}">
|
||||
<script type="text/javascript">
|
||||
(function(d, s) {
|
||||
var j, e = d.getElementsByTagName(s)[0];
|
||||
|
||||
if (typeof LivereTower === 'function') { return; }
|
||||
|
||||
j = d.createElement(s);
|
||||
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
|
||||
j.async = true;
|
||||
|
||||
e.parentNode.insertBefore(j, e);
|
||||
})(document, 'script');
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments powered by <a href="https://livere.com/">LiveRe.</a></noscript>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
<!-- gitment -->
|
||||
{{- if .Site.Params.gitment.owner -}}
|
||||
<div id="comments-gitment"></div>
|
||||
{{ if .Site.Params.publicCDN.enable -}}
|
||||
{{ .Site.Params.publicCDN.gitmentCSS | safeHTML }}
|
||||
{{ .Site.Params.publicCDN.gitmentJS | safeHTML }}
|
||||
{{- else -}}
|
||||
<link rel="stylesheet" href="{{ "lib/gitment/gitment-0.0.3.min.css" | relURL }}">
|
||||
<script src="{{ "lib/gitment/gitment-0.0.3.min.js" | relURL }}"></script>
|
||||
{{- end }}
|
||||
<script type="text/javascript">
|
||||
const gitment = new Gitment({
|
||||
id: '{{ .Date }}',
|
||||
title: '{{ .Title }}',
|
||||
link: decodeURI(location.href),
|
||||
desc: '{{ .Summary }}',
|
||||
owner: '{{ .Site.Params.gitment.owner }}',
|
||||
repo: '{{ .Site.Params.gitment.repo }}',
|
||||
oauth: {
|
||||
client_id: '{{ .Site.Params.gitment.clientId }}',
|
||||
client_secret: '{{ .Site.Params.gitment.clientSecret }}'
|
||||
}
|
||||
})
|
||||
gitment.render('comments-gitment')
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="https://github.com/imsun/gitment">comments powered by gitment.</a></noscript>
|
||||
{{- end }}
|
||||
|
||||
{{- end }}
|
51
themes/custom/layouts/partials/footer.html
Normal file
51
themes/custom/layouts/partials/footer.html
Normal file
@@ -0,0 +1,51 @@
|
||||
<div class="social-links">
|
||||
{{- range $name, $path := .Site.Params.social }}
|
||||
{{- if $path }}
|
||||
{{- $names := split $name "-" }}
|
||||
{{ range $k,$v := $names }}
|
||||
{{if eq $k 1}}
|
||||
<a href="{{ $path | safeURL }}" class="iconfont icon-{{ $v }}" title="{{ $v }}"></a>
|
||||
{{end}}
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ if .Site.LanguagePrefix -}}
|
||||
<a href="{{ .Site.LanguagePrefix | absURL }}/index.xml" type="application/rss+xml" class="iconfont icon-rss" title="rss"></a>
|
||||
{{- else -}}
|
||||
<a href="{{ .Site.RSSLink }}" type="application/rss+xml" class="iconfont icon-rss" title="rss"></a>
|
||||
{{- end }}
|
||||
</div>
|
||||
|
||||
<div class="copyright">
|
||||
<span class="power-by">
|
||||
{{ (printf (T "powered") `<a class="hexo-link" href="https://gohugo.io">Hugo</a>`) | safeHTML }}
|
||||
</span>
|
||||
|
||||
{{ if .Site.Params.busuanzi.enable -}}
|
||||
<div class="busuanzi-footer">
|
||||
{{ $spinner := "img/spinner.svg" | relURL -}}
|
||||
{{ if and .Site.Params.busuanzi.enable .Site.Params.busuanzi.sitePV -}}
|
||||
{{ $valueSpan := printf `<span id="busuanzi_value_site_pv"><img src="%s" alt="spinner.svg"/></span>` $spinner -}}
|
||||
<span id="busuanzi_container_site_pv"> {{ printf (T "sitePV") $valueSpan | safeHTML }} </span>
|
||||
{{ if .Site.Params.busuanzi.siteUV }}<span class="division">|</span>{{ end }}
|
||||
{{- end }}
|
||||
{{ if and .Site.Params.busuanzi.enable .Site.Params.busuanzi.siteUV -}}
|
||||
{{ $valueSpan := printf `<span id="busuanzi_value_site_uv"><img src="%s" alt="spinner.svg"/></span>` $spinner -}}
|
||||
<span id="busuanzi_container_site_uv"> {{ printf (T "siteUV") $valueSpan | safeHTML }} </span>
|
||||
{{- end }}
|
||||
</div>
|
||||
{{- end }}
|
||||
|
||||
<span class="copyright-year">
|
||||
{{- $current := now.Format "2006" }}
|
||||
©
|
||||
{{ if ne .Site.Params.since $current }}
|
||||
{{ .Site.Params.since }} -
|
||||
{{ end }}
|
||||
{{- $current }}
|
||||
<span class="heart">
|
||||
<i class="iconfont icon-heart"></i>
|
||||
</span>
|
||||
<span class="author">{{if .Site.Copyright }}{{ .Site.Copyright | safeHTML }}{{ else }}{{ .Site.Author.name | safeHTML }}{{ end }}</span>
|
||||
</span>
|
||||
</div>
|
96
themes/custom/layouts/partials/head.html
Normal file
96
themes/custom/layouts/partials/head.html
Normal file
@@ -0,0 +1,96 @@
|
||||
<meta name="renderer" content="webkit" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
|
||||
|
||||
<meta http-equiv="Cache-Control" content="no-transform" />
|
||||
<meta http-equiv="Cache-Control" content="no-siteapp" />
|
||||
|
||||
<meta name="theme-color" content="#f8f5ec" />
|
||||
<meta name="msapplication-navbutton-color" content="#f8f5ec">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">
|
||||
|
||||
<!-- author & description & keywords -->
|
||||
<meta name="author" content="{{ if .Params.author }}{{ .Params.author | safeHTML }}{{ else }}{{ .Site.Author.name | safeHTML }}{{ end }}" />
|
||||
|
||||
{{- if .Description -}}
|
||||
<meta name="description" content="{{ .Description | safeHTML }}" />
|
||||
{{ else if .IsPage }}
|
||||
<meta name="description" content="{{ .Summary | plainify }}" />
|
||||
{{ else if .Site.Params.description }}
|
||||
<meta name="description" content="{{ .Site.Params.description | safeHTML }}" />
|
||||
{{- end -}}
|
||||
|
||||
{{- if .Keywords -}}
|
||||
{{ $length := len .Keywords | add -1 -}}
|
||||
<meta name="keywords" content="{{ range $index, $element := .Keywords }}{{ $element | safeHTML }}{{if ne $index $length }}, {{ end }}{{ end }}" />
|
||||
{{ else if .Site.Params.keywords }}
|
||||
{{ $length := len .Site.Params.keywords | add -1 -}}
|
||||
<meta name="keywords" content="{{ range $index, $element := .Site.Params.keywords }}{{ $element | safeHTML }}{{if ne $index $length }}, {{ end }}{{ end }}" />
|
||||
{{- end }}
|
||||
|
||||
<!-- baidu & google verification -->
|
||||
{{ with .Site.Params.baidu_verification }}<meta name="baidu-site-verification" content="{{.}}" />{{ end }}
|
||||
{{ with .Site.Params.google_verification }}<meta name="google-site-verification" content="{{.}}" />{{ end }}
|
||||
|
||||
<!-- Site Generator -->
|
||||
<meta name="generator" content="Hugo {{ .Hugo.Version }}" />
|
||||
|
||||
<!-- Permalink & RSSlink -->
|
||||
<link rel="canonical" href="{{ .Permalink }}" />
|
||||
{{ if .RSSLink -}}
|
||||
<link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
|
||||
<link href="{{ .RSSLink }}" rel="feed" type="application/rss+xml" title="{{ .Site.Title }}" />
|
||||
{{ end -}}
|
||||
|
||||
<!-- Favicon and Touch icons -->
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ "apple-touch-icon.png" | relURL }}">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ "favicon-32x32.png" | relURL }}">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ "favicon-16x16.png" | relURL }}">
|
||||
<link rel="manifest" href="{{ "manifest.json" | relURL }}">
|
||||
<link rel="mask-icon" href="{{ "safari-pinned-tab.svg" | relURL }}" color="#5bbad5">
|
||||
|
||||
<!-- debug -->
|
||||
{{- if .Site.Params.debug }}
|
||||
<script src="https://cdn.jsdelivr.net/npm/eruda@1.2.6/eruda.min.js" integrity="sha256-Jmz4bc3kp+rRrXX2tGadNBKFLwtzMapr8kHABxSAAP8=" crossorigin="anonymous"></script>
|
||||
<script>eruda.init();</script>
|
||||
{{- end }}
|
||||
|
||||
<!-- busuanzi -->
|
||||
{{ if .Site.Params.busuanzi.enable -}}
|
||||
<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
|
||||
{{- end }}
|
||||
|
||||
<!-- Styles -->
|
||||
<link href="{{ "dist/ehlxr.min.css?v=0.0.1" | relURL }}" rel="stylesheet">
|
||||
{{ if .Site.Params.publicCDN.enable -}}
|
||||
{{ if .Site.Params.fancybox }}{{ .Site.Params.publicCDN.fancyboxCss | safeHTML }}{{ end }}
|
||||
{{- else -}}
|
||||
{{ if .Site.Params.fancybox }}<link href="{{ "lib/fancybox/jquery.fancybox-3.1.20.min.css" | relURL }}" rel="stylesheet">{{ end }}
|
||||
{{- end }}
|
||||
|
||||
{{ if .Site.Params.publicCDN.enable -}}
|
||||
{{ .Site.Params.publicCDN.fontAwesome | safeHTML }}
|
||||
{{- else -}}
|
||||
<link href="{{ "/lib/font-awesome/css/font-awesome.min.css" | relURL }}" rel="stylesheet">
|
||||
{{- end }}
|
||||
|
||||
<!-- custom css -->
|
||||
{{ range .Site.Params.customCSS }}
|
||||
<link rel="stylesheet" href="{{ "/css/" | relURL }}{{ . }}">
|
||||
{{ end }}
|
||||
|
||||
{{/* NOTE: These Hugo Internal Templates can be found starting at https://github.com/spf13/hugo/blob/master/tpl/tplimpl/template_embedded.go#L158 */}}
|
||||
{{- template "_internal/opengraph.html" . -}}
|
||||
{{- template "_internal/google_news.html" . -}}
|
||||
{{- template "_internal/schema.html" . -}}
|
||||
{{- template "_internal/twitter_cards.html" . -}}
|
||||
|
||||
<!-- Polyfill for old browsers -->
|
||||
{{ `<!--[if lte IE 9]>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20170427/classList.min.js"></script>
|
||||
<![endif]-->` | safeHTML }}
|
||||
|
||||
{{ `<!--[if lt IE 9]>
|
||||
<script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
|
||||
<![endif]-->` | safeHTML }}
|
35
themes/custom/layouts/partials/header.html
Normal file
35
themes/custom/layouts/partials/header.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<div class="logo-wrapper">
|
||||
<a href="{{ "/" | relLangURL }}" class="logo">
|
||||
{{- if .Site.Params.logoTitle -}}
|
||||
{{ .Site.Params.logoTitle }}
|
||||
{{- else -}}
|
||||
{{ .Site.Title }}
|
||||
{{- end -}}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<nav class="site-navbar">
|
||||
<ul id="menu" class="menu">
|
||||
{{ $currentPage := . }}
|
||||
{{ $menus := .Site.Params.icons }}
|
||||
{{ range .Site.Menus.main -}}
|
||||
<li class="menu-item {{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
|
||||
<a class="menu-item-link" href="{{ .URL | safeURL }}">
|
||||
{{ $id := .Identifier }}
|
||||
{{- range $menus -}}
|
||||
{{- if eq $id .id -}}
|
||||
<i class="fa fa-fw fa-{{.icon}}"></i>
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
{{ .Name }}
|
||||
</a>
|
||||
</li>
|
||||
{{- end }}
|
||||
<!-- <li class="menu-item">
|
||||
<a class="menu-item-link" href="javascript:void(0);" id="search">
|
||||
<i class="fa fa-fw fa-search"></i>
|
||||
搜索
|
||||
</a>
|
||||
</li> -->
|
||||
</ul>
|
||||
</nav>
|
42
themes/custom/layouts/partials/post/copyright.html
Normal file
42
themes/custom/layouts/partials/post/copyright.html
Normal file
@@ -0,0 +1,42 @@
|
||||
{{ if or .Params.postMetaInFooter (and .Site.Params.postMetaInFooter (ne .Params.postMetaInFooter false)) -}}
|
||||
<div class="post-copyright">
|
||||
<p class="copyright-item">
|
||||
<span class="item-title">{{ T "author" }}</span>
|
||||
<span class="item-content">{{ if .Params.author }}{{ .Params.author | safeHTML }}{{ else }}{{ .Site.Author.name | safeHTML }}{{ end }}</span>
|
||||
</p>
|
||||
<!-- <p class="copyright-item">
|
||||
<span class="item-title">{{ T "lastMod" }}</span>
|
||||
<span class="item-content">{{ .Lastmod.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}</span>
|
||||
</p> -->
|
||||
<p class="copyright-item">
|
||||
<span class="item-title">{{ T "postLink" }}</span>
|
||||
<span class="item-content"><a href="{{ .Site.BaseURL }}{{ .URL }}" target="_blank">
|
||||
<script>
|
||||
document.write(decodeURI(location))
|
||||
</script>
|
||||
</a></span>
|
||||
</p>
|
||||
{{ if $.Site.Params.linkToMarkDown -}}
|
||||
{{ with $.OutputFormats.Get "markdown" -}}
|
||||
<p class="copyright-item">
|
||||
<span class="item-title">{{ T "markdown" }}</span>
|
||||
<span class="item-content"><a class="link-to-markdown" href="{{ .Permalink }}" target="_blank">{{ T "seeMarkDown" }}</a></span>
|
||||
</p>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ if or .Params.contentCopyright (and .Site.Params.contentCopyright (ne .Params.contentCopyright false)) -}}
|
||||
<p class="copyright-item">
|
||||
<span class="item-title">{{ T "license" }}</span>
|
||||
<span class="item-content">
|
||||
{{- if .Params.contentCopyright -}}
|
||||
{{ $Copyrigh := .Params.contentCopyright }}
|
||||
{{ printf (T "licenseContent") $Copyrigh | safeHTML }}
|
||||
{{- else -}}
|
||||
{{ $Copyrigh := .Site.Params.contentCopyright }}
|
||||
{{ printf (T "licenseContent") $Copyrigh | safeHTML }}
|
||||
{{- end -}}
|
||||
</span>
|
||||
</p>
|
||||
{{- end }}
|
||||
</div>
|
||||
{{- end }}
|
21
themes/custom/layouts/partials/post/reward.html
Normal file
21
themes/custom/layouts/partials/post/reward.html
Normal file
@@ -0,0 +1,21 @@
|
||||
{{ if or .Params.reward (and .Site.Params.reward.enable (ne .Params.reward false)) }}
|
||||
<div class="post-reward">
|
||||
<input type="checkbox" name="reward" id="reward" hidden />
|
||||
<label class="reward-button" for="reward">{{ T "reward" }}</label>
|
||||
<div class="qr-code">
|
||||
{{ $qrCode := .Site.Params.reward }}
|
||||
{{ with $qrCode.wechat }}
|
||||
<label class="qr-code-image" for="reward">
|
||||
<img class="image" src="{{ . }}">
|
||||
<span>{{ T "rewardWechat" }}</span>
|
||||
</label>
|
||||
{{- end }}
|
||||
{{ with $qrCode.alipay }}
|
||||
<label class="qr-code-image" for="reward">
|
||||
<img class="image" src="{{ . }}">
|
||||
<span>{{ T "rewardAlipay" }}</span>
|
||||
</label>
|
||||
{{- end }}
|
||||
</div>
|
||||
</div>
|
||||
{{- end }}
|
12
themes/custom/layouts/partials/post/toc.html
Normal file
12
themes/custom/layouts/partials/post/toc.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{ 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 false }}
|
||||
<div class="post-toc-content{{ if not (or .Params.autoCollapseToc (and $globalAutoCollapseToc (ne .Params.autoCollapseToc false))) }} always-active{{ end }}">
|
||||
{{.TableOfContents}}
|
||||
</div>
|
||||
<div class="toc-taxonomy">
|
||||
{{ partial "sidebar-taxonomy.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
82
themes/custom/layouts/partials/scripts.html
Normal file
82
themes/custom/layouts/partials/scripts.html
Normal file
@@ -0,0 +1,82 @@
|
||||
<!-- js -->
|
||||
<script src="{{ "lib/highlight/highlight.pack.js?v=20171001" | relURL }}"></script>
|
||||
{{- if .Site.Params.publicCDN.enable }}
|
||||
{{ .Site.Params.publicCDN.jquery | safeHTML }}
|
||||
{{ .Site.Params.publicCDN.slideout | safeHTML }}
|
||||
{{ .Site.Params.publicCDN.fuse | safeHTML }}
|
||||
{{ .Site.Params.publicCDN.mark | safeHTML }}
|
||||
{{ if .Site.Params.fancybox }}{{ .Site.Params.publicCDN.fancyboxJs | safeHTML }}{{ end }}
|
||||
{{- else -}}
|
||||
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
|
||||
crossorigin="anonymous"></script>
|
||||
<script type="text/javascript" src="{{ "lib/slideout/slideout-1.0.1.min.js" | relURL }}"></script>
|
||||
|
||||
{{ if .Site.Params.fancybox }}<script type="text/javascript" src="{{ "lib/fancybox/jquery.fancybox-3.1.20.min.js" | relURL }}"></script>{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
<!-- flowchart -->
|
||||
{{- if and (or .Params.flowchartDiagrams.enable (and .Site.Params.flowchartDiagrams.enable (ne .Params.flowchartDiagrams.enable false))) (or .IsPage .IsHome) -}}
|
||||
<script>
|
||||
{{- if .Params.flowchartDiagrams.options -}}
|
||||
window.flowchartDiagramsOptions = {{ .Params.flowchartDiagrams.options | safeJS }};
|
||||
{{- else if .Site.Params.flowchartDiagrams.options -}}
|
||||
window.flowchartDiagramsOptions = {{ .Site.Params.flowchartDiagrams.options | safeJS }};
|
||||
{{- end -}}
|
||||
</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/raphael@2.2.7/raphael.min.js" integrity="sha256-67By+NpOtm9ka1R6xpUefeGOY8kWWHHRAKlvaTJ7ONI=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/flowchart.js@1.8.0/release/flowchart.min.js" integrity="sha256-zNGWjubXoY6rb5MnmpBNefO0RgoVYfle9p0tvOQM+6k=" crossorigin="anonymous"></script>
|
||||
{{- end -}}
|
||||
|
||||
<!-- js-sequence-diagrams -->
|
||||
{{- if and (or .Params.sequenceDiagrams.enable (and .Site.Params.sequenceDiagrams.enable (ne .Params.sequenceDiagrams.enable false))) (or .IsPage .IsHome) -}}
|
||||
<script>
|
||||
{{- if .Params.sequenceDiagrams.options -}}
|
||||
window.sequenceDiagramsOptions = {{ .Params.sequenceDiagrams.options | safeJS }};
|
||||
{{- else if .Site.Params.sequenceDiagrams.options -}}
|
||||
window.sequenceDiagramsOptions = {{ .Site.Params.sequenceDiagrams.options | safeJS }};
|
||||
{{- end -}}
|
||||
</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/webfontloader@1.6.28/webfontloader.js" integrity="sha256-4O4pS1SH31ZqrSO2A/2QJTVjTPqVe+jnYgOWUVr7EEc=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/snapsvg@0.5.1/dist/snap.svg-min.js" integrity="sha256-oI+elz+sIm+jpn8F/qEspKoKveTc5uKeFHNNVexe6d8=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/underscore@1.8.3/underscore-min.js" integrity="sha256-obZACiHd7gkOk9iIL/pimWMTJ4W/pBsKu+oZnSeBIek=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/bramp/js-sequence-diagrams@2.0.1/dist/sequence-diagram-min.js" integrity="sha384-8748Vn52gHJYJI0XEuPB2QlPVNUkJlJn9tHqKec6J3q2r9l8fvRxrgn/E5ZHV0sP" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/bramp/js-sequence-diagrams@2.0.1/dist/sequence-diagram-min.css" integrity="sha384-6QbLKJMz5dS3adWSeINZe74uSydBGFbnzaAYmp+tKyq60S7H2p6V7g1TysM5lAaF" crossorigin="anonymous">
|
||||
{{- end }}
|
||||
<script type="text/javascript" src="{{ "dist/ehlxr.min.js?v=0.0.1" | relURL }}"></script>
|
||||
|
||||
{{- if and (or .Params.mathjax (and .Site.Params.mathjax (ne .Params.mathjax false))) (or .IsPage .IsHome) }}
|
||||
<script type="text/javascript">
|
||||
window.MathJax = {
|
||||
{{ if or .Params.mathjaxEnableSingleDollar (and .Site.Params.mathjaxEnableSingleDollar (ne .Params.mathjaxEnableSingleDollar false)) -}}
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]},
|
||||
{{ end -}}
|
||||
showProcessingMessages: false,
|
||||
messageStyle: 'none'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML"></script>
|
||||
{{- end }}
|
||||
|
||||
<!-- Analytics -->
|
||||
{{- if .Site.GoogleAnalytics -}}
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
{{- end -}}
|
||||
|
||||
{{- with .Site.Params.baidu_analytics -}}
|
||||
<script id="baidu_analytics">
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
if (window.location.hostname === 'localhost') return;
|
||||
var hm = document.createElement("script"); hm.async = true;
|
||||
hm.src = "https://hm.baidu.com/hm.js?{{.}}";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
{{- end }}
|
||||
|
||||
|
||||
<!-- custom js -->
|
||||
{{ range .Site.Params.customJS }}
|
||||
<script src="{{ "/js/" | relURL }}{{ . }}"></script>
|
||||
{{ end }}
|
45
themes/custom/layouts/partials/search.html
Normal file
45
themes/custom/layouts/partials/search.html
Normal file
@@ -0,0 +1,45 @@
|
||||
<div class="search-popup" id="search-popup">
|
||||
<div class="search-header clearfix">
|
||||
<span class="search-icon">
|
||||
<i class="fa fa-search"></i>
|
||||
</span>
|
||||
<span class="popup-btn-close">
|
||||
<i class="fa fa-times-circle"></i>
|
||||
</span>
|
||||
<div class="search-input-wrapper">
|
||||
<input placeholder="搜索..." type="text" id="search-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-pop-overlay"></div>
|
||||
<script src="{{ "https://res.cloudinary.com/jimmysong/raw/upload/rootsongjc-hugo/algoliasearch.min.js" | absURL }}"></script>
|
||||
<script src="{{ "https://res.cloudinary.com/jimmysong/raw/upload/rootsongjc-hugo/autocomplete.min.js" | absURL }}"></script>
|
||||
<script>
|
||||
var client = algoliasearch("ZEQC88XBX5", "18f218cfb288b3c6e29cacfe6a15002c");
|
||||
var index = client.initIndex('hugo-blog');
|
||||
autocomplete('#search-input',{ hint: false }, {
|
||||
source: autocomplete.sources.hits(index, { hitsPerPage: 8 }),
|
||||
displayKey: 'name',
|
||||
templates: {
|
||||
suggestion: function (suggestion) {
|
||||
console.info(suggestion);
|
||||
var d = suggestion.date.substring(0, 10);
|
||||
var date = d.replace(/-/g, "/");
|
||||
|
||||
var href = window.location.origin + "/";
|
||||
var slug = suggestion.slug;
|
||||
if (slug == undefined) {
|
||||
if (suggestion.uri.indexOf(d) != -1) {
|
||||
href += date
|
||||
}
|
||||
var reg = /[\u3002|\uff1f|\uff01|\uff0c|\u3001|\uff1b|\uff1a|\u201c|\u201d|\u2018|\u2019|\uff08|\uff09|\u300a|\u300b|\u3008|\u3009|\u3010|\u3011|\u300e|\u300f|\u300c|\u300d|\ufe43|\ufe44|\u3014|\u3015|\u2026|\u2014|\uff5e|\ufe4f|\uffe5]/g;
|
||||
href += "/" + suggestion.title.toLowerCase().replace(/\s/g, "-").replace(/\[|\]|\s/g, "").replace(reg, "");
|
||||
} else {
|
||||
href += date + "/" + slug;
|
||||
}
|
||||
|
||||
return '<span>' + '<a href="' + href + '">' + suggestion._highlightResult.title.value + '</a></span>';
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
15
themes/custom/layouts/partials/sidebar-taxonomy.html
Normal file
15
themes/custom/layouts/partials/sidebar-taxonomy.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{{ range $key, $value := .Site.Taxonomies }}
|
||||
<div class="sidebar-{{ $key | singularize | lower }}">
|
||||
<hr>
|
||||
<h5>
|
||||
<a href="/{{$key}}/">{{ T ($key | singularize) }}</a>
|
||||
</h5>
|
||||
|
||||
{{ range $k, $v := first 10 $value.ByCount }}
|
||||
<a href="{{ $.Site.BaseURL}}/{{ $key }}/{{ $v.Name | urlize }}" class="taxonomy-name">
|
||||
{{ $v.Name }}
|
||||
<span class="taxonomy-counts">{{ len $v.Pages }}</span>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
7
themes/custom/layouts/partials/sidebar.html
Normal file
7
themes/custom/layouts/partials/sidebar.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<div class="sidebar" id="sidebar">
|
||||
|
||||
|
||||
{{ partial "sidebar-taxonomy.html" . }}
|
||||
|
||||
|
||||
</div>
|
25
themes/custom/layouts/partials/slideout.html
Normal file
25
themes/custom/layouts/partials/slideout.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<div id="mobile-navbar" class="mobile-navbar">
|
||||
<div class="mobile-header-logo">
|
||||
<a href="{{ "/" | relLangURL }}" class="logo">
|
||||
{{- if .Site.Params.logoTitle -}}
|
||||
{{ .Site.Params.logoTitle }}
|
||||
{{- else -}}
|
||||
{{ .Site.Title }}
|
||||
{{- end -}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="mobile-navbar-icon">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<nav id="mobile-menu" class="mobile-menu slideout-menu">
|
||||
<ul class="mobile-menu-list">
|
||||
{{ range .Site.Menus.main -}}
|
||||
<a href="{{ .URL | safeURL }}">
|
||||
<li class="mobile-menu-item">{{ .Name }}</li>
|
||||
</a>
|
||||
{{- end }}
|
||||
</ul>
|
||||
</nav>
|
78
themes/custom/layouts/post/single.html
Normal file
78
themes/custom/layouts/post/single.html
Normal file
@@ -0,0 +1,78 @@
|
||||
{{ define "content" -}}
|
||||
<article class="post">
|
||||
<!-- post-header -->
|
||||
<header class="post-header single-post-header">
|
||||
<h1 class="post-title">{{ .Title }}</h1>
|
||||
|
||||
<div class="post-meta">
|
||||
<span class="post-time"> <i class="fa fa-calendar" aria-hidden="true"></i> {{ .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }} </span>
|
||||
{{ with .Params.categories -}}
|
||||
<div class="post-category">
|
||||
| <i class="fa fa-folder" aria-hidden="true"></i>
|
||||
{{ range . }}
|
||||
<a href="{{ "categories" | relLangURL }}/{{ . | urlize }}/"> {{ . }} </a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{- end }}
|
||||
{{ if .Site.Params.moreMeta -}}
|
||||
<span class="more-meta"> | <i class="fa fa-book" aria-hidden="true"></i> {{ T "wordCount" .WordCount }} </span>
|
||||
<span class="more-meta"> | <i class="fa fa-clock-o" aria-hidden="true"></i> {{ T "readingTime" .ReadingTime }} </span>
|
||||
<span class="more-meta">
|
||||
| <i class="fa fa-comment-o" aria-hidden="true"></i>
|
||||
<a href="#gitalk-container" itemprop="discussionUrl">
|
||||
<span class="post-comments-count gitalk-comment-count" itemprop="commentCount"></span>
|
||||
</a>
|
||||
{{ .Site.Params.gitalk.countSign }}
|
||||
</span>
|
||||
{{- end }}
|
||||
{{ if and .Site.Params.busuanzi.enable .Site.Params.busuanzi.pagePV -}}
|
||||
{{ $valueSpan := printf `<span id="busuanzi_value_page_pv"><img src="%s" alt="spinner.svg"/></span>` ("img/spinner.svg" | relURL) -}}
|
||||
| <i class="fa fa-eye"></i>
|
||||
<span id="busuanzi_container_page_pv" class="more-meta"> {{ printf (T "pagePV") $valueSpan | safeHTML }} </span>
|
||||
{{- end }}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- TOC -->
|
||||
{{ partial "post/toc.html" . }}
|
||||
|
||||
<!-- Content -->
|
||||
<div class="post-content">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
||||
<!-- Copyright -->
|
||||
{{ partial "post/copyright.html" . }}
|
||||
|
||||
<!-- Reward -->
|
||||
{{ partial "post/reward.html" . }}
|
||||
|
||||
<footer class="post-footer">
|
||||
{{ with .Params.tags -}}
|
||||
<div class="post-tags">
|
||||
{{ range . }}
|
||||
<a href="{{ "tags" | relLangURL }}/{{ . | urlize }}/">{{ . }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{- end }}
|
||||
|
||||
<!-- Post Pagination -->
|
||||
<nav class="post-nav">
|
||||
{{ with .NextInSection }}
|
||||
<a class="prev" href="{{ .URL }}">
|
||||
<i class="iconfont icon-left"></i>
|
||||
<span class="prev-text nav-default">{{ .Title }}</span>
|
||||
<span class="prev-text nav-mobile">{{ T "prevPost" }}</span>
|
||||
</a>
|
||||
{{- end }}
|
||||
{{ with .PrevInSection }}
|
||||
<a class="next" href="{{ .URL }}">
|
||||
<span class="next-text nav-default">{{ .Title }}</span>
|
||||
<span class="prev-text nav-mobile">{{ T "nextPost" }}</span>
|
||||
<i class="iconfont icon-right"></i>
|
||||
</a>
|
||||
{{- end }}
|
||||
</nav>
|
||||
</footer>
|
||||
</article>
|
||||
{{- end }}
|
29
themes/custom/layouts/post/summary.html
Normal file
29
themes/custom/layouts/post/summary.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<article class="post">
|
||||
<header class="post-header">
|
||||
<h1 class="post-title"><a class="post-link" href="{{ .URL }}">{{ .Title }}</a></h1>
|
||||
<div class="post-meta">
|
||||
<span class="post-time"> <i class="fa fa-calendar" aria-hidden="true"></i> {{ .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }} </span>
|
||||
{{ with .Params.categories -}}
|
||||
| <i class="fa fa-folder" aria-hidden="true"></i>
|
||||
<div class="post-category">
|
||||
{{ range . }}
|
||||
<a href="{{ "categories" | relLangURL }}/{{ . | urlize }}/"> {{ . }} </a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{- end }}
|
||||
{{ if .Site.Params.moreMeta -}}
|
||||
<span class="more-meta"> | <i class="fa fa-book" aria-hidden="true"></i> {{ T "wordCount" .WordCount }} </span>
|
||||
<span class="more-meta"> | <i class="fa fa-clock-o" aria-hidden="true"></i> {{ T "readingTime" .ReadingTime }} </span>
|
||||
{{- end }}
|
||||
</div>
|
||||
</header>
|
||||
<!-- Content -->
|
||||
<div class="post-content">
|
||||
<div class="post-summary">
|
||||
{{ .Summary }}
|
||||
</div>
|
||||
<div class="read-more">
|
||||
<a href="{{ .URL }}" class="read-more-link">{{ T "readMore" }}...</a>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
2
themes/custom/layouts/robots.txt
Normal file
2
themes/custom/layouts/robots.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Sitemap: {{ "sitemap.xml" | absURL }}
|
3
themes/custom/layouts/shortcodes/center.html
Normal file
3
themes/custom/layouts/shortcodes/center.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<div class='align-center'>
|
||||
{{ .Inner }}
|
||||
</div>
|
3
themes/custom/layouts/shortcodes/left.html
Normal file
3
themes/custom/layouts/shortcodes/left.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<div class='align-left'>
|
||||
{{ .Inner }}
|
||||
</div>
|
62
themes/custom/layouts/shortcodes/music.html
Normal file
62
themes/custom/layouts/shortcodes/music.html
Normal file
@@ -0,0 +1,62 @@
|
||||
{{/*
|
||||
## Music 163
|
||||
|
||||
### Params:
|
||||
|
||||
- `id`
|
||||
|
||||
required param
|
||||
you can extract from music url
|
||||
url format "http://music.163.com/#/song?id=3950552"
|
||||
|
||||
- Fiddle `auto`
|
||||
|
||||
optional param
|
||||
default value 0
|
||||
you can overwrite it with 1
|
||||
|
||||
### Examples:
|
||||
|
||||
- Simple
|
||||
|
||||
{{% music "3950552" %}}
|
||||
{{% music "3950552" "1" %}}
|
||||
|
||||
- Named Params
|
||||
|
||||
{{% music id="3950552" %}}
|
||||
{{% music id="3950552" auto="1" %}}
|
||||
|
||||
*/}}
|
||||
|
||||
{{- /* DEFAULTS */ -}}
|
||||
{{ $auto := "0" }}
|
||||
|
||||
{{- if .IsNamedParams -}}
|
||||
|
||||
<iframe style="max-width: 100%"
|
||||
class="music163"
|
||||
frameborder="no"
|
||||
border="0"
|
||||
marginwidth="0"
|
||||
marginheight="0"
|
||||
width="330"
|
||||
height="86"
|
||||
src="//music.163.com/outchain/player?type=2&id={{ .Get "id" }}&auto={{ or (.Get "auto") $auto }}&height=66">
|
||||
</iframe>
|
||||
|
||||
{{- else -}}
|
||||
|
||||
<iframe style="max-width: 100%"
|
||||
class="music163"
|
||||
frameborder="no"
|
||||
border="0"
|
||||
marginwidth="0"
|
||||
marginheight="0"
|
||||
width="330"
|
||||
height="86"
|
||||
src="//music.163.com/outchain/player?type=2&id={{ .Get 0 }}&auto={{ if isset .Params 1 }}{{ .Get 1 }}{{ else }}{{ $auto }}{{ end }}&height=66">
|
||||
</iframe>
|
||||
|
||||
{{- end -}}
|
||||
|
3
themes/custom/layouts/shortcodes/right.html
Normal file
3
themes/custom/layouts/shortcodes/right.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<div class='align-right'>
|
||||
{{ .Inner }}
|
||||
</div>
|
11
themes/custom/layouts/sitemap.xml
Normal file
11
themes/custom/layouts/sitemap.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
{{ "<?" | safeHTML }}xml-stylesheet type="text/xsl" href="{{ "sitemap.xsl" | absURL }}"{{ "?>" | safeHTML }}
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
{{ range .Data.Pages }}
|
||||
<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 }}
|
||||
</url>
|
||||
{{ end }}
|
||||
</urlset>
|
Reference in New Issue
Block a user