diff options
| author | Lee <nanxiaobei@gmail.com> | 2018-01-09 00:28:39 +0800 |
|---|---|---|
| committer | Lee <nanxiaobei@gmail.com> | 2018-01-09 00:28:39 +0800 |
| commit | 6315d0ab8f4a7ded53342d2f97d47305901bbdb8 (patch) | |
| tree | 79085165b7e2586b6b07a3f13e7c2560842adf40 /layouts/_default | |
| parent | ae9627cb6fb805d95fa28038a662066bdafd1492 (diff) | |
Initial commit
Diffstat (limited to 'layouts/_default')
| -rw-r--r-- | layouts/_default/list.html | 44 | ||||
| -rw-r--r-- | layouts/_default/single.html | 23 |
2 files changed, 67 insertions, 0 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..f3f5497 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,44 @@ +{{ partial "header.html" . }} +{{ if not .IsHome }} +<header class="list-header"> + {{ if eq .Data.Singular "tag" }}<span>Tagged in</span> + <h1 class="list-title">{{ .Data.Term }}</h1> + {{ else }}<h1 class="list-title">Posts</h1> + {{ end }} +</header> +{{ end }} +{{ $paginator := .Paginate (where .Pages ".Params.type" "!=" "page") (index .Site.Params "paginate" | default 10) }} +{{ if gt $paginator.TotalPages 0 }} +{{ range $index, $page := $paginator.Pages }} +{{ if and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) }} +{{ .Scratch.Set "postClass" "first-entry" }} +{{ .Scratch.Set "firstEmoji" "<span class=\"welcome-emoji\">👉</span>" }} +{{ else }} +{{ .Scratch.Set "postClass" "post-entry" }} +{{ end }} +<article class="post {{ .Scratch.Get `postClass` }}"> + <header class="post-header"> + {{ safeHTML (.Scratch.Get `firstEmoji`) }} + <h2 class="post-title">{{ .Title }}</h2> + </header> + <p class="post-summary">{{ .Summary | plainify | htmlUnescape }}...</p> + <footer class="post-footer"> + <p class="post-meta">{{ .Date.Format "2006.1.2" }}</p> + </footer> + <a class="post-link" href="{{ .Permalink }}"></a> +</article> +{{ end }} +{{ end }} +{{ if gt $paginator.TotalPages 1 }} +<footer class="list-footer"> + <nav class="pagination"> + {{ if $paginator.HasPrev }} + <a class="pagination-prev" href="{{ $paginator.Prev.URL }}">← 上一页</a> + {{ end }} + {{ if $paginator.HasNext }} + <a class="pagination-next" href="{{ $paginator.Next.URL }}">下一页 →</a> + {{ end }} + </nav> +</footer> +{{ end }} +{{ partial "footer.html" . }}
\ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..70b88b8 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,23 @@ +{{ partial "header.html" . }} +<article class="post post-view"> + <header class="post-header"> + <h1 class="post-title">{{ .Title }}</h1> + <p class="post-meta"> + {{- if or .Params.author .Site.Params.author -}} + {{ .Params.author | default .Site.Params.author }} · {{ end }} + {{- .Date.Format "2006.1.2" -}} + </p> + </header> + <div class="post-content">{{ .Content }}</div> + <footer class="post-footer"> + {{ if .Params.tags }} + <ul class="post-tags"> + {{ range .Params.tags }} + <li><a href="{{ `/tags/` | absURL }}{{ . | urlize }}/">{{ . }}</a></li> + {{ end }} + </ul> + {{ end }} + </footer> + <!-- Comments system area --> +</article> +{{ partial "footer.html" . }}
\ No newline at end of file |
