Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade hugo #27679

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ci/builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ RUN if [ $ARCH_GCC = x86_64 ]; then \
&& echo '04d4be5097b98cd28de469f8856b3fbe82669f57b482a4cf3092a55e9e8e9e0d htmltest.tar.gz' | sha256sum --check \
&& tar -xzf htmltest.tar.gz -C /usr/local/bin htmltest \
&& rm htmltest.tar.gz \
&& curl -fsSL https://github.com/gohugoio/hugo/releases/download/v0.87.0/hugo_extended_0.87.0_Linux-64bit.tar.gz > hugo.tar.gz \
&& echo 'f216af92c06809c03981296f513ce54d3d690715d3c9fdfaff802d4a6759a260 hugo.tar.gz' | sha256sum --check \
&& curl -fsSL https://github.com/gohugoio/hugo/releases/download/v0.124.1/hugo_extended_0.124.1_Linux-64bit.tar.gz > hugo.tar.gz \
&& echo '55f5a5f6a4c923457b2ed4e2b00c251eabfe43d8d4afbe2ada92d9759c5e0410 hugo.tar.gz' | sha256sum --check \
&& tar -xzf hugo.tar.gz -C /usr/local/bin hugo \
&& rm hugo.tar.gz; \
fi
Expand Down
2 changes: 1 addition & 1 deletion doc/user/content/stylesheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ This is a "full_width" CTA button
Used for prominent messages. Optionally can include a primary and secondary CTA button using `primary_url`, `primary_text`, `secondary_url`, `secondary_text` in shortcode params.

**Primary Only:**
{{< callout primary_url="/docs/get-started/" primary_text="Get Started" >}}
{{< callout primary_url="/get-started/" primary_text="Get Started" >}}
# Header

Some text and the closing button is specified in the shortcode top.
Expand Down
11 changes: 10 additions & 1 deletion doc/user/layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
<img src="{{ .Destination | safeURL | relURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }}>
{{- $url := .Destination | safeURL -}}
{{- $parentPath := partial "relative-link.html" . -}}
<img src="
{{- if hasPrefix $url "/" -}}
{{- $parentPath }}{{ $url | relURL -}}
{{- else -}}
{{- $url | relURL -}}
{{- end -}}
" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }}>
{{- /* Chomp trailing newline. */ -}}
9 changes: 8 additions & 1 deletion doc/user/layouts/_default/_markup/render-link.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{{- $url := .Destination | safeURL -}}
<a href="{{if hasPrefix $url "/"}}{{$url | relURL}}{{else}}{{$url}}{{end}}"{{with .Title}} title="{{.}}"{{end}}>{{.Text | safeHTML}}</a>
{{- $parentPath := partial "relative-link.html" . -}}
<a href="
{{- if hasPrefix $url "/" -}}
{{- $parentPath }}{{ $url | relURL -}}
{{- else -}}
{{- $url -}}
{{- end -}}
" {{with .Title}} title="{{.}}"{{end}}>{{.Text | safeHTML}}</a>
{{- /* Chomp trailing newline. */ -}}
4 changes: 3 additions & 1 deletion doc/user/layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@
</svg>
</button>
</div>
{{ with .File }}
<div>
<a
href="//github.com/MaterializeInc/materialize/edit/main/doc/user/content/{{ .File.Path }}"
href="//github.com/MaterializeInc/materialize/edit/main/doc/user/content/{{ .Path }}"
class="btn-ghost"
>
<svg
Expand All @@ -52,6 +53,7 @@
Edit this page
</a>
</div>
{{ end }}
<div class="footer-links">
<a href="https://materialize.com">Home</a>
<a href="https://status.materialize.com">Status</a>
Expand Down
10 changes: 10 additions & 0 deletions doc/user/layouts/partials/relative-link.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- $baseURL := .Page.Site.BaseURL -}}
{{- $parsedURL := urls.Parse $baseURL -}}
{{/*
This is the subdirectory within which the docs are hosted. We prepend it to relative URLs
since Hugo versions > 0.87 changed how relative URLs are generated and we wish to maintain
the legacy behavior.
*/}}
{{- $parentPath := strings.TrimRight "/" $parsedURL.Path -}}
{{- /* Chomp trailing newline. */ -}}
{{ return $parentPath }}
19 changes: 17 additions & 2 deletions doc/user/layouts/shortcodes/callout.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
{{- $parentPath := partial "relative-link.html" . -}}
<div class="callout">

