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" . }} {{ define "main" }}
<body> {{ partial "profile.html" . }}
{{ partial "navigation.html" . }}
{{ partial "profile.html" . }}
<section id="wrapper" class="home"> <section id="archive">
{{ range .Data.Pages.GroupByDate "2006" }} {{ range .Data.Pages.GroupByDate "2006" }}
<div class="archive"> <div class="group">
<h3>{{ .Key }}</h3> <h3 class="key">
<ul> {{ .Key }}
{{ range .Pages }} </h3>
<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"> {{ range .Pages }}
</div> <div class="value">
<div class="date">
{{ .Date.Format "Jan 2" }}
</div>
<div class="title">
<a href="{{ .Permalink }}">
{{ .Title }}
</a>
{{ partial "js.html" . }} {{ with .Params.tags }}
</body> <div class="tags">
</html> {{ range . }}
<a href="{{ "tags/" | absURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
</div>
{{ end}}
</div>
</div>
{{ end }}
</div>
{{ end }}
</section>
{{ 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" . }} {{ define "main" }}
<body> {{ partial "profile.html" . }}
{{ partial "navigation.html" . }} <section id="tags">
{{ partial "profile.html" . }} {{ $data := .Data }}
{{ range $key, $value := .Data.Terms.ByCount }}
{{ if ($value.Name) }}
<section id="wrapper" class="tags"> <span class="tag">
<div class="page-tags"> <a href="{{ $.Site.BaseURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}">
<ul> {{ $value.Name | upper }} <span>({{ $value.Count }})</span>
{{ $data := .Data }} </a>
{{ range $key, $value := .Data.Terms.ByCount }} </span>
{{ if ($value.Name) }} {{ end }}
<li> {{ end }}
<a href="{{ $.Site.BaseURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}"> </section>
{{ $value.Name | upper }} <span>({{ $value.Count }})</span> {{ end }}
</a>
</li>
{{ end }}
{{ end }}
</ul>
</div>
{{ partial "footer.html" . }}
</section>
{{ partial "js.html" . }}
</body>
</html>

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

@ -237,15 +237,16 @@ nav.navigation a.button {
font-weight: 400; font-weight: 400;
letter-spacing: 0px; letter-spacing: 0px;
font-size: 20px; font-size: 20px;
color: #222; color: #404040;
margin-top: 12px; margin-bottom: 0;
margin-top: 0;
} }
.profile h2 { .profile h2 {
font-size: 20px; font-size: 20px;
font-weight: 300; font-weight: 300;
color: #757575; color: #757575;
margin-top: 10px; margin-top: 0;
} }
/* index post list */ /* index post list */
@ -261,7 +262,7 @@ nav.navigation a.button {
#list-page .title { #list-page .title {
display: inline-block; display: inline-block;
color: #333; color: #404040;
font-size: 20px; font-size: 20px;
font-weight: 400; font-weight: 400;
margin: 0; margin: 0;
@ -269,7 +270,7 @@ nav.navigation a.button {
} }
#list-page .title a { #list-page .title a {
color: #333; color: #404040;
display: block; display: block;
} }
@ -365,4 +366,90 @@ nav.navigation a.button {
font-size: 14px; font-size: 14px;
margin-right: 3px; 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