Skip to content

Commit 9128710

Browse files
committed
Merge remote-tracking branch 'origin/main' into 2025.1
2 parents e974ba6 + 60d10a0 commit 9128710

File tree

16 files changed

+102
-26
lines changed

16 files changed

+102
-26
lines changed

.github/workflows/checklink.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ jobs:
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: |
@@ -45,4 +49,4 @@ jobs:
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

.github/workflows/hugo.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ jobs:
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: |
@@ -60,7 +64,7 @@ jobs:
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

@@ -74,4 +78,4 @@ jobs:
7478
steps:
7579
- name: Deploy to GitHub Pages
7680
id: deployment
77-
uses: actions/deploy-pages@v1
81+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ public/
44
resources/
55
node_modules/
66
tech-doc-hugo
7+
content/en/docs/latest/
8+
content/static/latest/
79
content/static/**/*.dtmp
810
content/static/**/*.bkp
911
content/static/**/*.crswap

.htmltest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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/.*"
3030
IgnoreDirs:
3131
- "docs/?.*/_print/"

createLatest.ps1

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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

layouts/partials/navbar-version-selector.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
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 }}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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>

layouts/shortcodes/ahref.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
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 }}

layouts/shortcodes/figure.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
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 }}
@@ -18,12 +18,14 @@
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 }}

layouts/shortcodes/filelink.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
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 }}
@@ -18,6 +18,8 @@
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 }}

0 commit comments

Comments
 (0)