From a62a3e7755579d93ce3a87243dd277575930fffe Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Mon, 5 Nov 2018 21:49:16 -0500 Subject: init --- themes/even/layouts/404.html | 18 ++++ themes/even/layouts/_default/baseof.html | 46 +++++++++ themes/even/layouts/_default/section.html | 50 +++++++++ themes/even/layouts/_default/single.html | 7 ++ themes/even/layouts/_default/single.md | 1 + themes/even/layouts/_default/taxonomy.html | 46 +++++++++ themes/even/layouts/_default/terms.html | 44 ++++++++ themes/even/layouts/index.html | 24 +++++ themes/even/layouts/partials/comments.html | 109 +++++++++++++++++++ themes/even/layouts/partials/footer.html | 52 ++++++++++ themes/even/layouts/partials/head.html | 90 ++++++++++++++++ themes/even/layouts/partials/header.html | 19 ++++ themes/even/layouts/partials/post/copyright.html | 32 ++++++ .../partials/post/outdated-info-warning.html | 28 +++++ themes/even/layouts/partials/post/reward.html | 21 ++++ themes/even/layouts/partials/post/toc.html | 9 ++ themes/even/layouts/partials/scripts.html | 115 +++++++++++++++++++++ themes/even/layouts/partials/slideout.html | 25 +++++ themes/even/layouts/post/single.html | 72 +++++++++++++ themes/even/layouts/post/summary.html | 28 +++++ themes/even/layouts/robots.txt | 2 + themes/even/layouts/shortcodes/center.html | 3 + themes/even/layouts/shortcodes/left.html | 3 + themes/even/layouts/shortcodes/music.html | 62 +++++++++++ themes/even/layouts/shortcodes/right.html | 3 + themes/even/layouts/sitemap.xml | 11 ++ 26 files changed, 920 insertions(+) create mode 100644 themes/even/layouts/404.html create mode 100644 themes/even/layouts/_default/baseof.html create mode 100644 themes/even/layouts/_default/section.html create mode 100644 themes/even/layouts/_default/single.html create mode 100644 themes/even/layouts/_default/single.md create mode 100644 themes/even/layouts/_default/taxonomy.html create mode 100644 themes/even/layouts/_default/terms.html create mode 100644 themes/even/layouts/index.html create mode 100644 themes/even/layouts/partials/comments.html create mode 100644 themes/even/layouts/partials/footer.html create mode 100644 themes/even/layouts/partials/head.html create mode 100644 themes/even/layouts/partials/header.html create mode 100644 themes/even/layouts/partials/post/copyright.html create mode 100644 themes/even/layouts/partials/post/outdated-info-warning.html create mode 100644 themes/even/layouts/partials/post/reward.html create mode 100644 themes/even/layouts/partials/post/toc.html create mode 100644 themes/even/layouts/partials/scripts.html create mode 100644 themes/even/layouts/partials/slideout.html create mode 100644 themes/even/layouts/post/single.html create mode 100644 themes/even/layouts/post/summary.html create mode 100644 themes/even/layouts/robots.txt create mode 100644 themes/even/layouts/shortcodes/center.html create mode 100644 themes/even/layouts/shortcodes/left.html create mode 100644 themes/even/layouts/shortcodes/music.html create mode 100644 themes/even/layouts/shortcodes/right.html create mode 100644 themes/even/layouts/sitemap.xml (limited to 'themes/even/layouts') diff --git a/themes/even/layouts/404.html b/themes/even/layouts/404.html new file mode 100644 index 0000000..fcf2b37 --- /dev/null +++ b/themes/even/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/themes/even/layouts/_default/baseof.html b/themes/even/layouts/_default/baseof.html new file mode 100644 index 0000000..0693148 --- /dev/null +++ b/themes/even/layouts/_default/baseof.html @@ -0,0 +1,46 @@ +{{ if ne .Site.Params.version "3.x" -}} +{{ errorf "\n\nThere are two possible situations that led to this error:\n 1. You haven't copied the config.toml yet. See https://github.com/olOwOlo/hugo-theme-even#installation \n 2. You have an incompatible update. See https://github.com/olOwOlo/hugo-theme-even/blob/master/CHANGELOG.md#300 \n\n有两种可能的情况会导致这个错误发生:\n 1. 你还没有复制 config.toml 参考 https://github.com/olOwOlo/hugo-theme-even/blob/master/README-zh.md#installation \n 2. 你进行了一次不兼容的更新 参考 https://github.com/olOwOlo/hugo-theme-even/blob/master/CHANGELOG.md#300 \n" -}} +{{ end -}} + + + + + + + {{- block "title" . -}} + {{ if .IsPage }}{{ .Title }} - {{ .Site.Title }}{{ else }}{{ .Site.Title }}{{ end }} + {{- end -}} + + {{ partial "head.html" . }} + + + {{ partial "slideout.html" . }} +
+ {{ if not .Params.hideHeaderAndFooter -}} + + {{- end }} + +
+
+
+ {{ block "content" . }}{{ end }} +
+ {{ partial "comments.html" . }} +
+
+ + {{ if not .Params.hideHeaderAndFooter -}} +
+ {{ partial "footer.html" . }} +
+ {{- end }} + +
+ +
+
+ {{ partial "scripts.html" . }} + + diff --git a/themes/even/layouts/_default/section.html b/themes/even/layouts/_default/section.html new file mode 100644 index 0000000..fbe80f1 --- /dev/null +++ b/themes/even/layouts/_default/section.html @@ -0,0 +1,50 @@ +{{ define "title" }}{{ T "archive" }} - {{ .Site.Title }}{{ end }} + +{{ define "content"}} +{{- $paginator := .Paginate .Data.Pages.ByDate.Reverse .Site.Params.archivePaginate }} +
+ {{- if and (not $paginator.HasPrev) .Site.Params.showArchiveCount }} +
+ + {{ T "archiveCounter" (len .Data.Pages) }} + +
+ {{- 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 }} diff --git a/themes/even/layouts/_default/single.html b/themes/even/layouts/_default/single.html new file mode 100644 index 0000000..a1c30fd --- /dev/null +++ b/themes/even/layouts/_default/single.html @@ -0,0 +1,7 @@ +{{ define "content" -}} +
+
+ {{ .Content }} +
+
+{{- end }} \ No newline at end of file diff --git a/themes/even/layouts/_default/single.md b/themes/even/layouts/_default/single.md new file mode 100644 index 0000000..57705e2 --- /dev/null +++ b/themes/even/layouts/_default/single.md @@ -0,0 +1 @@ +{{ .RawContent }} \ No newline at end of file diff --git a/themes/even/layouts/_default/taxonomy.html b/themes/even/layouts/_default/taxonomy.html new file mode 100644 index 0000000..d0c8d43 --- /dev/null +++ b/themes/even/layouts/_default/taxonomy.html @@ -0,0 +1,46 @@ +{{ define "title" }}{{ .Title }} · {{ .Site.Title }}{{ end }} + +{{ define "content"}} +{{ $paginator := .Paginate .Data.Pages.ByDate.Reverse .Site.Params.archivePaginate }} +
+ {{ if not $paginator.HasPrev }} + {{ if eq .Data.Plural "tags" }} +
+