<div>
{{ .Inner | $.Page.RenderString }}

<p>
{{ if and ($.Params) (isset $.Params "primary_text") }}
<a class="btn" {{ with .Get "primary_url" }} href="{{ . }}" {{ end }}>
<a class="btn" {{ with .Get "primary_url" }} href="
{{- $primaryURL := . | safeURL -}}
{{- if hasPrefix $primaryURL "/" -}}
{{- $parentPath }}{{ $primaryURL | relURL -}}
{{- else -}}
{{- $primaryURL -}}
{{- end -}}"
{{- end }}>
{{ .Get "primary_text" }}
</a>
{{ end }}
{{ if and ($.Params) (isset $.Params "secondary_text") }}
<a class="btn" {{ with .Get "secondary_url" }} href="{{ . }}" {{ end }}>
<a class="btn" {{ with .Get "secondary_url" }} href="
{{- $secondaryURL := . | safeURL -}}
{{- if hasPrefix $secondaryURL "/" -}}
{{- $parentPath }}{{ $secondaryURL | relURL -}}
{{- else -}}
{{- $secondaryURL -}}
{{- end -}}"
{{- end }}>
{{ .Get "secondary_text" }}
</a>
{{ end }}
Expand Down
11 changes: 10 additions & 1 deletion doc/user/layouts/shortcodes/cta.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<a class="cta {{with .Get "full_width"}}full_width{{end}}" href="{{ .Get "href" | relURL }}" {{with .Get "target"}}target="{{.}}"{{end}}}>
{{- $url := .Get "href" | safeURL -}}
{{- $parentPath := partial "relative-link.html" . -}}
<a class="cta {{with .Get "full_width"}}full_width{{end}}" href="
{{- if hasPrefix $url "/" -}}
{{- $parentPath }}{{ $url | relURL -}}
{{- else -}}
{{- $url -}}
{{- end -}}
" {{with .Get "target"}}target="{{.}}"{{end}}>
{{ .Inner | $.Page.RenderString }}
</a>
{{- /* Chomp trailing newline. */ -}}
8 changes: 4 additions & 4 deletions doc/user/layouts/shortcodes/fnlist.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{/* Converts data/sql_funcs.yml into table. */}}

{{ $parentPath := partial "relative-link.html" . }}
{{$releasedVersions := dict}}
{{range (where $.Site.RegularPages "Section" "releases")}}
{{$releasedVersions = merge $releasedVersions (dict .File.ContentBaseName .) }}
Expand Down Expand Up @@ -42,7 +42,7 @@ <h3 id="{{ lower .type | replaceRE "[^a-zA-Z0-9]+" "-" }}-func">
{{ .description | $.Page.RenderString }}

{{ if .url }}
<a href="{{ .url | relURL }}">(docs)</a>.
<a href="{{ $parentPath }}{{ .url | relURL }}">(docs)</a>.
{{ end }}

</p>
Expand All @@ -53,7 +53,7 @@ <h3 id="{{ lower .type | replaceRE "[^a-zA-Z0-9]+" "-" }}-func">

{{ if .unmaterializable_unless_temporal_filter }}
<p><b>Note:</b> This function is <a href="#unmaterializable-functions">unmaterializable</a>, but
can be used in limited contexts in materialized views as a <a href="{{ "/transform-data/patterns/temporal-filters/" | relURL }}">temporal filter</a>.</p>
can be used in limited contexts in materialized views as a <a href="{{ $parentPath }}{{ "/transform-data/patterns/temporal-filters/" | relURL }}">temporal filter</a>.</p>
{{ end }}

{{ if .known_time_zone_limitation_cast }}
Expand All @@ -70,7 +70,7 @@ <h3 id="{{ lower .type | replaceRE "[^a-zA-Z0-9]+" "-" }}-func">
{{ if not $releasePage.Params.released }}
<p>
<b>Unreleased: </b> This function will be released in
<a href="{{ printf "/releases/%s" $versionAdded | relURL }}"><strong>{{$versionAdded}}</strong></a>.
<a href="{{ printf "%s/releases/%s" $parentPath $versionAdded | relURL }}"><strong>{{$versionAdded}}</strong></a>.
It may not be available in your region yet.
The release is scheduled to complete by <strong>{{dateFormat "January 2, 2006" $releasePage.Params.date}}</strong>.
</p>
Expand Down