File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
docs/layouts/_partials/utils Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 12
12
{{ else }}
13
13
{{ $headingKeys = $headingKeys | append (printf "%s#%s" $h1.ID $h1.Title) }}
14
14
{{ end }}
15
- {{ $headingTitles = $headingTitles | append (printf "# %s" $h1.Title) }}
15
+ {{ $headingTitles = $headingTitles | append (printf "< h1 > %s" $h1.Title) }}
16
16
17
17
{{ range $h2 := $h1.Headings }}
18
18
{{ $headingKeys = $headingKeys | append (printf "%s#%s" $h2.ID $h2.Title) }}
19
- {{ $headingTitles = $headingTitles | append (printf "## %s" $h2.Title) }}
19
+ {{ $headingTitles = $headingTitles | append (printf "< h2 > %s" $h2.Title) }}
20
20
{{ end }}
21
21
{{ end }}
22
22
23
- {{ $content := $page.RawContent }}
23
+ {{ $content := $page.Content | htmlUnescape }}
24
24
{{ $len := len $headingKeys }}
25
25
{{ $data := dict }}
26
26
36
36
{{ $headingTitle := index $headingTitles $i }}
37
37
38
38
{{ if eq $i 0 }}
39
- {{ $data = $data | merge (dict $headingKey ($content | $page.RenderString | plainify | htmlUnescape | chomp)) }}
39
+ {{ $data = $data | merge (dict $headingKey ($content | plainify | htmlUnescape | chomp)) }}
40
40
{{ else }}
41
- {{ $parts := split $content (printf "\n%s\n " $headingTitle) }}
41
+ {{ $parts := split $content (printf "%s " $headingTitle) }}
42
42
{{ $lastPart := index $parts (sub (len $parts) 1) }}
43
43
44
- {{ $data = $data | merge (dict $headingKey ($lastPart | $page.RenderString | plainify | htmlUnescape | chomp)) }}
44
+ {{ $data = $data | merge (dict $headingKey ($lastPart | plainify | htmlUnescape | chomp)) }}
45
45
{{ $content = strings.TrimSuffix $lastPart $content }}
46
- {{ $content = strings.TrimSuffix (printf "\n%s\n " $headingTitle) $content }}
46
+ {{ $content = strings.TrimSuffix (printf "%s " $headingTitle) $content }}
47
47
{{ end }}
48
48
{{ end }}
49
49
{{ end }}
You can’t perform that action at this time.
0 commit comments