diff options
author | Y4er <45418382@qq.com> | 2019-10-09 14:27:40 +0300 |
---|---|---|
committer | Y4er <45418382@qq.com> | 2019-10-09 14:27:40 +0300 |
commit | 73c2a98f33f38bdbd92aeeb1ee7a6347a5faa59b (patch) | |
tree | 4e65d93fb7a63a899ab4a9ea499bf3e5542857e6 | |
parent | 8f4e29752d7830f40a94253d0213dd358ea0bd2c (diff) |
remove prevnext and date in single
-rw-r--r-- | layouts/_default/single.html | 10 | ||||
-rw-r--r-- | layouts/post/single.html | 27 |
2 files changed, 27 insertions, 10 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index aa90b0d..5111560 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -3,7 +3,6 @@ <!-- post --> <header class="post-header"> <h1 class="post-title">{{ title .Title}}</h1> - <p class="post-meta">{{ .Date.Format "Jan 02, 2006" }}</p> </header> <article class="post-content"> {{ $reAltIn := "<img src=\"([^\"]+)\" alt=\"([^\"]+)?\" />" }} @@ -14,14 +13,5 @@ {{ $finalContent := $altContent | replaceRE $reAltTitleIn $reAltTitleOut | safeHTML }} {{ $finalContent }} </article> - - <!-- 上一篇下一篇 --> - <div class="prevnext"> - {{ partial "prevnext" . }} - </div> - <!-- comments --> - <div class="post-comments"> - {{ partial "comments" . }} - </div> </div> {{- end }}
\ No newline at end of file diff --git a/layouts/post/single.html b/layouts/post/single.html new file mode 100644 index 0000000..aa90b0d --- /dev/null +++ b/layouts/post/single.html @@ -0,0 +1,27 @@ +{{ define "content" -}} +<div class="post"> + <!-- post --> + <header class="post-header"> + <h1 class="post-title">{{ title .Title}}</h1> + <p class="post-meta">{{ .Date.Format "Jan 02, 2006" }}</p> + </header> + <article class="post-content"> + {{ $reAltIn := "<img src=\"([^\"]+)\" alt=\"([^\"]+)?\" />" }} + {{ $reAltOut := "<figure><img src=\"/images/lazy.gif\" data-sizes=\"auto\" data-src=\"$1\" alt=\"$2\" class=\"lazyload\"></figure>" }} + {{ $altContent := .Content | replaceRE $reAltIn $reAltOut | safeHTML }} + {{ $reAltTitleIn := "<img src=\"([^\"]+)\" alt=\"([^\"]+)?\" title=\"([^\"]+)?\" />" }} + {{ $reAltTitleOut := "<figure><img src=\"/images/lazy.gif\" data-src=\"$1\" data-sizes=\"auto\" alt=\"$2\" title=\"$3\" class=\"lazyload\"></figure>" }} + {{ $finalContent := $altContent | replaceRE $reAltTitleIn $reAltTitleOut | safeHTML }} + {{ $finalContent }} + </article> + + <!-- 上一篇下一篇 --> + <div class="prevnext"> + {{ partial "prevnext" . }} + </div> + <!-- comments --> + <div class="post-comments"> + {{ partial "comments" . }} + </div> +</div> +{{- end }}
\ No newline at end of file |