Skip to content

Commit e1ef957

Browse files
committed
remove left anchor option and adjust spacing
1 parent 74b88ed commit e1ef957

4 files changed

Lines changed: 4 additions & 14 deletions

File tree

exampleSite/config.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,5 @@ params:
7878
geekblogToC: 3
7979
geekblogAuthor: john-doe
8080

81-
geekblogAnchorLeft: true
82-
8381
geekblogLegalNotice: https://thegeeklab.de/legal-notice/#contact-information
8482
geekblogPrivacyPolicy: https://thegeeklab.de/legal-notice/#privacy-policy

exampleSite/content/posts/how-to-use.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ enableGitInfo = true
115115
# (Optional, default true) Add an anchor link to headlines.
116116
geekblogAnchor = true
117117

118-
# (Optional, default false) Move anchor link to the left side of headlines.
119-
geekblogAnchorLeft = false
120-
121118
# (Optional, default true) Copy anchor url to clipboard on click.
122119
geekblogAnchorCopy = true
123120

@@ -227,9 +224,6 @@ params:
227224
# (Optional, default true) Add an anchor link to headlines.
228225
geekblogAnchor: true
229226

230-
# (Optional, default false) Move anchor link to the left side of headlines.
231-
geekblogAnchorLeft: false
232-
233227
# (Optional, default true) Copy anchor url to clipboard on click.
234228
geekblogAnchorCopy: true
235229

layouts/partials/content.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
{{ $showAnchor := (and (default true .Page.Params.GeekblogAnchor) (default true .Site.Params.GeekblogAnchor)) }}
2-
{{ $anchorLeft := (default false .Site.Params.GeekblogAnchorLeft) }}
32

43
{{ $.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) }}
5-
{{ if and $showAnchor $anchorLeft }}
6-
{{ $.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) }}
7-
{{ else if and $showAnchor (not $anchorLeft) }}
4+
{{ if $showAnchor }}
85
{{ $.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) }}
96
{{ end }}
107

src/sass/_base.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ img {
8585
width: 100%;
8686
max-width: $container-max-width;
8787
margin: 0 auto;
88-
padding: $padding-16 $padding-16 * 1.5;
88+
padding: $padding-16;
8989
}
9090

9191
.icon {
@@ -134,7 +134,8 @@ img {
134134
color: $gray-200;
135135

136136
.container {
137-
padding: $padding-8 $padding-16;
137+
padding-top: $padding-8;
138+
padding-bottom: $padding-8;
138139
}
139140

140141
li {

0 commit comments

Comments
 (0)