aboutsummaryrefslogtreecommitdiff
path: root/layouts/_default
diff options
context:
space:
mode:
authorolOwOlo <26087907+olOwOlo@users.noreply.github.com>2017-08-27 22:38:42 +0800
committerolOwOlo <26087907+olOwOlo@users.noreply.github.com>2017-08-27 22:38:42 +0800
commit3c6cb7f29631dfcdd954e7cbd5d2370efe7eb827 (patch)
treed374e090981dda28452dbd13400e377b9cc06277 /layouts/_default
๐ŸŽ‰ first commit
Diffstat (limited to 'layouts/_default')
-rw-r--r--layouts/_default/baseof.html39
-rw-r--r--layouts/_default/section.html56
-rw-r--r--layouts/_default/single.html7
-rw-r--r--layouts/_default/single.md1
-rw-r--r--layouts/_default/taxonomy.html47
-rw-r--r--layouts/_default/terms.html45
6 files changed, 195 insertions, 0 deletions
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