diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000..67d4fd3 --- /dev/null +++ b/layouts/_default/_markup/render-heading.html @@ -0,0 +1,8 @@ + + {{ if and (ne .Level 1) (not (index .Attributes "data-toc-skip")) }} + {{- .Text -}} + + {{ else }} + {{- .Text -}} + {{ end }} + \ No newline at end of file diff --git a/layouts/partials/refactor-content.html b/layouts/partials/refactor-content.html index 9da665b..898f58b 100644 --- a/layouts/partials/refactor-content.html +++ b/layouts/partials/refactor-content.html @@ -18,19 +18,4 @@ {{ $content = replaceRE `` `` $content }} {{ end }} - -{{ $headingLevels := slice "2" "3" "4" "5" }} -{{ $headingContent := $content }} - -{{ range $level := $headingLevels }} - {{ $markStart := printf `(.*?)%s` $markStart $markEnd }} - {{ $replacement := printf `%s$1">$2%s` $markStart $markEnd }} - {{ $headingContent = replaceRE $pattern $replacement $headingContent }} -{{ end }} - -{{ $content = $headingContent | safeHTML }} - {{ $content | safeHTML }} \ No newline at end of file