aboutsummaryrefslogtreecommitdiff
path: root/layouts/post
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/post
🎉 first commit
Diffstat (limited to 'layouts/post')
-rw-r--r--layouts/post/single.html64
-rw-r--r--layouts/post/summary.html27
2 files changed, 91 insertions, 0 deletions
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