{{ .Title }}

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

{{ .Title }}

+
+ {{ end }} + {{ end }} + + {{ range $paginator.Pages }} +
+ + {{ .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }} + + + + {{ .Title }} + + +
+ {{ end }} +
+ + +{{ end }} diff --git a/themes/even/layouts/_default/terms.html b/themes/even/layouts/_default/terms.html new file mode 100644 index 0000000..04b98f8 --- /dev/null +++ b/themes/even/layouts/_default/terms.html @@ -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" }} +
+
+ {{ if eq $length 0 }} + {{ T "zeroCategoryCounter" }} + {{ else }} + {{ T "categoryCounter" $length }} + {{ end }} +
+
+ {{ range $key, $value := $terms }} + + {{ $value.Term }} + {{ len $value.Pages }} + + {{ end }} +
+
+ {{ else if eq $name "tags" }} +
+
+ {{ if eq $length 0 }} + {{ T "zeroTagCounter" }} + {{ else }} + {{ T "tagCounter" $length }} + {{ end }} +
+
+ {{ range $key, $value := $terms }} + + {{ $value.Term }} + {{ len $value.Pages }} + + {{ end }} +
+
+ {{ end }} +{{ end }} \ No newline at end of file diff --git a/themes/even/layouts/index.html b/themes/even/layouts/index.html new file mode 100644 index 0000000..26d6869 --- /dev/null +++ b/themes/even/layouts/index.html @@ -0,0 +1,24 @@ +{{ define "content" }} +
+ {{/* (index .Site.Paginate) */}} + {{ $paginator := .Paginate (where (where .Data.Pages "Type" "post") ".Params.hiddenfromhomepage" "!=" true) }} + {{ range $paginator.Pages }} + {{ .Render "summary" }} + {{ end }} +
+ + +{{ end }} \ No newline at end of file diff --git a/themes/even/layouts/partials/comments.html b/themes/even/layouts/partials/comments.html new file mode 100644 index 0000000..440240a --- /dev/null +++ b/themes/even/layouts/partials/comments.html @@ -0,0 +1,109 @@ +{{ if and .IsPage (ne .Params.comment false) }} + + {{- if .Site.DisqusShortname -}} +
+ + + {{- end -}} + + + {{- if and .Site.Params.changyanAppid .Site.Params.changyanAppkey -}} +
+ + {{- end -}} + + + {{- if .Site.Params.livereUID -}} +
+ + +
+ {{- end -}} + + + {{- if .Site.Params.gitment.owner -}} +
+ {{ if .Site.Params.publicCDN.enable -}} + {{ .Site.Params.publicCDN.gitmentCSS | safeHTML }} + {{ .Site.Params.publicCDN.gitmentJS | safeHTML }} + {{- else -}} + + + {{- end }} + + + {{- end }} + + + {{- if .Site.Params.gitalk.owner -}} +
+ {{ if .Site.Params.publicCDN.enable -}} + {{ .Site.Params.publicCDN.gitalkCSS | safeHTML }} + {{ .Site.Params.publicCDN.gitalkJS | safeHTML }} + {{- else -}} + + + {{- end }} + + + {{- end }} + +{{- end }} diff --git a/themes/even/layouts/partials/footer.html b/themes/even/layouts/partials/footer.html new file mode 100644 index 0000000..b6a1fa5 --- /dev/null +++ b/themes/even/layouts/partials/footer.html @@ -0,0 +1,52 @@ + + + \ No newline at end of file diff --git a/themes/even/layouts/partials/head.html b/themes/even/layouts/partials/head.html new file mode 100644 index 0000000..86ab6cf --- /dev/null +++ b/themes/even/layouts/partials/head.html @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + +{{- 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.debug }} + + +{{- end }} + + +{{ if .Site.Params.busuanzi.enable -}} + +{{- end }} + + + +{{ if .Site.Params.publicCDN.enable -}} + {{ if .Site.Params.fancybox }}{{ .Site.Params.publicCDN.fancyboxCss | safeHTML }}{{ end }} +{{- else -}} + {{ if .Site.Params.fancybox }}{{ end }} +{{- end }} + + +{{ range .Site.Params.customCSS }} + +{{ 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 }} + +{{ `` | safeHTML }} diff --git a/themes/even/layouts/partials/header.html b/themes/even/layouts/partials/header.html new file mode 100644 index 0000000..3592e88 --- /dev/null +++ b/themes/even/layouts/partials/header.html @@ -0,0 +1,19 @@ +
+ +
+ + \ No newline at end of file diff --git a/themes/even/layouts/partials/post/copyright.html b/themes/even/layouts/partials/post/copyright.html new file mode 100644 index 0000000..cd42d68 --- /dev/null +++ b/themes/even/layouts/partials/post/copyright.html @@ -0,0 +1,32 @@ +{{ if or .Params.postMetaInFooter (and .Site.Params.postMetaInFooter (ne .Params.postMetaInFooter false)) -}} +
+ + + {{ if $.Site.Params.linkToMarkDown -}} + {{ with $.OutputFormats.Get "markdown" -}} + + {{- end }} + {{- end }} + {{ if or .Params.contentCopyright (and .Site.Params.contentCopyright (ne .Params.contentCopyright false)) -}} + + {{- end }} +
+{{- end }} \ No newline at end of file diff --git a/themes/even/layouts/partials/post/outdated-info-warning.html b/themes/even/layouts/partials/post/outdated-info-warning.html new file mode 100644 index 0000000..3736c13 --- /dev/null +++ b/themes/even/layouts/partials/post/outdated-info-warning.html @@ -0,0 +1,28 @@ +{{- if or .Params.enableOutdatedInfoWarning (and .Site.Params.outdatedInfoWarning.enable (ne .Params.enableOutdatedInfoWarning false)) }} + {{- $daysAgo := div (sub now.Unix .Lastmod.Unix) 86400 }} + {{- $hintThreshold := .Site.Params.outdatedInfoWarning.hint | default 30 }} + {{- $warnThreshold := .Site.Params.outdatedInfoWarning.warn | default 180 }} + + {{- $updateTime := .Lastmod }} + {{- if .GitInfo }} + {{- if lt .GitInfo.AuthorDate.Unix .Lastmod.Unix }} + {{- $updateTime := .GitInfo.AuthorDate }} + {{- end }} + {{- end -}} + + {{- if gt $daysAgo $hintThreshold }} +
+ {{- if gt $daysAgo $warnThreshold }} +
+ {{- else }} +
+ {{- end }} +

