This is an automated email from the ASF dual-hosted git repository.

snazy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git


The following commit(s) were added to refs/heads/main by this push:
     new 944cad4d3 Update Hugo and docsy (#3895)
944cad4d3 is described below

commit 944cad4d3ef120036628b3070126d7a728614a53
Author: Robert Stupp <[email protected]>
AuthorDate: Mon Mar 2 08:44:51 2026 +0100

    Update Hugo and docsy (#3895)
    
    Hugo updated from 0.131.0 (released Aug 2024) to 0.157.0, docsy updated 
from 0.10.0 (released May 2024) to 0.14.3. (Docsy has strict requirements for 
the Hugo version.)
    
    This allows:
    * Nicer code blocks using "Chroma" (links in hugo.yaml).
    * "GitHub/Obsidian/Typora style" alerts.
      Those styles are also rendered on GH, so a little bit nicer.
      The "alert" on the "in-dev" docs page has been updated.
    
    Some partials had to be updated to reflect changes in Docsy. Changes to 
keep the style as close as possible to the current layout are in this PR as 
well.
    
    As Ubuntu's .deb repository offers only Hugo 0.131.0, the installation part 
in the Dockerfile has been updated to use 'snap', which offers Hugo 0.157.0. 
brew offers 0.157.0 as well.
    
    Co-authored-by: Alexandre Dutra <[email protected]>
---
 site/.gitignore                          |  1 +
 site/README.md                           |  3 +-
 site/assets/scss/_styles_project.scss    | 23 +++++++++++
 site/assets/scss/_variables_project.scss |  7 ++++
 site/content/in-dev/unreleased/_index.md | 10 ++---
 site/docker/Dockerfile                   | 13 +++++--
 site/go.mod                              |  2 +-
 site/go.sum                              |  8 ++--
 site/hugo.yaml                           | 34 +++++++++++-----
 site/layouts/partials/head.html          | 67 +++++++++++++++++++++++---------
 site/layouts/partials/navbar.html        | 20 ++++++----
 11 files changed, 139 insertions(+), 49 deletions(-)

diff --git a/site/.gitignore b/site/.gitignore
index e769b7223..9979e5882 100644
--- a/site/.gitignore
+++ b/site/.gitignore
@@ -23,5 +23,6 @@ content/releases/
 
 # Created/generated when running Hugo on the local host
 .hugo_build.lock
+hugo.direct.sum
 public/
 resources/_gen/
diff --git a/site/README.md b/site/README.md
index 7af6f23ae..cde1ed446 100644
--- a/site/README.md
+++ b/site/README.md
@@ -198,7 +198,8 @@ https://gohugo.io/installation/
 
 To develop the site locally (aka `hugo serve -D`), install the following 
dependencies using the `root` user:
 ```bash
-apt install hugo asciidoctor
+apt install asciidoctor
+snap install hugo
 snap install dart-sass
 ```
 
diff --git a/site/assets/scss/_styles_project.scss 
b/site/assets/scss/_styles_project.scss
index 3f653f7d7..8e9ac07f3 100644
--- a/site/assets/scss/_styles_project.scss
+++ b/site/assets/scss/_styles_project.scss
@@ -60,3 +60,26 @@ h5:hover .heading-anchor,
 h6:hover .heading-anchor {
   opacity: 1;
 }
+
+
+// Keep the layout on the Polaris site as it was with Docsy 0.10.0
+:root {
+  --bs-body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", 
Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI 
Emoji", "Segoe UI Symbol";
+}
+.nav-link {
+  --bs-nav-link-color: rgba(255, 255, 255, 0.55);
+  --bs-nav-link-hover-color: rgba(255, 255, 255, 0.75);
+  --bs-navbar-active-color: rgba(255, 255, 255, 0.75);
+}
+.td-navbar .td-search {
+  color: rgba(255, 255, 255, 0.55);
+}
+.td-navbar .td-search__input:focus {
+  color: rgb(0,0,0);
+}
+.td-navbar.td-navbar-cover.td-navbar-transparent {
+  background-color: transparent;
+}
+.-bg-primary {
+  background-color: #30638e;
+}
diff --git a/site/assets/scss/_variables_project.scss 
b/site/assets/scss/_variables_project.scss
index 4f990c4fa..00ae68861 100644
--- a/site/assets/scss/_variables_project.scss
+++ b/site/assets/scss/_variables_project.scss
@@ -22,3 +22,10 @@
    https://www.docsy.dev/docs/adding-content/lookandfeel/#fonts
  */
 $td-enable-google-fonts: false;
+
+// Keep the layout on the Polaris site as it was with Docsy 0.10.0
+$td-navbar-bg-color: #30638e !default;
+
+// Dark mode disabled - see hugo.yaml.
+// https://www.docsy.dev/docs/content/lookandfeel/#how-to-disable-dark-mode
+$enable-dark-mode: false;
diff --git a/site/content/in-dev/unreleased/_index.md 
b/site/content/in-dev/unreleased/_index.md
index 369a32f07..5b42ca89d 100644
--- a/site/content/in-dev/unreleased/_index.md
+++ b/site/content/in-dev/unreleased/_index.md
@@ -31,11 +31,11 @@ cascade:
 # This file will NOT be copied into a new release's versioned docs folder.
 ---
 
-{{< alert warning >}}
-These pages refer to the current state of the main branch, which is still 
under active development.
-
-Functionalities can be changed, removed or added without prior notice.
-{{< /alert >}}
+> [!DANGER] Caution!
+> 
+> These pages refer to the current state of the main branch, which is still 
under active development.
+> 
+> Functionalities can be changed, removed or added without prior notice.
 
 Apache Polaris is a catalog implementation for Apache Iceberg&trade; tables 
and is built on the open source Apache Iceberg&trade; REST protocol.
 
diff --git a/site/docker/Dockerfile b/site/docker/Dockerfile
index 297c9aa7d..0d5b9f7e7 100644
--- a/site/docker/Dockerfile
+++ b/site/docker/Dockerfile
@@ -17,12 +17,19 @@
 # under the License.
 #
 
-FROM ubuntu:24.04 AS hugo
+FROM ubuntu:25.10 AS hugo
 
-ENV LANGUAGE='en_US:en'
+ENV LANGUAGE='en_US:en' \
+    HUGO_VERSION='0.157.0'
 
+# Install all packages and Hugo.
+# Hugo v0.157.0 isn't available via Ubuntu's package repos, but as a download 
from the project.
+# The package for the currently running system architecture (amd64/arm64) is 
being downloaded and installed.
+# Ubuntu provides recent Hugo versions via `snap`, but that's way too 
complicated to use in a Docker container.
 RUN apt-get update && \
-    apt-get install --yes --no-install-recommends golang hugo asciidoctor npm 
curl git && \
+    apt-get install --yes --no-install-recommends golang asciidoctor npm curl 
git && \
+    curl --fail-with-body --location --output hugo.deb 
"https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_withdeploy_${HUGO_VERSION}_linux-$(go
 env GOARCH).deb" && \
+    dpkg --install ./hugo.deb && \
     rm -rf /var/lib/apt/lists/* && \
     npm install --global http-server && \
     mkdir -p /polaris/site/resources
diff --git a/site/go.mod b/site/go.mod
index b3fd51372..b5cf9929c 100644
--- a/site/go.mod
+++ b/site/go.mod
@@ -22,5 +22,5 @@ module github.com/apache/polaris
 go 1.22.2
 
 require (
-       github.com/google/docsy v0.10.0 // indirect
+       github.com/google/docsy v0.14.3 // indirect
 )
diff --git a/site/go.sum b/site/go.sum
index 78bc9349c..e06663a41 100644
--- a/site/go.sum
+++ b/site/go.sum
@@ -1,4 +1,4 @@
-github.com/FortAwesome/Font-Awesome v0.0.0-20240402185447-c0f460dca7f7/go.mod 
h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
-github.com/google/docsy v0.10.0 h1:6tMDacPwAyRWNCfvsn/9qGOZDQ8b0aRzjRZvnZPY5dg=
-github.com/google/docsy v0.10.0/go.mod 
h1:c0nIAqmRTOuJ01F85U/wJPQtc3Zj9N58Kea9bOT2AJc=
-github.com/twbs/bootstrap v5.3.3+incompatible/go.mod 
h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
+github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3/go.mod 
h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
+github.com/google/docsy v0.14.3 h1:4uFgPWTPj4NT79IboVkXGi49LLQadLVfU4WNOfD/s74=
+github.com/google/docsy v0.14.3/go.mod 
h1:1Fj1W1O3esZh7IBQ8XAYtxtg10udBXuGI89+LUQc1AU=
+github.com/twbs/bootstrap v5.3.8+incompatible/go.mod 
h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
diff --git a/site/hugo.yaml b/site/hugo.yaml
index 354beb316..8dcfa7a04 100644
--- a/site/hugo.yaml
+++ b/site/hugo.yaml
@@ -77,8 +77,10 @@ params:
     sidebar_menu_foldable: true
     sidebar_cache_limit: 1000
     # Dark doesn't look great for example with the `redoc` shortcode :(
+    # https://www.docsy.dev/docs/content/lookandfeel/#how-to-disable-dark-mode
     #showLightDarkModeMenu: true
     sidebar_search_disable: true
+    navbar_theme: light
 
   plantuml:
     # Disabled for now, loads external JS, see ASF data policy
@@ -89,6 +91,9 @@ params:
     # https://privacy.apache.org/policies/website-policy.html
     enable: false
 
+  # See code highlighting below
+  #prism_syntax_highlighting: true
+
 imaging:
   resampleFilter: "CatmullRom"
   quality: 75
@@ -260,14 +265,15 @@ menu:
 module:
   hugoVersion:
     extended: true
-    # The Hugo versions (as of 2024/09/04):
-    #   in latest Ubuntu 24.04: 0.123.7
-    #   in brew: 0.134.0
-    min: 0.123.7
+    # The Hugo versions (as of 2026/02/26):
+    #   in the latest Ubuntu 25.10: 0.157.0 (via 'snap', not 'apt')
+    #   in brew: 0.157.0
+    # When changing the version, also update the version in 
site/docker/Dockerfile
+    min: 0.157.0
   imports:
     - path: github.com/google/docsy
       # Pin to this release, newer releases _might_ break the customized 
layouts
-      version: v0.10.0
+      version: v0.14.3
 
 outputs:
   section:
@@ -278,6 +284,12 @@ outputs:
 
 markup:
   highlight:
+    # See 
https://www.docsy.dev/docs/content/lookandfeel/#code-highlighting-with-chroma
+    # See https://gohugo.io/content-management/syntax-highlighting/
+    #
+    # "Prism" syntax highlighting looks a bit nicer, but quite some code 
blocks become a bit
+    # too big (horizontally), so users would have to scroll horizontally to 
see the code.
+    # 'lineNumbersInTable=true' is "required" (for UX reasons) as well.
     anchorLineNos: false
     codeFences: true
     guessSyntax: false
@@ -285,16 +297,20 @@ markup:
     hl_inline: false
     lineAnchors: ''
     lineNoStart: 1
-    lineNos: false
-    lineNumbersInTable: true
+    lineNos: true
+    lineNumbersInTable: false
     noClasses: true
     noHl: false
-    style: 'monokai'
+    # 'tango' == "Chroma" syntax highlighting theme
+    style: 'tango'
     tabWidth: 4
   goldmark:
     parser:
       autoHeadingID: true
       autoHeadingIDType: github
+      attribute:
+        # See https://gohugo.io/render-hooks/blockquotes/#alerts
+        block: true
     renderer:
       unsafe: true
 
@@ -308,7 +324,7 @@ privacy:
     disable: true
   instagram:
     simple: true
-  twitter:
+  x: # was 'twitter'
     enableDNT: false
     simple: true
   vimeo:
diff --git a/site/layouts/partials/head.html b/site/layouts/partials/head.html
index 5e182830b..ae0292060 100644
--- a/site/layouts/partials/head.html
+++ b/site/layouts/partials/head.html
@@ -1,11 +1,48 @@
+{{/* cSpell:ignore docsearch opengraph outputformat */ -}}
 <meta charset="utf-8">
 <meta name="viewport" content="width=device-width, initial-scale=1, 
shrink-to-fit=no">
+
+{{ $darkMode := partialCached "dark-mode-config.html" "dark-mode-global" -}}
+{{ if $darkMode.enable -}}
+{{/* Browser hints before CSS loads */ -}}
+<meta name="color-scheme" content="light dark">
+<meta name="theme-color" media="(prefers-color-scheme: light)" 
content="#ffffff">
+<meta name="theme-color" media="(prefers-color-scheme: dark)"  
content="#000000">
+
+{{/* Styles to set canvas colors and avoid transitions */ -}}
+<style>
+  {{/* Set system colors as default */ -}}
+  html { background: Canvas; color: CanvasText; }
+  {{/* Define reasonable dark defaults */ -}}
+  @media (prefers-color-scheme: dark) {
+    html { background: #0b0d12; color: #e6e6e6; }
+  }
+  {{/* Avoid transitions until theme CSS is loaded */ -}}
+  html[data-theme-init] * { transition: none !important; }
+</style>
+
+{{/* Set theme attribute before CSS loads to prevent flash */ -}}
+<script>
+  (function() {
+    const themeKey = 'td-color-theme';
+    const storedTheme = localStorage.getItem(themeKey);
+    let theme = storedTheme || (window.matchMedia('(prefers-color-scheme: 
dark)').matches ? 'dark' : 'light');
+
+    if (theme === 'auto') {
+      theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 
'dark' : 'light';
+    }
+
+    document.documentElement.setAttribute('data-bs-theme', theme);
+  })();
+</script>
+{{ end -}}
+
 {{ range .AlternativeOutputFormats -}}
 <link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | 
safeURL }}">
 {{ end -}}
 
 {{ $outputFormat := partial "outputformat.html" . -}}
-{{ if and hugo.IsProduction (ne $outputFormat "print") -}}
+{{ if and hugo.IsProduction (ne $outputFormat "print") (ne .Site.Language.Lang 
"xx") -}}
 <meta name="robots" content="index, follow">
 {{ else -}}
 <meta name="robots" content="noindex, nofollow">
@@ -20,11 +57,11 @@
     {{ .Site.Title -}}
   {{ end -}}
 </title>
-<meta name="description" content="{{ template "partials/page-description.html" 
. }}">
-{{ template "_internal/opengraph.html" . -}}
-{{ template "_internal/schema.html" . -}}
-{{ template "_internal/twitter_cards.html" . -}}
-{{ partialCached "head-css.html" . "asdf" -}}
+<meta name="description" content="{{ partial "page-description.html" . }}">
+{{ partial "opengraph.html" . -}}
+{{ partial "schema.html" . -}}
+{{ partial "twitter_cards.html" . -}}
+{{ partialCached "head-css.html" . "head-css-cache-key" -}}
 
 <!--
 Customization to host jQuery + Lunr JS files on ASF site
