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