From b490470a71b96af634f486d60264afdc2231763a Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Sun, 16 Feb 2020 17:29:11 -0500 Subject: [PATCH] Implemented tags in blog type and removed from default --- assets/css/style.css | 26 ++++++++++++++++++++++++-- layouts/_default/list.html | 8 -------- layouts/_default/list.json | 1 - layouts/_default/single.html | 14 -------------- layouts/blog/list.html | 8 ++++++++ layouts/blog/list.json | 1 + layouts/blog/single.html | 11 +++++++++++ layouts/{_default => blog}/terms.html | 0 8 files changed, 44 insertions(+), 25 deletions(-) rename layouts/{_default => blog}/terms.html (100%) diff --git a/assets/css/style.css b/assets/css/style.css index 989f270..e6f3d79 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -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; } diff --git a/layouts/_default/list.html b/layouts/_default/list.html index e4758b8..773f614 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -8,14 +8,6 @@
- -
- -
{{ $listPageDateFormat := .Site.Params.listPageDateFormat | default "January, 2006"}} diff --git a/layouts/_default/list.json b/layouts/_default/list.json index dc748c1..0fa510c 100644 --- a/layouts/_default/list.json +++ b/layouts/_default/list.json @@ -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 }} } diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 7a5a0c5..3b8774f 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,20 +1,6 @@ {{ define "main"}}

{{ .Title }}

{{ partial "header.html" . }} - - {{ $singlePageDateFormat := .Site.Params.singlePageDateFormat | default "January 2, 2006"}} -

{{ .Date.Format $singlePageDateFormat }}

- -
-
    - {{ range .Param "tags" }} - {{ $name := . }} - {{ with $.Site.GetPage (printf "/tags/%s" ($name | urlize)) }} -
  • {{ $name }}
  • - {{ end }} - {{ end }} -
-
{{ .Content }} diff --git a/layouts/blog/list.html b/layouts/blog/list.html index f98242d..b649b1e 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -7,6 +7,14 @@
+ +
+ +
{{ $listPageDateFormat := .Site.Params.listPageDateFormat | default "January, 2006"}} diff --git a/layouts/blog/list.json b/layouts/blog/list.json index 0fa510c..dc748c1 100644 --- a/layouts/blog/list.json +++ b/layouts/blog/list.json @@ -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 }} } diff --git a/layouts/blog/single.html b/layouts/blog/single.html index 8aed3ef..7a5a0c5 100644 --- a/layouts/blog/single.html +++ b/layouts/blog/single.html @@ -4,6 +4,17 @@ {{ $singlePageDateFormat := .Site.Params.singlePageDateFormat | default "January 2, 2006"}}

{{ .Date.Format $singlePageDateFormat }}

+ +
+
    + {{ range .Param "tags" }} + {{ $name := . }} + {{ with $.Site.GetPage (printf "/tags/%s" ($name | urlize)) }} +
  • {{ $name }}
  • + {{ end }} + {{ end }} +
+
{{ .Content }} diff --git a/layouts/_default/terms.html b/layouts/blog/terms.html similarity index 100% rename from layouts/_default/terms.html rename to layouts/blog/terms.html