Skip to content

Commit

Permalink
document anchor settings
Browse files Browse the repository at this point in the history
  • Loading branch information
xoxys committed Feb 26, 2020
1 parent 14567a6 commit 977daa7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions exampleSite/content/usage/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
# (Optional, default none) Add a link to your Privacy Policy page to the site footer.
# It can be either a remote url or a local file path relative to your content directory.
geekdocPrivacyPolicy = '/privacy'

# (Optional, default true) Add an anchor link to headlines.
geekdocAnchor = true
```

{{< /tab >}}
Expand Down Expand Up @@ -101,6 +104,9 @@ params:
# (Optional, default none) Add a link to your Privacy Policy page to the site footer.
# It can be either a remote url or a local file path relative to your content directory.
geekdocPrivacyPolicy: /privacy

# (Optional, default true) Add an anchor link to headlines.
geekdocAnchor: true
```
{{< /tab >}}
Expand Down Expand Up @@ -140,6 +146,9 @@ geekdocFlatSection = true

# Set true to hide page or section from side menu (file-tree menu only)
geekdocHidden = true

# Add an anchor link to headlines
geekdocAnchor = true
```

{{< /tab >}}
Expand Down Expand Up @@ -174,6 +183,9 @@ geekdocFlatSection: true

# Set true to hide page or section from side menu (file-tree menu only)
geekdocHidden: true

# Add an anchor link to headlines
geekdocAnchor: true
```
{{< /tab >}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/content.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ $showAnchor := (and (default true .Page.Params.geekdocAnchor) (default true .Site.Params.geekdocAnchor)) }}
{{ $showAnchor := (and (default true .Page.Params.GeekdocAnchor) (default true .Site.Params.GeekdocAnchor)) }}

{{ $.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 $showAnchor }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/page-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{{ end }}
{{ end }}

{{ $showBreadcrumb := (and (default true .Page.Params.geekdocBreadcrumb) (default true .Site.Params.geekdocBreadcrumb)) }}
{{ $showBreadcrumb := (and (default true .Page.Params.GeekdocBreadcrumb) (default true .Site.Params.GeekdocBreadcrumb)) }}
{{ $showEdit := (and ($.Scratch.Get "geekdocFilePath") $geekdocRepo $geekdocEditPath) }}
<div class="gdoc-page__header flex flex-wrap justify-between{{ if not $showEdit }} hidden-mobile{{ end }}{{ if (and (not $showBreadcrumb) (not $showEdit)) }} hidden {{ end }}" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<span>
Expand Down

0 comments on commit 977daa7

Please sign in to comment.