File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 1+ <!-- Get the product name -->
12{{ $productUrl := .Page.Permalink }}
23{{ $baseUrl := .Site.BaseURL }}
34{{ $linkSplit := split (replace $productUrl $baseUrl "") "/" }}
45{{ $productName := index $linkSplit 0 }}
6+ <!-- Get the content -->
57{{ $changelogContent := readFile (printf "content/%s/changelog.md" $productName) }}
68{{ $maxNumLogs := 3 }}
79{{ $headings := first $maxNumLogs (findRE `(?m)^##\s(.+)$` $changelogContent) }}
810
911< ul >
12+ {{ if gt (len $headings) 0 }}
1013 {{ range $headings }}
1114 {{ $title := replaceRE "^##\\s" "" . }}
1215 < li > < a href ="{{ absURL (print $productName "/changelog/#" (urlize $title)) }}"> {{ $title }}</ a > </ li >
1316 {{ end }}
1417 < li > < a href ="{{ absURL (print $productName "/changelog/")}}"> Older...</ a > </ li >
18+ {{ else }}
19+ < li > < p > No changelog found...</ p > </ li >
20+ {{ end }}
1521</ ul >
You can’t perform that action at this time.
0 commit comments