feat: add tags page

gh-pages
nodejh 4 years ago
parent 4815a9553e
commit 7a9d0220bf

@ -0,0 +1,30 @@
{{ partial "head.html" . }}
<body>
{{ partial "navigation.html" . }}
{{ partial "profile.html" . }}
<section id="wrapper" class="home">
{{ range .Data.Pages.GroupByDate "2006" }}
<div class="archive">
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<div class="post-item">
<div class="post-time">{{ .Date.Format "Jan 2" }}</div>
<a href="{{ .Permalink }}" class="post-link">
{{ .Title }}
</a>
</div>
{{ end }}
</ul>
</div>
{{ end }}
{{ partial "footer.html" . }}
</section>
<div class="dd">
</div>
{{ partial "js.html" . }}
</body>
</html>

@ -1,30 +1,38 @@
{{ partial "head.html" . }}
<body>
{{ partial "navigation.html" . }}
{{ define "main" }}
{{ partial "profile.html" . }}
<section id="wrapper" class="home">
<section id="archive">
{{ range .Data.Pages.GroupByDate "2006" }}
<div class="archive">
<h3>{{ .Key }}</h3>
<ul>
<div class="group">
<h3 class="key">
{{ .Key }}
</h3>
{{ range .Pages }}
<div class="post-item">
<div class="post-time">{{ .Date.Format "Jan 2" }}</div>
<a href="{{ .Permalink }}" class="post-link">
<div class="value">
<div class="date">
{{ .Date.Format "Jan 2" }}
</div>
<div class="title">
<a href="{{ .Permalink }}">
{{ .Title }}
</a>
{{ with .Params.tags }}
<div class="tags">
{{ range . }}
<a href="{{ "tags/" | absURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
</div>
{{ end}}
</ul>
</div>
</div>
{{ end }}
{{ partial "footer.html" . }}
</div>
{{ end }}
</section>
<div class="dd">
</div>
{{ partial "js.html" . }}
</body>
</html>
{{ end }}

@ -0,0 +1,8 @@
{{ define "main" }}
{{ partial "profile.html" . }}
<section id="section">
{{ .Content }}
</section>
{{ end }}

@ -0,0 +1,38 @@
{{ define "main" }}
{{ partial "profile.html" . }}
<section id="archive">
{{ range .Data.Pages.GroupByDate "2006" }}
<div class="group">
<h3 class="key">
{{ .Key }}
</h3>
{{ range .Pages }}
<div class="value">
<div class="date">
{{ .Date.Format "Jan 2" }}
</div>
<div class="title">
<a href="{{ .Permalink }}">
{{ .Title }}
</a>
{{ with .Params.tags }}
<div class="tags">
{{ range . }}
<a href="{{ "tags/" | absURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
</div>
{{ end}}
</div>
</div>
{{ end }}
</div>
{{ end }}
</section>
{{ end }}

@ -0,0 +1,27 @@
{{ partial "head.html" . }}
<body>
{{ partial "navigation.html" . }}
{{ partial "profile.html" . }}
<section id="wrapper" class="tags">
<div class="page-tags">
<ul>
{{ $data := .Data }}
{{ range $key, $value := .Data.Terms.ByCount }}
{{ if ($value.Name) }}
<li>
<a href="{{ $.Site.BaseURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}">
{{ $value.Name | upper }} <span>({{ $value.Count }})</span>
</a>
</li>
{{ end }}
{{ end }}
</ul>
</div>
{{ partial "footer.html" . }}
</section>
{{ partial "js.html" . }}
</body>
</html>

@ -1,28 +1,15 @@
{{ partial "head.html" . }}
<body>
{{ partial "navigation.html" . }}
{{ define "main" }}
{{ partial "profile.html" . }}
<section id="wrapper" class="tags">
<div class="page-tags">
<ul>
<section id="tags">
{{ $data := .Data }}
{{ range $key, $value := .Data.Terms.ByCount }}
{{ if ($value.Name) }}
<li>
<span class="tag">
<a href="{{ $.Site.BaseURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}">
{{ $value.Name | upper }} <span>({{ $value.Count }})</span>
</a>
</li>
</span>
{{ end }}
{{ end }}
</ul>
</div>
{{ partial "footer.html" . }}
</section>
{{ partial "js.html" . }}
</body>
</html>
{{ end }}

@ -3,7 +3,7 @@
{{ partial "navigation.html" . }}
{{ partial "profile.html" . }}
<section id="wrapper" class="home">
<section id="about" class="home">
{{ .Content }}
{{ if .Site.Params.enableDisqus }}

@ -237,15 +237,16 @@ nav.navigation a.button {
font-weight: 400;
letter-spacing: 0px;
font-size: 20px;
color: #222;
margin-top: 12px;
color: #404040;
margin-bottom: 0;
margin-top: 0;
}
.profile h2 {
font-size: 20px;
font-weight: 300;
color: #757575;
margin-top: 10px;
margin-top: 0;
}
/* index post list */
@ -261,7 +262,7 @@ nav.navigation a.button {
#list-page .title {
display: inline-block;
color: #333;
color: #404040;
font-size: 20px;
font-weight: 400;
margin: 0;
@ -269,7 +270,7 @@ nav.navigation a.button {
}
#list-page .title a {
color: #333;
color: #404040;
display: block;
}
@ -365,4 +366,90 @@ nav.navigation a.button {
font-size: 14px;
margin-right: 3px;
}
#single .tags a:hover {
color: #0366d6;
}
#archive {
max-width: 580px;
margin: 0 auto;
padding: 0 24px;
}
#archive .total {
font-size: 15px;
}
#archive .group {
margin: 24px auto;
}
#archive .group .key {
font-size: 20px;
margin-bottom: 12px;
}
#archive .group .value {
display: block;
font-size: 16px;
margin-bottom: 12px;
}
#archive .group .value .date {
display: inline-block;
color: #999;
width: 60px;
}
#archive .group .value .title {
display: inline;
}
#archive .group .value .title a {
color:#404040;
}
#archive .group .value .title a:hover {
color: #0366d6;
}
#archive .group .value .tags {
display: inline;
margin-left: 7px;
}
#archive .group .value .tags a {
background: #f2f2f2;
padding: 4px 7px;
color: #999;
font-size: 14px;
margin-right: 3px;
}
#archive .group .value .tags a:hover {
color: #0366d6;
}
/* taxonomy */
#tags {
max-width: 700px;
margin: 48px auto 0 auto;
padding: 0 12px;
text-align: center;
}
#tags .tag {
display: inline-block;
display: inline-block;
margin: 7px 12px;
}
#tags .tag a {
background: #f2f2f2;
padding: 4px 7px;
color: #757575;
color: #404040;
font-size: 14px;
margin-right: 3px;
}
#tags .tag a:hover {
color: #0366d6;
}
/* section page */
#section {
max-width: 580px;
margin: 48px auto 0 auto;
padding: 0 12px;
}
Loading…
Cancel
Save