remove left anchor option and adjust spacing

This commit is contained in:
Robert Kaussow 2020-09-07 21:08:30 +02:00
parent 74b88ed16b
commit e1ef957164
Signed by: xoxys
GPG Key ID: 65362AE74AF98B61
4 changed files with 4 additions and 14 deletions

View File

@ -78,7 +78,5 @@ params:
geekblogToC: 3
geekblogAuthor: john-doe
geekblogAnchorLeft: true
geekblogLegalNotice: https://thegeeklab.de/legal-notice/#contact-information
geekblogPrivacyPolicy: https://thegeeklab.de/legal-notice/#privacy-policy

View File

@ -115,9 +115,6 @@ enableGitInfo = true
# (Optional, default true) Add an anchor link to headlines.
geekblogAnchor = true
# (Optional, default false) Move anchor link to the left side of headlines.
geekblogAnchorLeft = false
# (Optional, default true) Copy anchor url to clipboard on click.
geekblogAnchorCopy = true
@ -227,9 +224,6 @@ params:
# (Optional, default true) Add an anchor link to headlines.
geekblogAnchor: true
# (Optional, default false) Move anchor link to the left side of headlines.
geekblogAnchorLeft: false
# (Optional, default true) Copy anchor url to clipboard on click.
geekblogAnchorCopy: true

View File

@ -1,10 +1,7 @@
{{ $showAnchor := (and (default true .Page.Params.GeekblogAnchor) (default true .Site.Params.GeekblogAnchor)) }}
{{ $anchorLeft := (default false .Site.Params.GeekblogAnchorLeft) }}
{{ $.Scratch.Set "content" (.Content | replaceRE `<nav id="TableOfContents">\s*<ul>\s*<li>\s*<ul>` `<nav id="TableOfContents"><ul>` | replaceRE `</ul>\s*</li>\s*</ul>\s*</nav>` `</ul></nav>` | safeHTML) }}
{{ if and $showAnchor $anchorLeft }}
{{ $.Scratch.Set "content" ($.Scratch.Get "content" | replaceRE "(<h[2-9] id=\"([^\"]+)\"[^>]*>)(.*?)(</h[2-9]+>)" (printf `<div class="gblog-post__anchorwrap">%s<a data-clipboard-text="%s" class="gblog-post__anchor gblog-post__anchor--left clip" aria-label="Anchor %s" href="#%s"><svg class="icon link"><use xlink:href="#link"></use></svg></a>%s%s</div>` `${1}` (absURL (printf "%s#%s" .Permalink `${2}`)) `${3}` `${2}` `${3}` `${4}`) | safeHTML) }}
{{ else if and $showAnchor (not $anchorLeft) }}
{{ if $showAnchor }}
{{ $.Scratch.Set "content" ($.Scratch.Get "content" | replaceRE "(<h[2-9] id=\"([^\"]+)\"[^>]*>)(.*?)(</h[2-9]+>)" (printf `<div class="gblog-post__anchorwrap">%s%s<a data-clipboard-text="%s" class="gblog-post__anchor gblog-post__anchor--right clip" aria-label="Anchor %s" href="#%s"><svg class="icon link"><use xlink:href="#link"></use></svg></a>%s</div>` `${1}` `${3}` (absURL (printf "%s#%s" .Permalink `${2}`)) `${3}` `${2}` `${4}`) | safeHTML) }}
{{ end }}

View File

@ -85,7 +85,7 @@ img {
width: 100%;
max-width: $container-max-width;
margin: 0 auto;
padding: $padding-16 $padding-16 * 1.5;
padding: $padding-16;
}
.icon {
@ -134,7 +134,8 @@ img {
color: $gray-200;
.container {
padding: $padding-8 $padding-16;
padding-top: $padding-8;
padding-bottom: $padding-8;
}
li {