File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!-- Get the product name -->
2
+ {{ $productUrl := .Page.Permalink }}
3
+ {{ $baseUrl := .Site.BaseURL }}
4
+ {{ $linkSplit := split (replace $productUrl $baseUrl "") "/" }}
5
+ {{ $productName := index $linkSplit 0 }}
6
+ <!-- Get the content -->
7
+ {{ $changelogContent := readFile (printf "content/%s/changelog.md" $productName) }}
8
+ {{ $maxNumLogs := 3 }}
9
+ {{ $headings := first $maxNumLogs (findRE `(?m)^##\s(.+)$` $changelogContent) }}
10
+
11
+ < ul >
12
+ {{ if gt (len $headings) 0 }}
13
+ {{ range $headings }}
14
+ {{ $title := replaceRE "^##\\s" "" . }}
15
+ < li > < a href ="{{ absURL (print $productName "/changelog/#" (urlize $title)) }}"> {{ $title }}</ a > </ li >
16
+ {{ end }}
17
+ < li > < a href ="{{ absURL (print $productName "/changelog/")}}"> Older...</ a > </ li >
18
+ {{ else }}
19
+ < li > < p > No changelog found...</ p > </ li >
20
+ {{ end }}
21
+ </ ul >
You can’t perform that action at this time.
0 commit comments