Merge pull request #22787 from sftim/20200727_automatically_detect_mermaid_shortcode

Automatically detect MermaidJS shortcode
This commit is contained in:
Kubernetes Prow Robot
2020-07-29 10:01:49 -07:00
committed by GitHub
3 changed files with 3 additions and 4 deletions
+2 -2
View File
@@ -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)
```
{{</* mermaid */>}}
@@ -1,7 +1,6 @@
---
title: Using Source IP
content_type: tutorial
mermaid: true
min-kubernetes-server-version: v1.5
---
+1 -1
View File
@@ -77,7 +77,7 @@
<script src="{{ "js/jquery-ui-1.12.1.min.js" | relURL }}"></script>
<script src="{{ "js/sweetalert-2.1.2.min.js" | relURL }}"></script>
{{ if eq .Params.mermaid true }}
{{ if .HasShortcode "mermaid" }}
<!-- Copied from https://unpkg.com/mermaid@8.5.0/dist/mermaid.min.js -->
<script async src="{{ "js/mermaid.min.js" | relURL }}"></script>
{{ end }}