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