diff options
author | olOwOlo <26087907+olOwOlo@users.noreply.github.com> | 2017-08-27 22:38:42 +0800 |
---|---|---|
committer | olOwOlo <26087907+olOwOlo@users.noreply.github.com> | 2017-08-27 22:38:42 +0800 |
commit | 3c6cb7f29631dfcdd954e7cbd5d2370efe7eb827 (patch) | |
tree | d374e090981dda28452dbd13400e377b9cc06277 /layouts |
๐ first commit
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/404.html | 18 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 39 | ||||
-rw-r--r-- | layouts/_default/section.html | 56 | ||||
-rw-r--r-- | layouts/_default/single.html | 7 | ||||
-rw-r--r-- | layouts/_default/single.md | 1 | ||||
-rw-r--r-- | layouts/_default/taxonomy.html | 47 | ||||
-rw-r--r-- | layouts/_default/terms.html | 45 | ||||
-rw-r--r-- | layouts/index.html | 25 | ||||
-rw-r--r-- | layouts/partials/comments.html | 35 | ||||
-rw-r--r-- | layouts/partials/footer.html | 37 | ||||
-rw-r--r-- | layouts/partials/head.html | 71 | ||||
-rw-r--r-- | layouts/partials/header.html | 13 | ||||
-rw-r--r-- | layouts/partials/post/copyright.html | 33 | ||||
-rw-r--r-- | layouts/partials/post/reward.html | 19 | ||||
-rw-r--r-- | layouts/partials/post/toc.html | 8 | ||||
-rw-r--r-- | layouts/partials/scripts.html | 55 | ||||
-rw-r--r-- | layouts/partials/slideout.html | 19 | ||||
-rw-r--r-- | layouts/post/single.html | 64 | ||||
-rw-r--r-- | layouts/post/summary.html | 27 | ||||
-rw-r--r-- | layouts/robots.txt | 2 | ||||
-rw-r--r-- | layouts/shortcodes/music.html | 62 | ||||
-rw-r--r-- | layouts/sitemap.xml | 11 |
22 files changed, 694 insertions, 0 deletions
diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..81a37e9 --- /dev/null +++ b/layouts/404.html @@ -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="/">โ 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 }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..11f33fc --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<html lang="{{ $.Site.LanguageCode | default "en" }}"> +<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" . }} + <div class="container" id="mobile-panel"> + <header id="header" class="header"> + {{ partial "header.html" . }} + </header> + + <main id="main" class="main"> + <div class="content-wrapper"> + <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> diff --git a/layouts/_default/section.html b/layouts/_default/section.html new file mode 100644 index 0000000..029226c --- /dev/null +++ b/layouts/_default/section.html @@ -0,0 +1,56 @@ +{{ define "title" }}{{ .Site.Data.even.default.archive }} - {{ .Site.Title }}{{ end }} + +{{ define "content"}} +{{- $lang := .Site.Data.even.default }} +{{- $paginator := .Paginate (where .Data.Pages.ByDate.Reverse "Type" "post") (index .Site.Params "archive-paginate") }} +<section id="archive" class="archive"> + {{- if not $paginator.HasPrev }} + <div class="archive-title"> + <span class="archive-post-counter"> + {{- $length := len .Data.Pages }} + {{- if eq $length 0 }} + {{ $lang.counter.archives.zero }} + {{ else }} + {{ printf $lang.counter.archives.other $length }} + {{ end -}} + </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">{{ $lang.posts.prev }}</span> + </a> + {{- end }} + {{ with $paginator.Next -}} + <a class="next" href="{{ .URL }}"> + <span class="next-text">{{ $lang.posts.next }}</span> + <i class="iconfont icon-right"></i> + </a> + {{- end }} +</nav> +{{ end }}
\ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..a1c30fd --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,7 @@ +{{ define "content" -}} +<article class="post"> + <div class="post-content"> + {{ .Content }} + </div> +</article> +{{- end }}
\ No newline at end of file diff --git a/layouts/_default/single.md b/layouts/_default/single.md new file mode 100644 index 0000000..57705e2 --- /dev/null +++ b/layouts/_default/single.md @@ -0,0 +1 @@ +{{ .RawContent }}
\ No newline at end of file diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html new file mode 100644 index 0000000..b2e4643 --- /dev/null +++ b/layouts/_default/taxonomy.html @@ -0,0 +1,47 @@ +{{ define "title" }}{{ .Title }} ยท {{ .Site.Title }}{{ end }} + +{{ define "content"}} +{{ $paginator := .Paginate (where .Data.Pages.ByDate.Reverse "Type" "post") (index .Site.Params "archive-paginate") }} +<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 "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"> + {{- $lang := .Site.Data.even.default -}} + {{ with $paginator.Prev }} + <a class="prev" href="{{ .URL }}"> + <i class="iconfont icon-left"></i> + <span class="prev-text">{{ $lang.posts.prev }}</span> + </a> + {{- end }} + {{ with $paginator.Next }} + <a class="next" href="{{ .URL }}"> + <span class="next-text">{{ $lang.posts.next }}</span> + <i class="iconfont icon-right"></i> + </a> + {{- end }} +</nav> +{{ end }}
\ No newline at end of file diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html new file mode 100644 index 0000000..b43eb76 --- /dev/null +++ b/layouts/_default/terms.html @@ -0,0 +1,45 @@ +{{ define "title" }}{{ index .Site.Data.even.default .Data.Plural }} - {{ .Site.Title }}{{ end }} + +{{ define "content" }} + {{ $lang := .Site.Data.even.default -}} + {{ $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 }} + {{ $lang.counter.categories.zero }} + {{ else }} + {{ printf $lang.counter.categories.other $length }} + {{ end }} + </div> + <div class="categories-tags"> + {{ range $key, $value := $terms }} + <a class="category-link" href="/{{ $name | urlize }}/{{ $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 }} + {{ $lang.counter.tagcloud.zero }} + {{ else }} + {{ printf $lang.counter.tagcloud.other $length}} + {{ end }} + </div> + <div class="tag-cloud-tags"> + {{ range $key, $value := $terms }} + <a href="/{{ $name | urlize }}/{{ $value.Term | urlize }}/"> + {{ $value.Term }} + <span class="tag-count">{{ len $value.Pages }}</span> + </a> + {{ end }} + </div> + </div> + {{ end }} +{{ end }}
\ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..1a16497 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,25 @@ +{{ define "content" }} + <section id="posts" class="posts"> + {{/* (index .Site.Paginate) */}} + {{ $paginator := .Paginate (where .Data.Pages "Type" "post") }} + {{ range $paginator.Pages }} + {{ .Render "summary" }} + {{ end }} + </section> + <!-- pagination --> + <nav class="pagination"> + {{- $lang := .Site.Data.even.default -}} + {{ with $paginator.Prev }} + <a class="prev" href="{{ .URL }}"> + <i class="iconfont icon-left"></i> + <span class="prev-text">{{ $lang.posts.prev }}</span> + </a> + {{- end }} + {{ with $paginator.Next }} + <a class="next" href="{{ .URL }}"> + <span class="next-text">{{ $lang.posts.next }}</span> + <i class="iconfont icon-right"></i> + </a> + {{- end }} + </nav> +{{ end }}
\ No newline at end of file diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html new file mode 100644 index 0000000..fea1a33 --- /dev/null +++ b/layouts/partials/comments.html @@ -0,0 +1,35 @@ +{{ if and .IsPage (ne .Params.comment false) }} + <!-- Disqus --> + {{- if .Site.DisqusShortname -}} + <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... + if (window.location.hostname === 'localhost') return; + + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + var disqus_shortname = '{{ .Site.DisqusShortname }}'; + 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="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> + <a href="http://disqus.com/" class="dsq-brlink" target="_blank">comments powered by <span class="logo-disqus">Disqus</span></a> + {{- 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 async id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="http://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.async = true;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("http://changyan.sohu.com/upload/changyan.js",function(){window.changyan.api.config({appid:appid,conf:conf})}); } + })(); + </script> + {{- end }} +{{- end }}
\ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..246f26a --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,37 @@ +<div class="social-links"> + {{- range $name, $path := .Site.Params.social }} + {{- if $path }} + {{- $realName := slicestr $name 2 }} + {{- if eq $realName "email" }} + <a href="mailto:{{ $path }}" class="iconfont icon-{{ $realName }}" title="{{ $realName }}"></a> + {{- else }} + <a href="{{ $path }}" class="iconfont icon-{{ $realName }}" title="{{ $realName }}"></a> + {{- end }} + {{- end }} + {{- end }} + <a href="{{ .Site.RSSLink }}" type="application/rss+xml" class="iconfont icon-rss" title="rss"></a> +</div> + +<div class="copyright"> + <span class="power-by"> + {{ (printf .Site.Data.even.default.footer.powered `<a class="hexo-link" href="https://gohugo.io">Hugo</a>`) | safeHTML }} + </span> + <span class="division">|</span> + <span class="theme-info"> + {{ .Site.Data.even.default.footer.theme }} - + <a class="theme-link" href="https://github.com/ahonn/hexo-theme-even">Even</a> + </span> + + <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">{{ .Site.Author.name }}</span> + </span> +</div>
\ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..0310b16 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,71 @@ +<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"> +<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> +<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> +<link rel="icon" href="/favicon.ico" /> +<link rel="manifest" href="/manifest.json"> +<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"> + +<!-- Styles --> +<link href="/dist/even.v{{ .Site.Params.version }}.css" rel="stylesheet"> +{{ if .Site.Params.bootcdn -}} + {{ if .Site.Params.fancybox }}<link href="https://cdn.bootcss.com/fancybox/3.1.20/jquery.fancybox.min.css" rel="stylesheet">{{ end }} +{{ else -}} + {{ if .Site.Params.fancybox }}<link href="/lib/fancybox/jquery.fancybox-3.1.20.min.css" rel="stylesheet">{{ end }} +{{- 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 lt IE 9]> + <script src="//cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script> + <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> +<![endif]-->` | safeHTML }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..a8a555a --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,13 @@ +<div class="logo-wrapper"> + <a href="/" class="logo">{{ .Site.Title }}</a> +</div> + +<nav class="site-navbar"> + <ul id="menu" class="menu"> + {{ range .Site.Menus.main -}} + <li class="menu-item"> + <a class="menu-item-link" href="{{ .URL }}">{{ .Name }}</a> + </li> + {{- end }} + </ul> +</nav>
\ No newline at end of file diff --git a/layouts/partials/post/copyright.html b/layouts/partials/post/copyright.html new file mode 100644 index 0000000..6908b10 --- /dev/null +++ b/layouts/partials/post/copyright.html @@ -0,0 +1,33 @@ +{{ if and .Site.Copyright (ne .Params.copyright false) }} +{{ $lang := .Site.Data.even.default -}} +<div class="post-copyright"> + <p class="copyright-item"> + <span class="item-title">{{ $lang.copyright.author }}: </span> + <span>{{ if .Params.author }}{{ .Params.author | safeHTML }}{{ else }}{{ .Site.Author.name | safeHTML }}{{ end }}</span> + </p> + <p class="copyright-item"> + <span class="item-title">{{ $lang.copyright.lastMod }}: </span> + {{ .Lastmod.Format "2006-01-02" }} + </p> + <p class="copyright-item"> + <span class="item-title">{{ $lang.copyright.link }}: </span> + <a href="{{ .Permalink }}">{{ .Permalink }}</a> + </p> + {{ if $.Site.Params.linkToMarkDown -}} + {{ with $.OutputFormats.Get "markdown" -}} + <p class="copyright-item"> + <span class="item-title">{{ $lang.copyright.markdown }}: </span> + <a class="link-to-markdown" href="{{ .Permalink }}" target="_blank">{{ $lang.posts.seeMarkDown }}</a> + </p> + {{- end }} + {{- end }} + <p class="copyright-item lincese"> + <span class="item-title">{{ $lang.copyright.lincese }}: </span> + {{ if .Params.copyright -}} + {{ .Params.copyright | safeHTML }} + {{ else -}} + {{ .Site.Copyright | safeHTML }} + {{- end }} + </p> +</div> +{{- end }}
\ No newline at end of file diff --git a/layouts/partials/post/reward.html b/layouts/partials/post/reward.html new file mode 100644 index 0000000..5a26cd7 --- /dev/null +++ b/layouts/partials/post/reward.html @@ -0,0 +1,19 @@ +{{ if 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">{{ .Site.Data.even.default.posts.reward }}</label> + <div class="qr-code"> + {{ $qrCode := .Site.Params.reward }} + {{ with $qrCode.wechat }} + <label class="qr-code-image" for="reward"> + <img class="image" src="{{ . }}" title="wechat"> + </label> + {{- end }} + {{ with $qrCode.alipay }} + <label class="qr-code-image" for="reward"> + <img class="image" src="{{ . }}" title="alipay"> + </label> + {{- end }} + </div> +</div> +{{- end }}
\ No newline at end of file diff --git a/layouts/partials/post/toc.html b/layouts/partials/post/toc.html new file mode 100644 index 0000000..7921065 --- /dev/null +++ b/layouts/partials/post/toc.html @@ -0,0 +1,8 @@ +{{ if and .Site.Params.toc (ne .Params.toc false) }} +<div class="post-toc" id="post-toc"> + <h2 class="post-toc-title">{{ .Site.Data.even.default.posts.toc }}</h2> + <div class="post-toc-content"> + {{.TableOfContents}} + </div> +</div> +{{- end }}
\ No newline at end of file diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html new file mode 100644 index 0000000..d1eefa8 --- /dev/null +++ b/layouts/partials/scripts.html @@ -0,0 +1,55 @@ +<!-- js --> +<script src="/lib/highlight/highlight.pack.js"></script> +{{ if .Site.Params.bootcdn -}} + <!-- script src="https://cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js"></script --> + <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> + <script type="text/javascript" src="https://cdn.bootcss.com/slideout/1.0.1/slideout.min.js"></script> + {{ if .Site.Params.fancybox }}<script type="text/javascript" src="https://cdn.bootcss.com/fancybox/3.1.20/jquery.fancybox.min.js"></script>{{ end }} + <script type="text/javascript" src="/dist/even.v{{ .Site.Params.version }}.js"></script> +{{ else -}} + <script type="text/javascript" src="/lib/jquery/jquery-3.2.1.min.js"></script> + <script type="text/javascript" src="/lib/slideout/slideout-1.0.1.min.js"></script> + {{ if .Site.Params.fancybox }}<script type="text/javascript" src="/lib/fancybox/jquery.fancybox-3.1.20.min.js"></script>{{ end }} + <script type="text/javascript" src="/dist/even.v{{ .Site.Params.version }}.js"></script> +{{- end }} + +{{ if and (and .Site.Params.mathjax (ne .Params.mathjax false)) (or .IsPage .IsHome) -}} + <script async src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/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 }} + +<!-- baidu_push --> +{{- if .Site.Params.baidu_push -}} +<script id="baidu_push"> + (function(){ + if (window.location.hostname === 'localhost') return; + var bp = document.createElement('script'); bp.async = true; + var curProtocol = window.location.protocol.split(':')[0]; + if (curProtocol === 'https') { + bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; + } + else { + bp.src = 'http://push.zhanzhang.baidu.com/push.js'; + } + var s = document.getElementsByTagName("script")[0]; + s.parentNode.insertBefore(bp, s); + })(); +</script> +{{- end }}
\ No newline at end of file diff --git a/layouts/partials/slideout.html b/layouts/partials/slideout.html new file mode 100644 index 0000000..4ec6344 --- /dev/null +++ b/layouts/partials/slideout.html @@ -0,0 +1,19 @@ +<div id="mobile-navbar" class="mobile-navbar"> + <div class="mobile-header-logo"> + <a href="/" class="logo">{{ .Site.Title }}</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 }}"> + <li class="mobile-menu-item">{{ .Name }}</li> + </a> + {{- end }} + </ul> +</nav>
\ No newline at end of file diff --git a/layouts/post/single.html b/layouts/post/single.html new file mode 100644 index 0000000..81c0939 --- /dev/null +++ b/layouts/post/single.html @@ -0,0 +1,64 @@ +{{ define "content" -}} + {{ $lang := .Site.Data.even.default -}} + <article class="post"> + <!-- post-header --> + <header class="post-header"> + <h1 class="post-title">{{ .Title }}</h1> + + <div class="post-meta"> + <span class="post-time"> + {{ .Date.Format "2006-01-02" }} + </span> + {{ with .Params.categories -}} + <div class="post-category"> + {{ range . -}} + <a href="/categories/{{ . | urlize }}">{{ . }}</a> + {{- end }} + </div> + {{- 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/{{ . | 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">{{ $lang.posts.prev_post }}</span> + </a> + {{- end }} + {{ with .PrevInSection }} + <a class="next" href="{{ .URL }}"> + <span class="next-text nav-default">{{ .Title }}</span> + <span class="prev-text nav-mobile">{{ $lang.posts.next_post }}</span> + <i class="iconfont icon-right"></i> + </a> + {{- end }} + </nav> + </footer> + </article> +{{- end }}
\ No newline at end of file diff --git a/layouts/post/summary.html b/layouts/post/summary.html new file mode 100644 index 0000000..8a4e774 --- /dev/null +++ b/layouts/post/summary.html @@ -0,0 +1,27 @@ +{{ $lang := .Site.Data.even.default -}} +<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"> + {{ .Date.Format "2006-01-02" }} + </span> + {{ with .Params.categories -}} + <div class="post-category"> + {{ range . -}} + <a href="/categories/{{ . | urlize }}">{{ . }}</a> + {{- end }} + </div> + {{- 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">{{ $lang.posts.readmore }}</a> + </div> + </div> +</article>
\ No newline at end of file diff --git a/layouts/robots.txt b/layouts/robots.txt new file mode 100644 index 0000000..319bc3a --- /dev/null +++ b/layouts/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Sitemap: {{ .Site.BaseURL }}sitemap.xml diff --git a/layouts/shortcodes/music.html b/layouts/shortcodes/music.html new file mode 100644 index 0000000..22b2268 --- /dev/null +++ b/layouts/shortcodes/music.html @@ -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 -}} +
\ No newline at end of file diff --git a/layouts/sitemap.xml b/layouts/sitemap.xml new file mode 100644 index 0000000..b3fe471 --- /dev/null +++ b/layouts/sitemap.xml @@ -0,0 +1,11 @@ +{{ "<?" | safeHTML }}xml-stylesheet type="text/xsl" href="{{ .Site.BaseURL }}sitemap.xsl"{{ "?>" | 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>
\ No newline at end of file |