From 3c6cb7f29631dfcdd954e7cbd5d2370efe7eb827 Mon Sep 17 00:00:00 2001 From: olOwOlo <26087907+olOwOlo@users.noreply.github.com> Date: Sun, 27 Aug 2017 22:38:42 +0800 Subject: 🎉 first commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layouts/404.html | 18 +++++++++ layouts/_default/baseof.html | 39 ++++++++++++++++++++ layouts/_default/section.html | 56 ++++++++++++++++++++++++++++ layouts/_default/single.html | 7 ++++ layouts/_default/single.md | 1 + layouts/_default/taxonomy.html | 47 ++++++++++++++++++++++++ layouts/_default/terms.html | 45 +++++++++++++++++++++++ layouts/index.html | 25 +++++++++++++ layouts/partials/comments.html | 35 ++++++++++++++++++ layouts/partials/footer.html | 37 +++++++++++++++++++ layouts/partials/head.html | 71 ++++++++++++++++++++++++++++++++++++ layouts/partials/header.html | 13 +++++++ layouts/partials/post/copyright.html | 33 +++++++++++++++++ layouts/partials/post/reward.html | 19 ++++++++++ layouts/partials/post/toc.html | 8 ++++ layouts/partials/scripts.html | 55 ++++++++++++++++++++++++++++ layouts/partials/slideout.html | 19 ++++++++++ layouts/post/single.html | 64 ++++++++++++++++++++++++++++++++ layouts/post/summary.html | 27 ++++++++++++++ layouts/robots.txt | 2 + layouts/shortcodes/music.html | 62 +++++++++++++++++++++++++++++++ layouts/sitemap.xml | 11 ++++++ 22 files changed, 694 insertions(+) create mode 100644 layouts/404.html create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/section.html create mode 100644 layouts/_default/single.html create mode 100644 layouts/_default/single.md create mode 100644 layouts/_default/taxonomy.html create mode 100644 layouts/_default/terms.html create mode 100644 layouts/index.html create mode 100644 layouts/partials/comments.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/head.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/post/copyright.html create mode 100644 layouts/partials/post/reward.html create mode 100644 layouts/partials/post/toc.html create mode 100644 layouts/partials/scripts.html create mode 100644 layouts/partials/slideout.html create mode 100644 layouts/post/single.html create mode 100644 layouts/post/summary.html create mode 100644 layouts/robots.txt create mode 100644 layouts/shortcodes/music.html create mode 100644 layouts/sitemap.xml (limited to 'layouts') 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" }} +
+

+

/* 404 page not found. */

+ +
+ +{{ 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 @@ + + + + + + + {{- block "title" . -}} + {{ if .IsPage }}{{ .Title }} - {{ .Site.Title }}{{ else }}{{ .Site.Title }}{{ end }} + {{- end -}} + + {{ partial "head.html" . }} + + + {{ partial "slideout.html" . }} +
+ + +
+
+
+ {{ block "content" . }}{{ end }} +
+ {{ partial "comments.html" . }} +
+
+ + + +
+ +
+
+ {{ partial "scripts.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") }} +
+ {{- if not $paginator.HasPrev }} +
+ + {{- $length := len .Data.Pages }} + {{- if eq $length 0 }} + {{ $lang.counter.archives.zero }} + {{ else }} + {{ printf $lang.counter.archives.other $length }} + {{ end -}} + +
+ {{- 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 ) }} +
+

{{ $thisYear }}