@@ -54,27 +91,21 @@ Customization to host jQuery + Lunr JS files on ASF site
 
 {{ partial "hooks/head-end.html" . -}}
 
-{{/* To comply with GDPR, cookie consent scripts places in head-end must 
execute before Google Analytics is enabled */ -}}
-{{ if hugo.IsProduction -}}
-  {{ $enableGtagForUniversalAnalytics := not 
.Site.Params.disableGtagForUniversalAnalytics -}}
-  {{ if (or $enableGtagForUniversalAnalytics (hasPrefix 
.Site.Config.Services.GoogleAnalytics.ID "G-")) -}}
-    {{ template "_internal/google_analytics_gtag.html" . -}}
-  {{ else -}}
-    {{ template "_internal/google_analytics.html" . -}}
-  {{ end -}}
-{{ end -}}
+<!--
+Google Analytics part removed.
+-->
 
 {{ define "algolia/head" -}}
 
 {{ if and .Site.Params.search (isset .Site.Params.search "algolia") -}}
-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/[email protected]";
-  
integrity="sha512-AyDFDkYyALC5qoao077IqAOV7UC4oKCBTp+mJfjIt306AIRoBxoEZYDo0kAx/R7RbT+3EYEky1po/F1w1eQt7g=="
+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/[email protected]";
+  
integrity="sha512-l7pkV1dOURFyHCeH8I4fK9lCkQKuqhlsTCqRl3zktifDlB8oTUJ+mJPgYkK9kHpUut8j1iPquTv32t6hvTPv3g=="
   crossorigin="anonymous" />
 {{ end -}}
 
 {{ if ne .Site.Params.algolia_docsearch nil -}}
 {{ warnf `Config 'params.algolia_docsearch' is deprecated: use 
'params.search.algolia'
-      For details, see 
https://www.docsy.dev/docs/adding-content/search/#algolia-docsearch.` -}}
+      For details, see 
https://www.docsy.dev/docs/content/search/#algolia-docsearch.` -}}
 {{ end -}}
 
 {{ end -}}
