summaryrefslogtreecommitdiffstats
path: root/docs/layouts/shortcodes
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-11-06 20:10:47 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-11-23 14:12:24 +0100
commitbfb9613a14ab2d93a4474e5486d22e52a9d5e2b3 (patch)
tree81c4dbd10505e952489e1dbcf1d7bafc88b57c28 /docs/layouts/shortcodes
parenta3fe5e5e35f311f22b6b4fc38abfcf64cd2c7d6f (diff)
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
Diffstat (limited to 'docs/layouts/shortcodes')
-rw-r--r--docs/layouts/shortcodes/code-toggle.html34
-rw-r--r--docs/layouts/shortcodes/new-in.html8
2 files changed, 42 insertions, 0 deletions
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") }}
+<div class="code relative" {{ with $file }}id="{{ . | urlize}}"{{ end }}>
+ <div class="code-nav flex flex-nowrap items-stretch">
+ {{- with $file -}}
+ <div class="san-serif f6 dib lh-solid pl2 pv2 mr2">{{ . }}.</div>
+ {{- end -}}
+ {{ range $langs }}
+ <button data-toggle-tab="{{ . }}" class="tab-button {{ cond (eq . "yaml") "active" ""}} ba san-serif f6 dib lh-solid ph2 pv2">{{ . }}</button>&nbsp;
+ {{ end }}
+ </div>
+ <div class="tab-content">
+ {{ range $langs }}
+ <div data-pane="{{ . }}" class="code-copy-content nt3 tab-pane {{ cond (eq . "yaml") "active" ""}}">
+ {{ highlight ($code | transform.Remarshal . | safeHTML) . ""}}
+ </div>
+ {{ if ne ($.Get "copy") "false" }}
+ <button class="needs-js copy copy-toggle bg-accent-color-dark f6 absolute top-0 right-0 lh-solid hover-bg-primary-color-dark bn white ph3 pv2" title="Copy this code to your clipboard." data-clipboard-action="copy" aria-label="copy button">
+ </button>
+ {{/* 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 }}
+ </div>
+
+</div>
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" }}
+<button class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 mr2 ml2 px-4 border border-gray-400 rounded shadow">
+ <a href="{{ printf "https://gohugo.io/news/%s-relnotes/" $version }}" target="_blank">New in v{{$version}}</a>
+</button> \ No newline at end of file