+
+ {{- end }} + +
+ + {{ $element.Date.Format "01-02" }} + + + + {{ .Title }} + + +
+ {{- end -}} +
+ + +{{ 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" -}} +
+
+ {{ .Content }} +
+
+{{- 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") }} +
+ {{ if not $paginator.HasPrev }} + {{ if eq .Data.Plural "tags" }} +
+

{{ .Title }}

+
+ {{ else if eq .Data.Plural "categories" }} +
+

{{ .Title }}

+
+ {{ end }} + {{ end }} + + {{ range $paginator.Pages }} +
+ + {{ .Date.Format "2006-01-02" }} + + + + {{ .Title }} + + +
+ {{ end }} +
+ + +{{ 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" }} +
+
+ {{ if eq $length 0 }} + {{ $lang.counter.categories.zero }} + {{ else }} + {{ printf $lang.counter.categories.other $length }} + {{ end }} +
+
+ {{ range $key, $value := $terms }} + + {{ $value.Term }} + {{ len $value.Pages }} + + {{ end }} +
+
+ {{ else if eq $name "tags" }} +
+
+ {{ if eq $length 0 }} + {{ $lang.counter.tagcloud.zero }} + {{ else }} + {{ printf $lang.counter.tagcloud.other $length}} + {{ end }} +
+
+ {{ range $key, $value := $terms }} + + {{ $value.Term }} + {{ len $value.Pages }} + + {{ end }} +
+
+ {{ 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" }} +
+ {{/* (index .Site.Paginate) */}} + {{ $paginator := .Paginate (where .Data.Pages "Type" "post") }} + {{ range $paginator.Pages }} + {{ .Render "summary" }} + {{ end }} +
+ + +{{ 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) }} + + {{- if .Site.DisqusShortname -}} +
+ + + comments powered by Disqus + {{- end }} + + + {{- if and .Site.Params.changyanAppid .Site.Params.changyanAppkey -}} +
+ + {{- 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 @@ + + + \ 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 @@ + + + + + + + + + + + + + + +{{- if .Description -}} + +{{ else if .IsPage }} + +{{ else if .Site.Params.description }} + +{{- end -}} + +{{- if .Keywords -}} + {{ $length := len .Keywords | add -1 -}} + +{{ else if .Site.Params.keywords }} + {{ $length := len .Site.Params.keywords | add -1 -}} + +{{- end }} + + +{{ with .Site.Params.baidu_verification }}{{ end }} +{{ with .Site.Params.google_verification }}{{ end }} + + + + + + +{{ if .RSSLink -}} + + +{{ end -}} + + + + + + + + + + + +{{ if .Site.Params.bootcdn -}} + {{ if .Site.Params.fancybox }}{{ end }} +{{ else -}} + {{ if .Site.Params.fancybox }}{{ 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" . -}} + + +{{ `` | 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 @@ +
+ +
+ + \ 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 -}} +
+ + + + {{ if $.Site.Params.linkToMarkDown -}} + {{ with $.OutputFormats.Get "markdown" -}} + + {{- end }} + {{- end }} + +
+{{- 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) }} +
+ + +
+ {{ $qrCode := .Site.Params.reward }} + {{ with $qrCode.wechat }} + + {{- end }} + {{ with $qrCode.alipay }} + + {{- end }} +
+
+{{- 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) }} +
+

{{ .Site.Data.even.default.posts.toc }}

+
+ {{.TableOfContents}} +
+
+{{- 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 @@ + + +{{ if .Site.Params.bootcdn -}} + + + + {{ if .Site.Params.fancybox }}{{ end }} + +{{ else -}} + + + {{ if .Site.Params.fancybox }}{{ end }} + +{{- end }} + +{{ if and (and .Site.Params.mathjax (ne .Params.mathjax false)) (or .IsPage .IsHome) -}} + +{{- end }} + + +{{- if .Site.GoogleAnalytics -}} + {{ template "_internal/google_analytics_async.html" . }} +{{- end -}} + +{{- with .Site.Params.baidu_analytics -}} + +{{- end }} + + +{{- if .Site.Params.baidu_push -}} + +{{- 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 @@ +
+ +
+ + + +
+
+ \ 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 -}} +
+ +
+

{{ .Title }}

+ + +
+ + + {{ partial "post/toc.html" . }} + + +
+ {{ .Content }} +
+ + + {{ partial "post/copyright.html" . }} + + + {{ partial "post/reward.html" . }} + + +
+{{- 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 -}} +
+
+

{{ .Title }}

+ +
+ +
+
+ {{ .Summary }} +
+ +
+
\ 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 -}} + + + + {{- else -}} + + + + {{- 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 }} + + {{ range .Data.Pages }} + + {{ .Permalink }}{{ if not .Lastmod.IsZero }} + {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} + {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} + {{ .Sitemap.Priority }}{{ end }} + + {{ end }} + \ No newline at end of file -- cgit v1.2.3