From deb0a57903650485f502c106ede0dd4eca062028 Mon Sep 17 00:00:00 2001 From: Anne van Gorkom Date: Wed, 15 Nov 2023 17:30:40 +0100 Subject: [PATCH] Content: added extra front-matter options to example page - Added possible front-matter options to example page (/examples/basic/front-matter/) - Fixed front-matter typo in head.html + sitemap.xml - Fixed the same typo on the blog pages For https://linear.app/usmedia/issue/CUE-340 Closes #442 as merged as of commit 3df48eb. Preview-Path: /examples/basic/front-matter/ Signed-off-by: Anne van Gorkom Change-Id: Ia41193e348387ba832cca63fd013263df9f19f4b Dispatch-Trailer: {"type":"trybot","CL":1172301,"patchset":1,"ref":"refs/changes/01/1172301/1","targetBranch":"alpha"} --- content/blog/example/en.md | 2 +- content/blog/example2/en.md | 2 +- content/blog/example3/en.md | 2 +- content/blog/example4/en.md | 2 +- content/examples/basic/front-matter/en.md | 26 +++++++++++++++++-- hugo/content/en/blog/example/index.md | 2 +- hugo/content/en/blog/example2/index.md | 2 +- hugo/content/en/blog/example3/index.md | 2 +- hugo/content/en/blog/example4/index.md | 2 +- .../en/examples/basic/front-matter/index.md | 26 +++++++++++++++++-- hugo/layouts/_default/sitemap.xml | 2 +- hugo/layouts/partials/site/head.html | 2 +- 12 files changed, 58 insertions(+), 14 deletions(-) diff --git a/content/blog/example/en.md b/content/blog/example/en.md index 0f68d9812..6ea8468bb 100644 --- a/content/blog/example/en.md +++ b/content/blog/example/en.md @@ -2,7 +2,7 @@ title: Example blog page and also a longer title date: "2023-04-06" draft: false -noindex: true +no_index: true image: "cow.jpg" authors: - myitcv diff --git a/content/blog/example2/en.md b/content/blog/example2/en.md index db9629074..194a2d27f 100644 --- a/content/blog/example2/en.md +++ b/content/blog/example2/en.md @@ -2,7 +2,7 @@ title: Example blog page 2 with a longer title date: "2023-01-01" draft: false -noindex: true +no_index: true image: "allium.jpg" --- diff --git a/content/blog/example3/en.md b/content/blog/example3/en.md index 34bb2ec32..769b8b238 100644 --- a/content/blog/example3/en.md +++ b/content/blog/example3/en.md @@ -2,7 +2,7 @@ title: Example blog page 3 date: "2023-03-10" draft: false -noindex: true +no_index: true image: "moon.jpg" --- diff --git a/content/blog/example4/en.md b/content/blog/example4/en.md index 6fbbaf74b..6f3b88c4e 100644 --- a/content/blog/example4/en.md +++ b/content/blog/example4/en.md @@ -2,7 +2,7 @@ title: Example blog page 4 date: "2023-03-10" draft: false -noindex: true +no_index: true image: "birds.jpg" --- diff --git a/content/examples/basic/front-matter/en.md b/content/examples/basic/front-matter/en.md index 153d7b49d..1b8580297 100644 --- a/content/examples/basic/front-matter/en.md +++ b/content/examples/basic/front-matter/en.md @@ -88,5 +88,27 @@ tags: authors : adding the author(s) to the frontmatter, makes the content header show an image + name of the assigned author. It also shows a popup on click, with again an image + (display) name, and when available a link to their Github, and a link to the search page so users can search for other articles of this author. -noindex -: adding noindex: true to the front-matter add the meta tag `` to the head of the page. Also the pages will be excluded from the sitemap.xml. +no_index +: adding `no_index: true` to the front-matter adds the meta tag `` to the head of the page. Also the pages will be excluded from the sitemap.xml. + +## Docs specific front-matter + +disabled +: shows page without the content, but with a TODO block + +hide_summary +: adding `hide_summary: true` will remove the page from the list on a docs overview page (eg. /docs/howto). It will still show in the left hand nav, and the prev/next buttons. + +index_hide +: adding `index_hide: true` will hide the list of children on a docs overview page (eg. /docs/howto) + +toc_hide +: `toc_hide: true` will hide the table of contents in the left hand nav + +toc_root +: `toc_root: true` will set the page as the parent, hiding all other levels of the left hand nav. The left hand nav will only show the (grand)children of the page. + +## Blog specific front-matter + +image +: adds a header image to the blog page. Also shows in the blog teaser. diff --git a/hugo/content/en/blog/example/index.md b/hugo/content/en/blog/example/index.md index 0f68d9812..6ea8468bb 100644 --- a/hugo/content/en/blog/example/index.md +++ b/hugo/content/en/blog/example/index.md @@ -2,7 +2,7 @@ title: Example blog page and also a longer title date: "2023-04-06" draft: false -noindex: true +no_index: true image: "cow.jpg" authors: - myitcv diff --git a/hugo/content/en/blog/example2/index.md b/hugo/content/en/blog/example2/index.md index db9629074..194a2d27f 100644 --- a/hugo/content/en/blog/example2/index.md +++ b/hugo/content/en/blog/example2/index.md @@ -2,7 +2,7 @@ title: Example blog page 2 with a longer title date: "2023-01-01" draft: false -noindex: true +no_index: true image: "allium.jpg" --- diff --git a/hugo/content/en/blog/example3/index.md b/hugo/content/en/blog/example3/index.md index 34bb2ec32..769b8b238 100644 --- a/hugo/content/en/blog/example3/index.md +++ b/hugo/content/en/blog/example3/index.md @@ -2,7 +2,7 @@ title: Example blog page 3 date: "2023-03-10" draft: false -noindex: true +no_index: true image: "moon.jpg" --- diff --git a/hugo/content/en/blog/example4/index.md b/hugo/content/en/blog/example4/index.md index 6fbbaf74b..6f3b88c4e 100644 --- a/hugo/content/en/blog/example4/index.md +++ b/hugo/content/en/blog/example4/index.md @@ -2,7 +2,7 @@ title: Example blog page 4 date: "2023-03-10" draft: false -noindex: true +no_index: true image: "birds.jpg" --- diff --git a/hugo/content/en/examples/basic/front-matter/index.md b/hugo/content/en/examples/basic/front-matter/index.md index 153d7b49d..1b8580297 100644 --- a/hugo/content/en/examples/basic/front-matter/index.md +++ b/hugo/content/en/examples/basic/front-matter/index.md @@ -88,5 +88,27 @@ tags: authors : adding the author(s) to the frontmatter, makes the content header show an image + name of the assigned author. It also shows a popup on click, with again an image + (display) name, and when available a link to their Github, and a link to the search page so users can search for other articles of this author. -noindex -: adding noindex: true to the front-matter add the meta tag `` to the head of the page. Also the pages will be excluded from the sitemap.xml. +no_index +: adding `no_index: true` to the front-matter adds the meta tag `` to the head of the page. Also the pages will be excluded from the sitemap.xml. + +## Docs specific front-matter + +disabled +: shows page without the content, but with a TODO block + +hide_summary +: adding `hide_summary: true` will remove the page from the list on a docs overview page (eg. /docs/howto). It will still show in the left hand nav, and the prev/next buttons. + +index_hide +: adding `index_hide: true` will hide the list of children on a docs overview page (eg. /docs/howto) + +toc_hide +: `toc_hide: true` will hide the table of contents in the left hand nav + +toc_root +: `toc_root: true` will set the page as the parent, hiding all other levels of the left hand nav. The left hand nav will only show the (grand)children of the page. + +## Blog specific front-matter + +image +: adds a header image to the blog page. Also shows in the blog teaser. diff --git a/hugo/layouts/_default/sitemap.xml b/hugo/layouts/_default/sitemap.xml index 781d1cb71..9cfa16e2a 100644 --- a/hugo/layouts/_default/sitemap.xml +++ b/hugo/layouts/_default/sitemap.xml @@ -1,6 +1,6 @@ {{ printf "" | safeHTML }} - {{ range where (where .Data.Pages "Type" "!=" "examples") "Params.noindex" "ne" true }} + {{ range where (where .Data.Pages "Type" "!=" "examples") "Params.no_index" "ne" true }} {{- if .Permalink -}} {{ .Permalink }} diff --git a/hugo/layouts/partials/site/head.html b/hugo/layouts/partials/site/head.html index 88ec3c36c..774210e72 100644 --- a/hugo/layouts/partials/site/head.html +++ b/hugo/layouts/partials/site/head.html @@ -5,7 +5,7 @@ {{ else }}{{ with .Site.Params.description -}}{{- . | $.RenderString | plainify -}} {{ end }}{{ end }}{{ end -}}"> {{ hugo.Generator }} -{{ if and (eq (getenv "HUGO_ENV") "production") (ne .Params.noindex true) (ne .Type "examples") }} +{{ if and (eq (getenv "HUGO_ENV") "production") (ne .Params.no_index true) (ne .Type "examples") }} {{ else }}