From bfb9613a14ab2d93a4474e5486d22e52a9d5e2b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 6 Nov 2019 20:10:47 +0100 Subject: Add Goldmark as the new default markdown handler This commit adds the fast and CommonMark compliant Goldmark as the new default markdown handler in Hugo. If you want to continue using BlackFriday as the default for md/markdown extensions, you can use this configuration: ```toml [markup] defaultMarkdownHandler="blackfriday" ``` Fixes #5963 Fixes #1778 Fixes #6355 --- docs/layouts/shortcodes/code-toggle.html | 34 ++++++++++++++++++++++++++++++++ docs/layouts/shortcodes/new-in.html | 8 ++++++++ 2 files changed, 42 insertions(+) create mode 100644 docs/layouts/shortcodes/code-toggle.html create mode 100644 docs/layouts/shortcodes/new-in.html (limited to 'docs/layouts/shortcodes') diff --git a/docs/layouts/shortcodes/code-toggle.html b/docs/layouts/shortcodes/code-toggle.html new file mode 100644 index 000000000..da4b00719 --- /dev/null +++ b/docs/layouts/shortcodes/code-toggle.html @@ -0,0 +1,34 @@ +{{ $file := .Get "file" }} +{{ $code := "" }} +{{ with .Get "config" }} +{{ $file = $file | default "config" }} +{{ $sections := (split . ".") }} +{{ $configSection := index $.Site.Data.docs.config $sections }} +{{ $code = dict $sections $configSection }} +{{ else }} +{{ $code = $.Inner }} +{{ end }} +{{ $langs := (slice "yaml" "toml" "json") }} +
+
+ {{- with $file -}} +
{{ . }}.
+ {{- end -}} + {{ range $langs }} +   + {{ end }} +
+
+ {{ range $langs }} +
+ {{ highlight ($code | transform.Remarshal . | safeHTML) . ""}} +
+ {{ if ne ($.Get "copy") "false" }} + + {{/* Functionality located within filesaver.js The copy here is located in the css with .copy class so it can be replaced with JS on success */}} + {{end}} + {{ end }} +
+ +
diff --git a/docs/layouts/shortcodes/new-in.html b/docs/layouts/shortcodes/new-in.html new file mode 100644 index 000000000..ab0abb273 --- /dev/null +++ b/docs/layouts/shortcodes/new-in.html @@ -0,0 +1,8 @@ +{{ $version := .Get 0 }} +{{ if not $version }} +{{ errorf "Missing version in new-in shortcode "}} +{{ end }} +{{ $version = $version | strings.TrimPrefix "v" }} + \ No newline at end of file -- cgit v1.2.3