diff options
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | assets/js/search.js | 1 | ||||
| -rw-r--r-- | assets/sass/_customize.scss | 27 | ||||
| -rw-r--r-- | exampleSite/config/_default/config.yaml | 5 | ||||
| -rw-r--r-- | i18n/en.toml | 3 | ||||
| -rw-r--r-- | i18n/ru.toml | 3 | ||||
| -rw-r--r-- | layouts/_default/list.html | 1 | ||||
| -rw-r--r-- | layouts/_default/term.html | 1 | ||||
| -rw-r--r-- | layouts/_default/terms.html | 29 | ||||
| -rw-r--r-- | layouts/index.json | 1 | ||||
| -rw-r--r-- | layouts/partials/templates/opengraph.html | 4 | ||||
| -rw-r--r-- | resources/_gen/assets/scss/sass/style.scss_f300667da4f5b5f84e1a9e0702b2fdde.content | 26 |
12 files changed, 94 insertions, 9 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index de126c0..d087505 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Provide ability to specify semantic page type in Front Matter (will be used for Schema.org) - Provide ability to mark links as external using svg icon +- Provide minimal tag cloud ### Changed @@ -26,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Rename `site.Social.facebook_id` to `site.Params.social.facebookId` - Rename `site.Social.facebook_admin` to `site.Params.social.facebookAdminIds` - Rename `site.Social.twitter` to `site.Params.social.twitter` +- Disable categories taxonomy as not used by Ed ### Removed diff --git a/assets/js/search.js b/assets/js/search.js index 270f828..4ea49ac 100644 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -26,7 +26,6 @@ async function initSearchIndex() { this.field('objectID'); this.field('title'); - this.field('categories'); this.field('tags'); this.field('content'); diff --git a/assets/sass/_customize.scss b/assets/sass/_customize.scss index a996917..6d55b8e 100644 --- a/assets/sass/_customize.scss +++ b/assets/sass/_customize.scss @@ -134,13 +134,14 @@ ul.pager li { position: relative; } -.post-tags { +ul.post-tags { margin: 0; padding: 0; position: absolute; right: 24px; bottom: -12px; list-style: none; + text-indent: unset; } .post-tags li, @@ -213,6 +214,30 @@ a.external:after { @include mask-image (url("/img/external-link.svg")); } +ul.tags-cloud { + display: flex; + flex-wrap: wrap; + justify-content: center; + max-width: 960px; + margin: auto; + padding: 2rem 0 1rem; + list-style: none; + border: 2px solid white; + border-radius: 5px; +} + +ul.tags-cloud .tag { + display: flex; + align-items: center; + margin: 0.25rem 1rem; +} + +ul.tags-cloud .tag-link { + padding: 5px 5px 0; + transition: 0.3s; + text-decoration: none; +} + /* Themes */ /* Red */ diff --git a/exampleSite/config/_default/config.yaml b/exampleSite/config/_default/config.yaml index 68bbc18..9a6320c 100644 --- a/exampleSite/config/_default/config.yaml +++ b/exampleSite/config/_default/config.yaml @@ -26,6 +26,11 @@ refLinksErrorLevel: WARNING disableKinds: - RSS +# We have just the default tags taxonomy, and remove the categories +# taxonomy for site as not used. +taxonomies: + tag: tags + # Google Analytics Tracking ID. # # For more info, read the article diff --git a/i18n/en.toml b/i18n/en.toml index 6faf598..0c786b7 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -63,3 +63,6 @@ [search_results] other = 'Found results:' + +[tag_cloud] + other = 'Tag Cloud' diff --git a/i18n/ru.toml b/i18n/ru.toml index cdc6550..40aba8c 100644 --- a/i18n/ru.toml +++ b/i18n/ru.toml @@ -63,3 +63,6 @@ [search_results] other = 'Найдено результатов:' + +[tag_cloud] + other = 'Облако тегов' diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 85e8a43..2fd13ba 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,5 +1,6 @@ {{ define "main" }} +{{/* This template is for list of all publications in a Section */}} <div class="articles"> {{ with .Title }}<h1 class="page-title">{{ . }}</h1>{{ end }} diff --git a/layouts/_default/term.html b/layouts/_default/term.html index 03430d4..6450775 100644 --- a/layouts/_default/term.html +++ b/layouts/_default/term.html @@ -1,5 +1,6 @@ {{ define "main" }} +{{/* This template is for list of all publications in a Term (for example a Tag) */}} <div class="articles"> <h1 class="page-title"> {{ with .Title }}{{ i18n "publications_tagged" . }}{{ end }} diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html new file mode 100644 index 0000000..20e8f29 --- /dev/null +++ b/layouts/_default/terms.html @@ -0,0 +1,29 @@ +{{ define "main" }} + +{{/* This template is for list of all Tags */}} +<div class="articles"> + <h1 class="page-title"> + {{ with .Title }} + {{ i18n "tag_cloud" . }} + {{ end }} + </h1> + + {{ $tags := site.Taxonomies.tags.ByCount }} + + <div class="tags-wrapper"> + <ul class="tags-cloud"> + {{ range uniq $tags }} + {{ if .Term }} + {{ $tagURL := printf "tags/%s" .Term | relURL }} + <li class="tag"> + <a class="tag-link" href="{{ $tagURL }}"> + {{ .Term }} ({{ .Count }}) + </a> + </li> + {{ end }} + {{ end }} + </ul> + </div> +</div> + +{{ end }} diff --git a/layouts/index.json b/layouts/index.json index a71d1e6..2b8aa25 100644 --- a/layouts/index.json +++ b/layouts/index.json @@ -31,7 +31,6 @@ "type" $page.Type "section" $page.Section "content" $page.Plain - "categories" ($page.Params.categories | default slice) "tags" ($page.Params.tags | default slice) ) -}} diff --git a/layouts/partials/templates/opengraph.html b/layouts/partials/templates/opengraph.html index f78f8e8..4f44694 100644 --- a/layouts/partials/templates/opengraph.html +++ b/layouts/partials/templates/opengraph.html @@ -30,10 +30,6 @@ <meta property="article:expiration_time" content="{{ .ExpiryDate.Format "2006-01-02T15:04:05" }}"> {{- end -}} - {{- with .Params.categories -}}{{- range $v := . }} - <meta property="article:section" content="{{ $v }}"> - {{- end -}}{{- end -}} - {{- with .Params.tags -}}{{- range $v := . }} <meta property="article:tag" content="{{ $v }}"> {{- end -}}{{- end -}} diff --git a/resources/_gen/assets/scss/sass/style.scss_f300667da4f5b5f84e1a9e0702b2fdde.content b/resources/_gen/assets/scss/sass/style.scss_f300667da4f5b5f84e1a9e0702b2fdde.content index ed9df8a..b83aaab 100644 --- a/resources/_gen/assets/scss/sass/style.scss_f300667da4f5b5f84e1a9e0702b2fdde.content +++ b/resources/_gen/assets/scss/sass/style.scss_f300667da4f5b5f84e1a9e0702b2fdde.content @@ -988,13 +988,14 @@ ul.pager li { .tags-wrapper { position: relative; } -.post-tags { +ul.post-tags { margin: 0; padding: 0; position: absolute; right: 24px; bottom: -12px; - list-style: none; } + list-style: none; + text-indent: unset; } .post-tags li, .post-tags a { @@ -1064,6 +1065,27 @@ a.external:after { -webkit-mask-image: url("/img/external-link.svg"); mask-image: url("/img/external-link.svg"); } +ul.tags-cloud { + display: flex; + flex-wrap: wrap; + justify-content: center; + max-width: 960px; + margin: auto; + padding: 2rem 0 1rem; + list-style: none; + border: 2px solid white; + border-radius: 5px; } + +ul.tags-cloud .tag { + display: flex; + align-items: center; + margin: 0.25rem 1rem; } + +ul.tags-cloud .tag-link { + padding: 5px 5px 0; + transition: 0.3s; + text-decoration: none; } + /* Themes */ /* Red */ .theme-base-red .post-tags a { |
