From 69b90178c19a8ebff1ed322c5e49f4eaf397f7b3 Mon Sep 17 00:00:00 2001 From: Noam Lerner Date: Sun, 6 Mar 2022 16:50:20 +0200 Subject: [PATCH] Add tags support to entry/meta This commit adds support in having tags in entry.meta. This includes: - Updating the README - Adding values for tags across multiple languages (en, fr, it, pt-br, pt) - Moving from span to div in entry/meta/categories to make sure each one of 'tags' and 'categories' sections is in a separate line. --- README.md | 5 +++-- i18n/en.yaml | 3 +++ i18n/fr.yaml | 3 +++ i18n/it.yaml | 3 +++ i18n/pt-br.yaml | 3 +++ i18n/pt.yaml | 3 +++ layouts/partials/entry/meta/categories.html | 4 ++-- layouts/partials/entry/meta/tags.html | 11 +++++++++++ 8 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 layouts/partials/entry/meta/tags.html diff --git a/README.md b/README.md index c06c577..1476767 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ googleAnalytics = "" # Enable Google Analytics by entering your tracking id hideNoPostsWarning = false # Don't show no posts empty state warning in main page, if true [Params.Entry] - meta = ["date", "categories"] # Enable meta fields in given order + meta = ["date", "categories", "tags"] # Enable meta fields in given order toc = true # Enable Table of Contents tocOpen = true # Open Table of Contents block. Optional @@ -247,6 +247,7 @@ related: true # Enable/disable Related content for specific page meta: - date - categories + - tags featured: url: image.jpg # relative path of the image alt: A scale model of the Eiffel tower # alternate text for the image @@ -316,7 +317,7 @@ may activate meta fields with `meta` parameter under the `[Params.Entry]` config ```toml [Params.Entry] - meta = ["date", "categories"] + meta = ["date", "categories", "tags"] ``` #### Related Content diff --git a/i18n/en.yaml b/i18n/en.yaml index 94b9a45..9369024 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -9,6 +9,9 @@ - id: meta_categories translation: "Categories" +- id: meta_tags + translation: "Tags" + # Share - id: share-caption translation: "Share on" diff --git a/i18n/fr.yaml b/i18n/fr.yaml index 792bafc..d98eee3 100644 --- a/i18n/fr.yaml +++ b/i18n/fr.yaml @@ -9,6 +9,9 @@ - id: meta_categories translation: "Catégories" +- id: meta_tags + translation: "Mots-clefs" + # Share - id: share-caption translation: "Partager sur" diff --git a/i18n/it.yaml b/i18n/it.yaml index 517a3df..edb11d9 100644 --- a/i18n/it.yaml +++ b/i18n/it.yaml @@ -9,6 +9,9 @@ - id: meta_categories translation: "Categorie" +- id: meta_tags + translation: "Tag" + # Share - id: share-caption translation: "Condividi su" diff --git a/i18n/pt-br.yaml b/i18n/pt-br.yaml index f92f1e4..5f61cc6 100644 --- a/i18n/pt-br.yaml +++ b/i18n/pt-br.yaml @@ -9,6 +9,9 @@ - id: meta_categories translation: "Categorias" +- id: meta_tags + translation: "Tags" + # Share - id: share-caption translation: "Campartilhar no" diff --git a/i18n/pt.yaml b/i18n/pt.yaml index 2012b9c..d1a6362 100644 --- a/i18n/pt.yaml +++ b/i18n/pt.yaml @@ -9,6 +9,9 @@ - id: meta_categories translation: "Categorias" +- id: meta_tags + translation: "Tags" + # Share - id: share-caption translation: "Campartilhar" diff --git a/layouts/partials/entry/meta/categories.html b/layouts/partials/entry/meta/categories.html index c9b353f..7c53849 100644 --- a/layouts/partials/entry/meta/categories.html +++ b/layouts/partials/entry/meta/categories.html @@ -1,5 +1,5 @@ {{- if .Params.categories }} - + {{- end }} \ No newline at end of file diff --git a/layouts/partials/entry/meta/tags.html b/layouts/partials/entry/meta/tags.html new file mode 100644 index 0000000..4841655 --- /dev/null +++ b/layouts/partials/entry/meta/tags.html @@ -0,0 +1,11 @@ +{{- if .Params.tags }} + +{{- end }} \ No newline at end of file