File tree Expand file tree Collapse file tree 16 files changed +102
-26
lines changed Expand file tree Collapse file tree 16 files changed +102
-26
lines changed Original file line number Diff line number Diff line change 1818 uses : actions/checkout@v3
1919 with :
2020 submodules : recursive
21+ - name : Update Latest URL content
22+ shell : pwsh
23+ run : |
24+ .\createLatest.ps1
2125 - name : npm install
2226 working-directory : ./
2327 run : |
4549 with :
4650 name : htmltest-report
4751 path : tmp/.htmltest/htmltest.log
48- retention-days : 7 # Default is 90 days
52+ retention-days : 7 # Default is 90 days
Original file line number Diff line number Diff line change 4343 uses : actions/checkout@v3
4444 with :
4545 submodules : recursive
46+ - name : Update Latest URL content
47+ shell : pwsh
48+ run : |
49+ .\createLatest.ps1
4650 - name : npm install
4751 working-directory : ./
4852 run : |
6064 run : |
6165 hugo --environment GitHubPages
6266 - name : Upload artifact
63- uses : actions/upload-pages-artifact@v1
67+ uses : actions/upload-pages-artifact@v3
6468 with :
6569 path : ./docs
6670
7478 steps :
7579 - name : Deploy to GitHub Pages
7680 id : deployment
77- uses : actions/deploy-pages@v1
81+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change 44resources /
55node_modules /
66tech-doc-hugo
7+ content /en /docs /latest /
8+ content /static /latest /
79content /static /** /* .dtmp
810content /static /** /* .bkp
911content /static /** /* .crswap
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ IgnoreURLs:
2525- " https://blogs.oracle.com/.*"
2626- " https://jsonformatter.org/.*"
2727- " https://www.newtonsoft.com/.*"
28- - " https://.*/ gov.uk/.*"
28+ - " https://.*. gov.uk/.*"
2929- " https://www.elastic.co/.*"
3030IgnoreDirs :
3131- " docs/?.*/_print/"
Original file line number Diff line number Diff line change 1+ $Path = " .\config\_default\config.toml"
2+ $latestName = " latest"
3+
4+ $LatestVersion = (Select-String - Path $Path - Pattern " latest = true" - Context 3 , 0 ) -split " `" "
5+
6+ # Use $LatestVersion[1] as we know that the version is the first line returned and splitting on " makes it the 2nd index
7+ $Version = $LatestVersion [1 ]
8+
9+ # Remove latest folder and contents in docs if it already exists
10+ if (Test-Path " .\content\en\docs\$latestName " ){
11+ Remove-Item - LiteralPath " .\content\en\docs\$latestName " - Force - Recurse
12+ }
13+ # Create new latest docs folder
14+ New-Item - ItemType Directory - Path " .\content\en\docs\$latestName \" - Force
15+ # Copy contents of latest XXXX.X version into latest folder
16+ Copy-Item - Path " .\content\en\docs\$Version \*" - Destination " .\content\en\docs\$latestName \" - Recurse - Force
17+ # Replace the title name for the folder to be latest
18+ (Get-Content .\content\en\docs\latest\_index.md) -replace $Version , " Latest" | Set-Content .\content\en\docs\latest\_index.md
19+
20+ # Remove latest folder and contents in static if it already exists
21+ if (Test-Path " .\content\static\$latestName " ){
22+ Remove-Item - LiteralPath " .\content\static\$latestName " - Force - Recurse
23+ }
24+ # Create new latest static folder
25+ New-Item - ItemType Directory - Path " .\content\static\$latestName \" - Force
26+ # Copy contents of latest XXXX.X version into latest folder
27+ Copy-Item - Path " .\content\static\$Version \*" - Destination " .\content\static\$latestName \" - Recurse - Force
Original file line number Diff line number Diff line change 55{{- $isRoot := false }}
66{{- /* Get the current version, and whether the website is currently nested (has /docs prepended). */}}
77{{- $isNested := false }}
8- {{- $currentVer := index (findRE `^\/docs\/[0-9\.]*\/` .Page.RelPermalink 1) 0 }}
8+ {{- $currentVer := index (findRE `^\/docs\/( [0-9\.]*|latest) \/` .Page.RelPermalink 1) 0 }}
99{{- if (not $currentVer) }}
10- {{- $currentVer = index (findRE `^\/docs\/docs\/[0-9\.]*\/` .Page.RelPermalink 1) 0 }}
10+ {{- $currentVer = index (findRE `^\/docs\/docs\/( [0-9\.]*|latest) \/` .Page.RelPermalink 1) 0 }}
1111 {{- $currentVer = replaceRE `^\/docs` "" $currentVer 1 }}
1212 {{- if (or $currentVer (index (findRE `^\/docs\/[^\/]*\/` .Page.RelPermalink 1) 0))}}
1313 {{- $isNested = true }}
Original file line number Diff line number Diff line change 1+ < div class ="section-index ">
2+ {{ $pages := (where .Site.Pages "Section" .Section).ByWeight }}
3+ {{ $pages = (where $pages "Type" "!=" "search") }}
4+ {{ $pages = (where $pages "Title" "!=" "Latest") }}
5+ {{ $parent := .Page }}
6+ {{ if $parent.Params.no_list }}
7+ {{/* If no_list is true we don't show a list of subpages */}}
8+ {{ else if $parent.Params.simple_list }}
9+ {{/* If simple_list is true we show a bulleted list of subpages */}}
10+ < ul >
11+ {{ range $pages }}
12+ {{ if eq .Parent $parent }}
13+ < li > < a href ="{{ .RelPermalink }} "> {{- .Title -}}</ a > </ li >
14+ {{ end }}
15+ {{ end }}
16+ </ ul >
17+ {{ else }}
18+ {{/* Otherwise we show a nice formatted list of subpages with page descriptions */}}
19+ < hr class ="panel-line ">
20+ {{ range $pages }}
21+ {{ if eq .Parent $parent }}
22+ < div class ="entry ">
23+ < h5 >
24+ < a href ="{{ .RelPermalink }} "> {{- .Title -}}</ a >
25+ </ h5 >
26+ < p > {{ .Description | markdownify }}</ p >
27+ </ div >
28+ {{ end }}
29+ {{ end }}
30+ {{ end }}
31+ </ div >
Original file line number Diff line number Diff line change 66{{- $link := (printf "%s://%s%s" $url.Scheme $url.Host $url.Path) }}
77{{- /* Get the current version, and whether the website is currently nested (has /docs prepended). */}}
88{{- $isNested := false }}
9- {{- $currentVer := index (findRE `^\/docs\/[0-9\.]*\/` .Page.RelPermalink 1) 0 }}
9+ {{- $currentVer := index (findRE `^\/docs\/( [0-9\.]*|latest) \/` .Page.RelPermalink 1) 0 }}
1010{{- if (not $currentVer) }}
11- {{- $currentVer = index (findRE `^\/docs\/docs\/[0-9\.]*\/` .Page.RelPermalink 1) 0 }}
11+ {{- $currentVer = index (findRE `^\/docs\/docs\/( [0-9\.]*|latest) \/` .Page.RelPermalink 1) 0 }}
1212 {{- $currentVer = replaceRE `^\/docs` "" $currentVer 1 }}
1313 {{- if (or $currentVer (index (findRE `^\/docs\/[^\/]*\/` .Page.RelPermalink 1) 0)) }}
1414 {{- $isNested = true }}
Original file line number Diff line number Diff line change 44{{- $versionPath := "" }}
55{{- /* Get the current version, and whether the website is currently nested (has /docs prepended). */}}
66{{- $isNested := false }}
7- {{- $currentVer := index (findRE `^\/docs\/[0-9\.]*\/` .Page.RelPermalink 1) 0 }}
7+ {{- $currentVer := index (findRE `^\/docs\/( [0-9\.]*|latest) \/` .Page.RelPermalink 1) 0 }}
88{{- if (not $currentVer) }}
9- {{- $currentVer = index (findRE `^\/docs\/docs\/[0-9\.]*\/` .Page.RelPermalink 1) 0 }}
9+ {{- $currentVer = index (findRE `^\/docs\/docs\/( [0-9\.]*|latest) \/` .Page.RelPermalink 1) 0 }}
1010 {{- $currentVer = replaceRE `^\/docs` "" $currentVer 1 }}
1111 {{- if (or $currentVer (index (findRE `^\/docs\/[^\/]*\/` .Page.RelPermalink 1) 0)) }}
1212 {{- $isNested = true }}
1818 {{ range where .Site.Params.versions "url" $version }}
1919 {{ $versionPath = .version }}
2020 {{ end }}
21+ {{- else if eq $currentVer "/docs/latest/" }}
22+ {{ $versionPath = "latest" }}
2123{{- else if $currentVer }}
2224 {{ range where .Site.Params.versions "url" $currentVer }}
2325 {{ $versionPath = .version }}
2426 {{ end }}
2527{{- else }}
26- {{- /* use latest as not in a versioned page */}}
28+ {{- /* use latest as not in a versioned page */}}
2729 {{ range where .Site.Params.versions "latest" true }}
2830 {{- $versionPath = .version }}
2931 {{ end }}
Original file line number Diff line number Diff line change 44{{- $versionPath := "" }}
55{{- /* Get the current version, and whether the website is currently nested (has /docs prepended). */}}
66{{- $isNested := false }}
7- {{- $currentVer := index (findRE `^\/docs\/[0-9\.]*\/` .Page.RelPermalink 1) 0 }}
7+ {{- $currentVer := index (findRE `^\/docs\/( [0-9\.]*|latest) \/` .Page.RelPermalink 1) 0 }}
88{{- if (not $currentVer) }}
9- {{- $currentVer = index (findRE `^\/docs\/docs\/[0-9\.]*\/` .Page.RelPermalink 1) 0 }}
9+ {{- $currentVer = index (findRE `^\/docs\/docs\/( [0-9\.]*|latest) \/` .Page.RelPermalink 1) 0 }}
1010 {{- $currentVer = replaceRE `^\/docs` "" $currentVer 1 }}
1111 {{- if (or $currentVer (index (findRE `^\/docs\/[^\/]*\/` .Page.RelPermalink 1) 0)) }}
1212 {{- $isNested = true }}
1818 {{ range where .Site.Params.versions "url" $version }}
1919 {{ $versionPath = .version }}
2020 {{ end }}
21+ {{- else if eq $currentVer "/docs/latest/" }}
22+ {{ $versionPath = "latest" }}
2123{{- else if $currentVer }}
2224 {{ range where .Site.Params.versions "url" $currentVer }}
2325 {{ $versionPath = .version }}
You can’t perform that action at this time.
0 commit comments