diff --git a/site/layouts/partials/navbar.html 
b/site/layouts/partials/navbar.html
index 2532a7fc1..fef303bad 100644
--- a/site/layouts/partials/navbar.html
+++ b/site/layouts/partials/navbar.html
@@ -5,8 +5,9 @@
 {{ $baseURL := urls.Parse $.Site.Params.Baseurl -}}
 
 <nav class="td-navbar js-navbar-scroll
-            {{- if $cover }} td-navbar-cover {{- end }}" data-bs-theme="dark">
-<div class="container-fluid flex-column flex-md-row">
+      {{- if $cover }} td-navbar-cover td-navbar-transparent {{- end }}"
+      {{- if eq (.Param "ui.navbar_theme") "dark" }} data-bs-theme="dark" {{- 
end }}>
+<div class="td-navbar-container container-fluid flex-column flex-md-row">
   <a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}">
     <span class="navbar-brand__logo navbar-logo">
       {{- if ne .Site.Params.ui.navbar_logo false -}}
@@ -16,7 +17,8 @@
       {{ end -}}
     </span>
   </a>
-  <div class="td-navbar-nav-scroll ms-md-auto" id="main_navbar">
+  <div class="td-navbar__main td-navbar-nav-scroll 
td-navbar-nav-scroll--indicator" id="main_navbar">
+    <div class="scroll-indicator scroll-left"></div>
     <ul class="navbar-nav">
       {{ $p := . -}}
       {{ $s := .Site -}}
