mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-28 15:50:36 +00:00
remove left anchor option and adjust spacing
This commit is contained in:
parent
74b88ed16b
commit
e1ef957164
@ -78,7 +78,5 @@ params:
|
|||||||
geekblogToC: 3
|
geekblogToC: 3
|
||||||
geekblogAuthor: john-doe
|
geekblogAuthor: john-doe
|
||||||
|
|
||||||
geekblogAnchorLeft: true
|
|
||||||
|
|
||||||
geekblogLegalNotice: https://thegeeklab.de/legal-notice/#contact-information
|
geekblogLegalNotice: https://thegeeklab.de/legal-notice/#contact-information
|
||||||
geekblogPrivacyPolicy: https://thegeeklab.de/legal-notice/#privacy-policy
|
geekblogPrivacyPolicy: https://thegeeklab.de/legal-notice/#privacy-policy
|
||||||
|
@ -115,9 +115,6 @@ enableGitInfo = true
|
|||||||
# (Optional, default true) Add an anchor link to headlines.
|
# (Optional, default true) Add an anchor link to headlines.
|
||||||
geekblogAnchor = true
|
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.
|
# (Optional, default true) Copy anchor url to clipboard on click.
|
||||||
geekblogAnchorCopy = true
|
geekblogAnchorCopy = true
|
||||||
|
|
||||||
@ -227,9 +224,6 @@ params:
|
|||||||
# (Optional, default true) Add an anchor link to headlines.
|
# (Optional, default true) Add an anchor link to headlines.
|
||||||
geekblogAnchor: true
|
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.
|
# (Optional, default true) Copy anchor url to clipboard on click.
|
||||||
geekblogAnchorCopy: true
|
geekblogAnchorCopy: true
|
||||||
|
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
{{ $showAnchor := (and (default true .Page.Params.GeekblogAnchor) (default true .Site.Params.GeekblogAnchor)) }}
|
{{ $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) }}
|
{{ $.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 }}
|
{{ if $showAnchor }}
|
||||||
{{ $.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) }}
|
|
||||||
{{ $.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) }}
|
{{ $.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 }}
|
{{ end }}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ img {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: $container-max-width;
|
max-width: $container-max-width;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: $padding-16 $padding-16 * 1.5;
|
padding: $padding-16;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
@ -134,7 +134,8 @@ img {
|
|||||||
color: $gray-200;
|
color: $gray-200;
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
padding: $padding-8 $padding-16;
|
padding-top: $padding-8;
|
||||||
|
padding-bottom: $padding-8;
|
||||||
}
|
}
|
||||||
|
|
||||||
li {
|
li {
|
||||||
|
Loading…
Reference in New Issue
Block a user