Skip to content

Commit 557a623

Browse files
authored
Merge pull request #1377 from hkad98/jkd/docs-ci-build
fix(docs): fix version regex in assemble-versions.sh
2 parents 51389a4 + f3606a2 commit 557a623

File tree

7 files changed

+32
-32
lines changed

7 files changed

+32
-32
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{{/* Cached chevron SVG icon — loaded and minified once per build. */}}
2+
{{- $icon := resources.Get "icons/chevron-menu.svg" -}}
3+
{{- $svg := $icon | minify -}}
4+
{{- return (replace $svg.Content "<svg " "<svg aria-hidden=\"true\" focusable=\"false\" ") -}}

docs/layouts/partials/head-css.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
{{ $scssMain := "scss/main.scss"}}
3-
{{ if .Site.IsServer }}
3+
{{ if .IsServer }}
44
{{/* Note the missing postCSS. This makes it snappier to develop in Chrome, but makes it look sub-optimal in other browsers. */}}
55
{{ $css := resources.Get $scssMain | toCSS (dict "enableSourceMap" true) }}
66
<link href="{{ $css.RelPermalink }}" rel="stylesheet">

docs/layouts/partials/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
{{- template "_internal/schema.html" . -}}
2121
{{- template "_internal/twitter_cards.html" . -}}
2222

23-
{{ partialCached "head-css.html" . "asdf" }}
23+
{{ partialCached "head-css.html" .Site "head-css" }}
2424
<script
2525
src="https://code.jquery.com/jquery-3.5.1.min.js"
2626
integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="

docs/layouts/partials/sidebar.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,7 @@
7070
aria-controls="section-{{ $pageId }}"
7171
aria-label="{{ if $activeSection }}Collapse{{ else }}Expand{{ end }} {{ $page.LinkTitle }} section">
7272
<span class="gd-docs-menu-page__chevron">
73-
{{ with resources.Get "icons/chevron-menu.svg" }}
74-
{{ $svg := . | minify }}
75-
{{ $svg := replace $svg.Content "<svg " "<svg aria-hidden=\"true\" focusable=\"false\" " }}
76-
{{ $svg | safeHTML }}
77-
{{ end }}
73+
{{ partialCached "chevron-svg.html" . "chevron" | safeHTML }}
7874
</span>
7975
</button>
8076
{{ end }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{{/* Returns a slice of unique, capitalized page titles from the site.
2+
Called via partialCached — computed once per build, not per page. */}}
3+
{{- $pageTitles := slice -}}
4+
{{- range .Pages -}}
5+
{{- $pageTitles = $pageTitles | append .Title -}}
6+
{{- end -}}
7+
8+
{{- $uniquePageTitles := slice -}}
9+
{{- range $pageTitles -}}
10+
{{- if not (in $uniquePageTitles .) -}}
11+
{{- $uniquePageTitles = $uniquePageTitles | append . -}}
12+
{{- end -}}
13+
{{- end -}}
14+
15+
{{- $capitalTitles := slice -}}
16+
{{- range $uniquePageTitles -}}
17+
{{- $firstChar := substr . 0 1 -}}
18+
{{- if eq $firstChar (upper $firstChar) -}}
19+
{{- $capitalTitles = $capitalTitles | append . -}}
20+
{{- end -}}
21+
{{- end -}}
22+
23+
{{- return $capitalTitles -}}

docs/layouts/partials/structureddata/structureddata.looker.html

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,7 @@
11
{{- $pageData := .Page -}}
22
{{- $siteData := .Site -}}
33

4-
{{- $sectionTitles := slice -}}
5-
{{- range $siteData.Sections -}}
6-
{{- $sectionTitles = $sectionTitles | append .Title -}}
7-
{{- end -}}
8-
9-
{{- $pageTitles := slice -}}
10-
{{- range $siteData.Pages -}}
11-
{{- $pageTitles = $pageTitles | append .Title -}}
12-
{{- end -}}
13-
14-
{{- $uniquePageTitles := slice -}}
15-
{{- range $pageTitles -}}
16-
{{- if not (in $uniquePageTitles .) -}}
17-
{{- $uniquePageTitles = $uniquePageTitles | append . -}}
18-
{{- end -}}
19-
{{- end -}}
20-
21-
{{- $capitalTitles := slice -}}
22-
{{- range $uniquePageTitles -}}
23-
{{- $firstChar := substr . 0 1 -}}
24-
{{- if eq $firstChar (upper $firstChar) -}}
25-
{{- $capitalTitles = $capitalTitles | append . -}}
26-
{{- end -}}
27-
{{- end -}}
4+
{{- $capitalTitles := partialCached "structureddata/capital-titles.html" $siteData "capital-titles" -}}
285

296
{{ if in $capitalTitles $pageData.Params.title }}
307
{{ if eq $pageData.Params.title "Introduction" }}

scripts/assemble-versions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ echo "Removing master's latest directory"
3636
rm -rf "${content_dir:?}/latest"
3737

3838
# 4. Find the highest numbered version and promote it to "latest"
39-
highest_version=$(ls -1 "./$content_dir/" | grep -E '^[0-9]+$' | sort -V | tail -n 1)
39+
highest_version=$(ls -1 "./$content_dir/" | grep -E '^[0-9]+\.[0-9]+$' | sort -V | tail -n 1)
4040

4141
if [ -n "$highest_version" ]; then
4242
echo "Promoting version $highest_version to /latest"

0 commit comments

Comments
 (0)