Skip to content

Commit fbadc3b

Browse files
authored
Merge pull request #22787 from sftim/20200727_automatically_detect_mermaid_shortcode
Automatically detect MermaidJS shortcode
2 parents cdad56a + 90b85c7 commit fbadc3b

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

content/en/docs/test.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: Docs smoke test page
33
main_menu: false
4-
mermaid: true
54
---
65

76
This page serves two purposes:
@@ -297,7 +296,8 @@ tables, use HTML instead.
297296
298297
## Visualizations with Mermaid
299298
300-
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)
299+
You can use [Mermaid JS](https://mermaidjs.github.io) visualizations.
300+
The Mermaid JS version is specified in [/layouts/partials/head.html](https://github.com/kubernetes/website/blob/master/layouts/partials/head.html)
301301
302302
```
303303
{{</* mermaid */>}}

content/en/docs/tutorials/services/source-ip.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: Using Source IP
33
content_type: tutorial
4-
mermaid: true
54
min-kubernetes-server-version: v1.5
65
---
76

layouts/partials/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<script src="{{ "js/jquery-ui-1.12.1.min.js" | relURL }}"></script>
7878
<script src="{{ "js/sweetalert-2.1.2.min.js" | relURL }}"></script>
7979

80-
{{ if eq .Params.mermaid true }}
80+
{{ if .HasShortcode "mermaid" }}
8181
<!-- Copied from https://unpkg.com/[email protected]/dist/mermaid.min.js -->
8282
<script async src="{{ "js/mermaid.min.js" | relURL }}"></script>
8383
{{ end }}

0 commit comments

Comments
 (0)