Support tags

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
This commit is contained in:
SeongJae Park 2017-02-24 18:31:35 +09:00
parent 393582a537
commit 558005341e
2 changed files with 75 additions and 2 deletions

View File

@ -0,0 +1,66 @@
<!DOCTYPE html>
<html lang="en">
{{ partial "head.html" . }}
<body>
{{ partial "nav.html" . }}
<header class="header-section ">
<div class="intro-header no-img">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="page-heading">
<h2>{{.Site.Title}}</h2>
</div>
</div>
</div>
</div>
</div>
</header>
<div class="container" role="main">
{{ $pag := .Paginate (where .Data.Pages "Type" "post") }}
{{ range $pag.Pages }}
<article class="post-preview">
<a href="{{ .Permalink }}">
<h2 class="post-title">{{ .Title }}</h2>
{{ if .Params.subtitle }}
<h3 class="post-subtitle">
{{ .Params.subtitle }}
</h3>
{{ end }}
</a>
<p class="post-meta">
Posted on {{ .Date.Format "January 2, 2006" }}
</p>
<div class="post-entry">
{{ if .Truncated }}
{{ .Summary }}
<a href="{{ .Permalink }}" class="post-read-more">[Read&nbsp;More]</a>
{{ else }}
{{ .Content }}
{{ end }}
</div>
{{ if .Params.tags }}
<span class="post-meta">
{{ range .Params.tags }}
#<a href="/tags/{{ . | urlize }}">{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ end }}
</article>
{{ end }}
</div>
</div>
{{ partial "footer.html" . }}
</body>
</html>

View File

@ -46,7 +46,6 @@
<p class="post-meta">
Posted on {{ .Date.Format "January 2, 2006" }}
</p>
<div class="post-entry">
{{ if .Truncated }}
{{ .Summary }}
@ -56,6 +55,14 @@
{{ end }}
</div>
{{ if .Params.tags }}
<span class="post-meta">
{{ range .Params.tags }}
#<a href="/tags/{{ . | urlize }}">{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ end }}
</article>
{{ end }}
</div>