Implemented tags in blog type and removed from default

This commit is contained in:
Brandon Rozek 2020-02-16 17:29:11 -05:00
parent d63dee8bf4
commit b490470a71
8 changed files with 44 additions and 25 deletions

View file

@ -80,7 +80,7 @@ nav ul {
}
nav li {
margin: 10px;
margin: 0 10px;
}
/* Contents List */
@ -94,6 +94,7 @@ nav li {
#searchBox #searchBoxInput {
position: absolute;
width: 100%;
height: 100%;
padding: 0 35px 0 15px;
top: 0;
left: 0;
@ -126,7 +127,7 @@ nav li {
max-width: 600px;
/* min-width: 300px; */
margin: 0 auto;
top: 240px;
top: 330px;
left: 0;
right: 0;
padding: 5px;
@ -154,6 +155,27 @@ nav li {
background-color: #dddfdf;
}
#tags ul {
max-width: 600px;
margin: 0 auto;
display: flex;
padding: 0;
justify-content: center;
flex-wrap: wrap;
list-style: none;
}
#tags li a {
display: block;
height: 24px;
margin: 5px;
padding: 0 5px;
background-color: #dddfdf;
border-radius: 5px;
font-size: 14px;
/* text-decoration: none; */
}
#contentsList {
padding: 20px 0;
}

View file

@ -8,14 +8,6 @@
</div>
<!-- search results -->
<div id="searchResults"></div>
<!-- tags -->
<div id="tags">
<ul>
{{ range .Site.Taxonomies.tags.ByCount }}
<li><a href="{{ .Page.Permalink }}">{{ .Page.Title }} ({{ .Count }})</a></li>
{{ end }}
</ul>
</div>
<!-- contents -->
<div id="contentsList">
{{ $listPageDateFormat := .Site.Params.listPageDateFormat | default "January, 2006"}}

View file

@ -3,7 +3,6 @@
"ref": "{{ $page.Permalink }}",
"title": {{ $page.Title | jsonify }},
"section": "{{ $page.Section }}",
"tags": {{ $page.Params.tags | jsonify }},
"date" : {{ $page.Date.Format "2006.01.02" | jsonify }},
"body": {{ $page.Plain | jsonify }}
}

View file

@ -1,20 +1,6 @@
{{ define "main"}}
<h1 class='title'>{{ .Title }}</h1>
{{ partial "header.html" . }}
<!-- date -->
{{ $singlePageDateFormat := .Site.Params.singlePageDateFormat | default "January 2, 2006"}}
<p class="date">{{ .Date.Format $singlePageDateFormat }}</p>
<!-- tags -->
<div id="tags">
<ul>
{{ range .Param "tags" }}
{{ $name := . }}
{{ with $.Site.GetPage (printf "/tags/%s" ($name | urlize)) }}
<li><a href="{{ .Permalink }}">{{ $name }}</a></li>
{{ end }}
{{ end }}
</ul>
</div>
<!-- content -->
<div id="contentBody">
{{ .Content }}

View file

@ -7,6 +7,14 @@
</div>
<!-- search results -->
<div id="searchResults"></div>
<!-- tags -->
<div id="tags">
<ul>
{{ range .Site.Taxonomies.tags.ByCount }}
<li><a href="{{ .Page.Permalink }}">{{ .Page.Title }} ({{ .Count }})</a></li>
{{ end }}
</ul>
</div>
<!-- contents -->
<div id="contentsList">
{{ $listPageDateFormat := .Site.Params.listPageDateFormat | default "January, 2006"}}

View file

@ -3,6 +3,7 @@
"ref": "{{ $page.Permalink }}",
"title": {{ $page.Title | jsonify }},
"section": "{{ $page.Section }}",
"tags": {{ $page.Params.tags | jsonify }},
"date" : {{ $page.Date.Format "2006.01.02" | jsonify }},
"body": {{ $page.Plain | jsonify }}
}

View file

@ -4,6 +4,17 @@
<!-- date -->
{{ $singlePageDateFormat := .Site.Params.singlePageDateFormat | default "January 2, 2006"}}
<p class="date">{{ .Date.Format $singlePageDateFormat }}</p>
<!-- tags -->
<div id="tags">
<ul>
{{ range .Param "tags" }}
{{ $name := . }}
{{ with $.Site.GetPage (printf "/tags/%s" ($name | urlize)) }}
<li><a href="{{ .Permalink }}">{{ $name }}</a></li>
{{ end }}
{{ end }}
</ul>
</div>
<!-- content -->
<div id="contentBody">
{{ .Content }}