[www-doc] [Git][VideoLAN.org/websites][hugo-rewrite] hugo: use site.Sites/Data instead of hugo.* for 0.131 compatibility
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Tue May 5 11:08:12 UTC 2026
Felix Paul Kühne pushed to branch hugo-rewrite at VideoLAN organization / websites
Commits:
be46a702 by Felix Paul Kühne at 2026-05-05T13:07:49+02:00
hugo: use site.Sites/Data instead of hugo.* for 0.131 compatibility
- - - - -
10 changed files:
- www.videolan.org/layouts/index.html
- www.videolan.org/layouts/partials/site/footer.html
- www.videolan.org/layouts/partials/site/head.html
- www.videolan.org/layouts/partials/site/sponsors.html
- www.videolan.org/layouts/partials/vlc/download-hero.html
- www.videolan.org/layouts/partials/vlc/download-os-hero.html
- www.videolan.org/layouts/partials/vlc/url.html
- www.videolan.org/layouts/release/single.html
- www.videolan.org/layouts/shortcodes/vlc-version.html
- www.videolan.org/layouts/vlc/list.html
Changes:
=====================================
www.videolan.org/layouts/index.html
=====================================
@@ -154,7 +154,7 @@
<div class="col-md-6">
<h1 style="margin-bottom: 13px;"><a href="/news/">{{ i18n "News & Updates" | safeHTML }}</a></h1>
<div dir="ltr" lang="en">
- {{ $en := index (where hugo.Sites "Language.Lang" "en") 0 }}
+ {{ $en := index (where site.Sites "Language.Lang" "en") 0 }}
{{ $news := where $en.RegularPages "Section" "news" }}
{{ range first 5 ($news.ByDate.Reverse) }}
<div class="item">
=====================================
www.videolan.org/layouts/partials/site/footer.html
=====================================
@@ -83,14 +83,14 @@
</div>
{{- /* Language switcher: jump to the same path under the chosen language. */ -}}
- {{- if gt (len hugo.Sites) 1 }}
+ {{- if gt (len site.Sites) 1 }}
<div class="row">
<div id="translation" class="col-md-12" style="font-size: 9px;">
<div class="footerHeading">Language:
<select onchange="location = this.options[this.selectedIndex].value;">
{{- $current := site.Language.Lang -}}
{{- $relPath := strings.TrimPrefix (printf "/%s" $current) .RelPermalink -}}
- {{- range hugo.Sites }}
+ {{- range site.Sites }}
{{- $lang := .Language -}}
{{- $href := cond (eq $lang.Lang "en") $relPath (printf "/%s%s" $lang.Lang $relPath) -}}
<option value="{{ $href }}"{{ if eq $lang.Lang $current }} selected{{ end }}>{{ $lang.Params.label }}</option>
=====================================
www.videolan.org/layouts/partials/site/head.html
=====================================
@@ -50,7 +50,7 @@
partials/site/localised-href.html — keep all three in sync. */ -}}
{{- if eq site.Language.Lang "en" }}
{{- $codes := slice -}}
-{{- range hugo.Sites }}{{- $codes = $codes | append (lower .Language.Lang) }}{{- end }}
+{{- range site.Sites }}{{- $codes = $codes | append (lower .Language.Lang) }}{{- end }}
<script>
(function () {
if (location.search.indexOf('lang=en') !== -1) return;
=====================================
www.videolan.org/layouts/partials/site/sponsors.html
=====================================
@@ -2,7 +2,7 @@
<div class="sponsors-carousel-wrapper">
<h6>{{ i18n "Partners" }}</h6>
<div id="sponsors-carousel">
- {{- range hugo.Data.sponsors.items }}
+ {{- range site.Data.sponsors.items }}
<a target="_blank" rel="noopener" href="{{ .link }}">
<img src="//images.videolan.org/images/partners/{{ .img }}" alt="Partner" />
</a>
=====================================
www.videolan.org/layouts/partials/vlc/download-hero.html
=====================================
@@ -1,8 +1,8 @@
-{{- $vlc := hugo.Data.vlc -}}
+{{- $vlc := site.Data.vlc -}}
{{- $default := index $vlc "windows" -}}
{{- $defaultURL := partial "vlc/url.html" (dict "platform" $default "vlc" $vlc) -}}
{{- $screenshotsKey := .Params.screenshots_key | default "all" -}}
-{{- $screenshots := index hugo.Data.vlc_screenshots $screenshotsKey -}}
+{{- $screenshots := index site.Data.vlc_screenshots $screenshotsKey -}}
{{- /* Pre-compute URLs for client-side OS detection so the JS doesn't have
to know about path/dl_base/version composition. */ -}}
{{- $resolved := dict -}}
=====================================
www.videolan.org/layouts/partials/vlc/download-os-hero.html
=====================================
@@ -9,13 +9,13 @@
*/ -}}
{{- $os := .Params.os -}}
{{- $osData := .Params.os_data | default $os -}}
-{{- $vlc := hugo.Data.vlc -}}
+{{- $vlc := site.Data.vlc -}}
{{- $platform := index $vlc $osData -}}
{{- $platformURL := partial "vlc/url.html" (dict "platform" $platform "vlc" $vlc) -}}
{{- $title := .Params.hero_title | default (printf "VLC for %s" $platform.name) -}}
{{- $titleLocalised := i18n $title -}}
{{- if $titleLocalised }}{{ $title = $titleLocalised }}{{ end -}}
-{{- $screenshots := index hugo.Data.vlc_screenshots $os -}}
+{{- $screenshots := index site.Data.vlc_screenshots $os -}}
<section class="download-wrapper">
<div class="row reorder-xs">
{{- if $screenshots }}
=====================================
www.videolan.org/layouts/partials/vlc/url.html
=====================================
@@ -1,7 +1,7 @@
{{- /*
Resolve a VLC platform's download URL from data/vlc.toml.
Args (dict):
- platform — the per-platform table (e.g. hugo.Data.vlc.windows).
+ platform — the per-platform table (e.g. site.Data.vlc.windows).
vlc — the full vlc data table (for dl_base when computing from path).
Returns the URL string. Direct .url wins; otherwise dl_base/version/path with
VERSION expanded.
=====================================
www.videolan.org/layouts/release/single.html
=====================================
@@ -3,7 +3,7 @@
title page title (browser tab — plain text)
display_title on-page H1 (HTML allowed)
branch optional, e.g. "3_0" — pulls shared content from
- hugo.Data.releases[branch] (carousel, highlights,
+ site.Data.releases[branch] (carousel, highlights,
videos, features, downloads, changelog, body_color,
hero_version_label). Per-page frontmatter wins.
release_version e.g. "3.0.23" — substituted into download URLs and
@@ -16,7 +16,7 @@
*/ -}}
{{ define "main" }}
{{- $branchData := dict -}}
-{{- with .Params.branch }}{{ $branchData = index hugo.Data.releases . }}{{ end -}}
+{{- with .Params.branch }}{{ $branchData = index site.Data.releases . }}{{ end -}}
{{- $version := .Params.release_version | default "" -}}
{{- /* helper: per-page param falls back to data file */ -}}
{{- $carousel := .Params.carousel | default $branchData.carousel -}}
=====================================
www.videolan.org/layouts/shortcodes/vlc-version.html
=====================================
@@ -1,3 +1,3 @@
{{- /* Version string for a VLC platform key from data/vlc.toml. Usage: {{< vlc-version "ios" >}} */ -}}
{{- $key := .Get 0 -}}
-{{- (index hugo.Data.vlc $key).version -}}
+{{- (index site.Data.vlc $key).version -}}
=====================================
www.videolan.org/layouts/vlc/list.html
=====================================
@@ -49,7 +49,7 @@
<div class="col-md-12 padding-bottom-24">
<h1 style="margin-bottom: 25px;" class="red">{{ i18n "Screenshots" }}</h1>
<div id="content-carousel">
- {{- range hugo.Data.vlc_screenshots.carousel }}
+ {{- range site.Data.vlc_screenshots.carousel }}
<div class="screenshot-4-3-responsive screenshot-small">
<a href="//images.videolan.org/vlc/screenshots/{{ .img }}" rel="lightbox-vlc">
<img src="//images.videolan.org/vlc/screenshots/{{ .thumb }}" alt="VLC media player - {{ .name }}" />
View it on GitLab: https://code.videolan.org/VideoLAN.org/websites/-/commit/be46a702f5937427c43b932407e9100df8568d72
--
View it on GitLab: https://code.videolan.org/VideoLAN.org/websites/-/commit/be46a702f5937427c43b932407e9100df8568d72
You're receiving this email because of your account on code.videolan.org.
More information about the www-doc
mailing list