From 46f6de852d8e25112e513d79474bfd05cb187d2f Mon Sep 17 00:00:00 2001 From: ray Date: Tue, 18 Feb 2020 22:12:32 +0000 Subject: [PATCH] group categories and tags metadata together --- assets/scss/_content.scss | 57 +++++++++++++---------- layouts/partials/taxonomy/categories.html | 4 +- layouts/partials/taxonomy/tags.html | 4 +- layouts/posts/single.html | 6 ++- 4 files changed, 39 insertions(+), 32 deletions(-) diff --git a/assets/scss/_content.scss b/assets/scss/_content.scss index 79cdc4b..f444b86 100644 --- a/assets/scss/_content.scss +++ b/assets/scss/_content.scss @@ -72,6 +72,39 @@ margin-left: auto; margin-right: auto; } + + .taxonomy { + display: flex; + flex-wrap: wrap; + justify-content: center; + @media only screen and (min-width: 768px) { + max-width: 50%; + margin-left: auto; + margin-right: auto; + } + } + + .category, + .tag { + font-size: 0.8em; + padding: 0 12px; + margin: 3px; + border-radius: 1px; + background-color: #ededed; + + color: #333; + text-decoration: none; + + &:hover { + opacity: 1; + color: #555; + text-decoration: underline; + } + + .icon { + color: inherit; + } + } } .avatar img { @@ -204,27 +237,3 @@ } } } - -.categories, -.tags { - a { - font-size: 0.9em; - padding: 3px 6px 4px; - margin: 0 0.21em; - // box-shadow: 0 2px 3px 0 #cbcbcb, 0 2px 2px #dedede inset; - border-radius: 3px; - background-color: #e2e2e2; - - color: #757575; - text-decoration: none; - - &:hover { - opacity: 1; - color: #3a3a3a; - } - } - - .icon { - color: inherit; - } -} diff --git a/layouts/partials/taxonomy/categories.html b/layouts/partials/taxonomy/categories.html index b9bf799..abff57b 100644 --- a/layouts/partials/taxonomy/categories.html +++ b/layouts/partials/taxonomy/categories.html @@ -1,5 +1,3 @@ -
{{- range $index, $el := . -}} - {{ . }} + {{ . }} {{- end -}} -
diff --git a/layouts/partials/taxonomy/tags.html b/layouts/partials/taxonomy/tags.html index b9d05d9..5dcaf36 100644 --- a/layouts/partials/taxonomy/tags.html +++ b/layouts/partials/taxonomy/tags.html @@ -1,5 +1,3 @@ -
{{- range $index, $el := . -}} - {{ . }} + {{ . }} {{- end -}} -
diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 2e54e39..4a77c22 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -21,8 +21,10 @@ {{ i18n "reading_time" .ReadingTime }} - {{ with .Page.Params.Categories }}{{ partial "taxonomy/categories.html" . }}{{ end }} - {{ with .Page.Params.Tags }}{{ partial "taxonomy/tags.html" . }}{{ end }} +
+ {{ with .Page.Params.Categories }}{{ partial "taxonomy/categories.html" . }}{{ end }} + {{ with .Page.Params.Tags }}{{ partial "taxonomy/tags.html" . }}{{ end }} +