@@ -76,23 +78,25 @@
       {{ end -}}
       <!-- Other navbar items -->
       {{ if .Site.Params.versions -}}
-      <li class="nav-item dropdown d-none d-lg-block">
+      <li class="nav-item td-navbar__version-menu">
         {{ partial "navbar-version-selector.html" . -}}
       </li>
       {{ end -}}
       {{ if (gt (len .Site.Home.Translations) 0) -}}
-      <li class="nav-item dropdown d-none d-lg-block">
+      <li class="nav-item td-navbar__lang-menu">
         {{ partial "navbar-lang-selector.html" . -}}
       </li>
       {{ end -}}
-      {{ if .Site.Params.ui.showLightDarkModeMenu -}}
-      <li class="td-light-dark-menu nav-item dropdown">
+      {{- $darkMode := partialCached "dark-mode-config.html" 
"dark-mode-global" -}}
+      {{ if $darkMode.showMenu -}}
+      <li class="nav-item td-navbar__light-dark-menu">
         {{ partial "theme-toggler" . }}
       </li>
       {{ end -}}
     </ul>
+    <div class="scroll-indicator scroll-right"></div>
   </div>
-  <div class="d-none d-lg-block">
+  <div class="td-navbar__search d-none d-lg-block">
     {{ partial "search-input.html" . }}
   </div>
 </div>

Reply via email to