summaryrefslogtreecommitdiffstats
path: root/docs/content/en/methods/page/Fragments.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/content/en/methods/page/Fragments.md')
-rw-r--r--docs/content/en/methods/page/Fragments.md12
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/content/en/methods/page/Fragments.md b/docs/content/en/methods/page/Fragments.md
index 89f82d2ce..7bcad1ef9 100644
--- a/docs/content/en/methods/page/Fragments.md
+++ b/docs/content/en/methods/page/Fragments.md
@@ -21,7 +21,7 @@ In a URL, whether absolute or relative, the [fragment] links to an `id` attribut
path fragment
```
-Hugo assigns an `id` attribute to each markdown [ATX] and [setext] heading within the page content. You can override the `id` with a [markdown attribute] as needed. This creates the relationship between an entry in the [table of contents] (TOC) and a heading on the page.
+Hugo assigns an `id` attribute to each Markdown [ATX] and [setext] heading within the page content. You can override the `id` with a [Markdown attribute] as needed. This creates the relationship between an entry in the [table of contents] (TOC) and a heading on the page.
Use the `Fragments` method on a `Page` object to create a table of contents with the `Fragments.ToHTML` method, or by [walking] the `Fragments.Map` data structure.
@@ -31,21 +31,21 @@ Headings
: (`map`) A nested map of all headings on the page. Each map contains the following keys: `ID`, `Level`, `Title` and `Headings`. To inspect the data structure:
```go-html-template
-<pre>{{ .Fragments.Headings | jsonify (dict "indent" " ") }}</pre>
+<pre>{{ debug.Dump .Fragments.Headings }}</pre>
```
HeadingsMap
: (`slice`) A slice of maps of all headings on the page, with first-level keys for each heading. Each map contains the following keys: `ID`, `Level`, `Title` and `Headings`. To inspect the data structure:
```go-html-template
-<pre>{{ .Fragments.HeadingsMap | jsonify (dict "indent" " ") }}</pre>
+<pre>{{ debug.Dump .Fragments.HeadingsMap }}</pre>
```
Identifiers
: (`slice`) A slice containing the `id` of each heading on the page. To inspect the data structure:
```go-html-template
-<pre>{{ .Fragments.Identifiers | jsonify (dict "indent" " ") }}</pre>
+<pre>{{ debug.Dump .Fragments.Identifiers }}</pre>
```
Identifiers.Contains ID
@@ -100,7 +100,7 @@ When using the `Fragments` methods within a shortcode, call the shortcode using
[fragment]: /getting-started/glossary/#fragment
[markdown attribute]: /getting-started/glossary/#markdown-attribute
[setext]: https://spec.commonmark.org/0.30/#setext-headings
-[table of contents]: /methods/page/tableofcontents
+[table of contents]: /methods/page/tableofcontents/
[walking]: /getting-started/glossary/#walk
-[`tableofcontents`]: /methods/page/tableofcontents
+[`tableofcontents`]: /methods/page/tableofcontents/
[render hook]: /getting-started/glossary/#render-hook