diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2021-12-08 08:54:25 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2021-12-08 08:54:25 +0100 |
commit | 6c841a691ed567acdddffec84642326decf311ce (patch) | |
tree | ffce1423050960a847faf50ab75327015af85ec2 /docs/layouts | |
parent | e71d715b9b0c55aea7ef4fc88642eecd6e7b58c3 (diff) | |
parent | 8d9511a08f14260cbfb73119e4afae50e5a9966d (diff) |
Merge commit '8d9511a08f14260cbfb73119e4afae50e5a9966d'
Diffstat (limited to 'docs/layouts')
-rw-r--r-- | docs/layouts/shortcodes/code-toggle.html | 4 | ||||
-rw-r--r-- | docs/layouts/template-func/page.html | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/docs/layouts/shortcodes/code-toggle.html b/docs/layouts/shortcodes/code-toggle.html index 0b92d520d..6d4246052 100644 --- a/docs/layouts/shortcodes/code-toggle.html +++ b/docs/layouts/shortcodes/code-toggle.html @@ -29,7 +29,7 @@ <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) . ""}} + {{ highlight ($code | transform.Remarshal . | replaceRE `\n+` "\n" | 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> @@ -37,5 +37,5 @@ {{end}} {{ end }} </div> - + </div> diff --git a/docs/layouts/template-func/page.html b/docs/layouts/template-func/page.html index f08018e4f..8b5f0da85 100644 --- a/docs/layouts/template-func/page.html +++ b/docs/layouts/template-func/page.html @@ -4,8 +4,9 @@ {{ range $k, $v := $funcs }} {{ if $v.Description }} {{ $func := printf "%s.%s" $pkg $k }} - <h2> - <a class="header-link" href="#{{ $func | anchorize | safeURL }}"> + {{ $id := $func | anchorize | safeURL }} + <h2 id="{{ $id }}"> + <a class="header-link" href="#{{ $id }}"> <svg class="fill-current o-60 hover-accent-color-light" height="22px" viewBox="0 0 24 24" width="22px" xmlns="http://www.w3.org/2000/svg"> <path d="M0 0h24v24H0z" fill="none"/> <path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/> |