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