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 { nav li {
margin: 10px; margin: 0 10px;
} }
/* Contents List */ /* Contents List */
@ -94,6 +94,7 @@ nav li {
#searchBox #searchBoxInput { #searchBox #searchBoxInput {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%;
padding: 0 35px 0 15px; padding: 0 35px 0 15px;
top: 0; top: 0;
left: 0; left: 0;
@ -126,7 +127,7 @@ nav li {
max-width: 600px; max-width: 600px;
/* min-width: 300px; */ /* min-width: 300px; */
margin: 0 auto; margin: 0 auto;
top: 240px; top: 330px;
left: 0; left: 0;
right: 0; right: 0;
padding: 5px; padding: 5px;
@ -154,6 +155,27 @@ nav li {
background-color: #dddfdf; 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 { #contentsList {
padding: 20px 0; padding: 20px 0;
} }

View file

@ -8,14 +8,6 @@
</div> </div>
<!-- search results --> <!-- search results -->
<div id="searchResults"></div> <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 --> <!-- contents -->
<div id="contentsList"> <div id="contentsList">
{{ $listPageDateFormat := .Site.Params.listPageDateFormat | default "January, 2006"}} {{ $listPageDateFormat := .Site.Params.listPageDateFormat | default "January, 2006"}}

View file

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

View file

@ -1,20 +1,6 @@
{{ define "main"}} {{ define "main"}}
<h1 class='title'>{{ .Title }}</h1> <h1 class='title'>{{ .Title }}</h1>
{{ partial "header.html" . }} {{ 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 --> <!-- content -->
<div id="contentBody"> <div id="contentBody">
{{ .Content }} {{ .Content }}

View file

@ -7,6 +7,14 @@
</div> </div>
<!-- search results --> <!-- search results -->
<div id="searchResults"></div> <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 --> <!-- contents -->
<div id="contentsList"> <div id="contentsList">
{{ $listPageDateFormat := .Site.Params.listPageDateFormat | default "January, 2006"}} {{ $listPageDateFormat := .Site.Params.listPageDateFormat | default "January, 2006"}}

View file

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

View file

@ -4,6 +4,17 @@
<!-- date --> <!-- date -->
{{ $singlePageDateFormat := .Site.Params.singlePageDateFormat | default "January 2, 2006"}} {{ $singlePageDateFormat := .Site.Params.singlePageDateFormat | default "January 2, 2006"}}
<p class="date">{{ .Date.Format $singlePageDateFormat }}</p> <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 --> <!-- content -->
<div id="contentBody"> <div id="contentBody">
{{ .Content }} {{ .Content }}