{{ T "outdatedInfoWarningBefore" -}} + + {{- dateFormat "January 2, 2006" $updateTime -}} + {{ T "outdatedInfoWarningAfter" -}} +

+
+
+ {{- end -}} +{{- end -}} diff --git a/themes/even/layouts/partials/post/reward.html b/themes/even/layouts/partials/post/reward.html new file mode 100644 index 0000000..3242854 --- /dev/null +++ b/themes/even/layouts/partials/post/reward.html @@ -0,0 +1,21 @@ +{{ if or .Params.reward (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/themes/even/layouts/partials/post/toc.html b/themes/even/layouts/partials/post/toc.html new file mode 100644 index 0000000..4fed1c7 --- /dev/null +++ b/themes/even/layouts/partials/post/toc.html @@ -0,0 +1,9 @@ +{{ if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) }} +
+

{{ T "toc" }}

+ {{ $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default false }} +
+ {{.TableOfContents}} +
+
+{{- end }} \ No newline at end of file diff --git a/themes/even/layouts/partials/scripts.html b/themes/even/layouts/partials/scripts.html new file mode 100644 index 0000000..803ac6a --- /dev/null +++ b/themes/even/layouts/partials/scripts.html @@ -0,0 +1,115 @@ + + +{{- if .Site.Params.publicCDN.enable }} + {{ .Site.Params.publicCDN.jquery | safeHTML }} + {{ .Site.Params.publicCDN.slideout | safeHTML }} + {{ if .Site.Params.fancybox }}{{ .Site.Params.publicCDN.fancyboxJs | safeHTML }}{{ end }} +{{- else -}} + + + {{ if .Site.Params.fancybox }}{{ end }} +{{- end -}} + + +{{- if and (or .Params.enableOutdatedInfoWarning (and .Site.Params.outdatedInfoWarning.enable (ne .Params.enableOutdatedInfoWarning false))) (or .IsPage .IsHome) }} + {{- if .Site.Params.publicCDN.enable }} + {{ .Site.Params.publicCDN.timeagoJS | safeHTML }} + {{ .Site.Params.publicCDN.timeagoLocalesJS | safeHTML }} + {{- else }} + + + {{- end }} + +{{- end }} + + +{{- if and (or .Params.flowchartDiagrams.enable (and .Site.Params.flowchartDiagrams.enable (ne .Params.flowchartDiagrams.enable false))) (or .IsPage .IsHome) -}} + + + +{{- end -}} + + +{{- if and (or .Params.sequenceDiagrams.enable (and .Site.Params.sequenceDiagrams.enable (ne .Params.sequenceDiagrams.enable false))) (or .IsPage .IsHome) -}} + + + + + + +{{- end }} + + +{{- if and (or .Params.mathjax (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 }} + + +{{ range .Site.Params.customJS }} + +{{ end }} diff --git a/themes/even/layouts/partials/slideout.html b/themes/even/layouts/partials/slideout.html new file mode 100644 index 0000000..42ed13e --- /dev/null +++ b/themes/even/layouts/partials/slideout.html @@ -0,0 +1,25 @@ + + \ No newline at end of file diff --git a/themes/even/layouts/post/single.html b/themes/even/layouts/post/single.html new file mode 100644 index 0000000..61fbf8c --- /dev/null +++ b/themes/even/layouts/post/single.html @@ -0,0 +1,72 @@ +{{ define "content" -}} +
+ +
+

{{ .Title }}

+ + +
+ + + {{ partial "post/toc.html" . }} + + + {{ partial "post/outdated-info-warning.html" . }} + + +
+ {{ .Content }} +
+ + + {{ partial "post/copyright.html" . }} + + + {{ partial "post/reward.html" . }} + + +
+{{- end }} diff --git a/themes/even/layouts/post/summary.html b/themes/even/layouts/post/summary.html new file mode 100644 index 0000000..6069ca1 --- /dev/null +++ b/themes/even/layouts/post/summary.html @@ -0,0 +1,28 @@ +
+
+

{{ .Title }}

+ +
+ +
+
+ {{ .Summary }} +
+ +
+
diff --git a/themes/even/layouts/robots.txt b/themes/even/layouts/robots.txt new file mode 100644 index 0000000..e89778e --- /dev/null +++ b/themes/even/layouts/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Sitemap: {{ "sitemap.xml" | absURL }} diff --git a/themes/even/layouts/shortcodes/center.html b/themes/even/layouts/shortcodes/center.html new file mode 100644 index 0000000..e9022d0 --- /dev/null +++ b/themes/even/layouts/shortcodes/center.html @@ -0,0 +1,3 @@ +
+ {{ .Inner }} +
\ No newline at end of file diff --git a/themes/even/layouts/shortcodes/left.html b/themes/even/layouts/shortcodes/left.html new file mode 100644 index 0000000..c2c5102 --- /dev/null +++ b/themes/even/layouts/shortcodes/left.html @@ -0,0 +1,3 @@ +
+ {{ .Inner }} +
\ No newline at end of file diff --git a/themes/even/layouts/shortcodes/music.html b/themes/even/layouts/shortcodes/music.html new file mode 100644 index 0000000..22b2268 --- /dev/null +++ b/themes/even/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/themes/even/layouts/shortcodes/right.html b/themes/even/layouts/shortcodes/right.html new file mode 100644 index 0000000..37a9a33 --- /dev/null +++ b/themes/even/layouts/shortcodes/right.html @@ -0,0 +1,3 @@ +
+ {{ .Inner }} +
\ No newline at end of file diff --git a/themes/even/layouts/sitemap.xml b/themes/even/layouts/sitemap.xml new file mode 100644 index 0000000..19dd68d --- /dev/null +++ b/themes/even/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