From 90b85c7a5e8a1bfb264fb822fe62481ec97efaaa Mon Sep 17 00:00:00 2001 From: Tim Bannister Date: Mon, 27 Jul 2020 17:36:27 +0100 Subject: [PATCH] Automatically detect MermaidJS shortcode Rather than requiring metadata set in a page's front matter, automatically detect when detect when a page relies on MermaidJS. --- content/en/docs/test.md | 4 ++-- content/en/docs/tutorials/services/source-ip.md | 1 - layouts/partials/head.html | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/content/en/docs/test.md b/content/en/docs/test.md index a08aeb3caa..071a873b37 100644 --- a/content/en/docs/test.md +++ b/content/en/docs/test.md @@ -1,7 +1,6 @@ --- title: Docs smoke test page main_menu: false -mermaid: true --- This page serves two purposes: @@ -297,7 +296,8 @@ tables, use HTML instead. ## Visualizations with Mermaid -Add `mermaid: true` to the [front matter](https://gohugo.io/content-management/front-matter/) of any page to enable [Mermaid JS](https://mermaidjs.github.io) visualizations. The Mermaid JS version is specified in [/layouts/partials/head.html](https://github.com/kubernetes/website/blob/master/layouts/partials/head.html) +You can use [Mermaid JS](https://mermaidjs.github.io) visualizations. +The Mermaid JS version is specified in [/layouts/partials/head.html](https://github.com/kubernetes/website/blob/master/layouts/partials/head.html) ``` {{}} diff --git a/content/en/docs/tutorials/services/source-ip.md b/content/en/docs/tutorials/services/source-ip.md index d04902ddfe..588010494c 100644 --- a/content/en/docs/tutorials/services/source-ip.md +++ b/content/en/docs/tutorials/services/source-ip.md @@ -1,7 +1,6 @@ --- title: Using Source IP content_type: tutorial -mermaid: true min-kubernetes-server-version: v1.5 --- diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 16fd6d321b..efa345f715 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -77,7 +77,7 @@ -{{ if eq .Params.mermaid true }} +{{ if .HasShortcode "mermaid" }} {{ end }}