Skip to content

Templates: replace deprecated Hugo APIs, drop Babel, prune config - #689

Closed
cwhite911 wants to merge 3 commits into
OSGeo:mainfrom
cwhite911:hugo-deprecations
Closed

cwhite911 wants to merge 3 commits into
OSGeo:mainfrom
cwhite911:hugo-deprecations

Conversation

@cwhite911

Copy link
Copy Markdown
Contributor

Removes every template construct that errors on current Hugo, so #638 gets closer to a version-pin flip. Three commits:

  1. Babel removal. The photoswipe lightbox was transpiled for old browsers and then loaded with type="module", which those browsers ignore. The module is now served minified and fingerprinted; @babel/* devDependencies dropped.
  2. Config hygiene. security.exec.allow reduced to ['^go$', '^sass$'] (nothing invokes dart-sass-embedded, postcss, babel, or npx; ^sass$ pre-arms the Dart Sass switch). Removes the misplaced enableInlineShortcodes under [security] and two mounts with nonexistent sources.
  3. Template APIs. .Data.Pages, unguarded .File.UniqueID, .Site.Author, .Site.Config.Services.RSS, and the global minify/fingerprint aliases replaced with forms valid on both 0.113 and current Hugo (toCSS stays: resources.ToCSS is removed upstream, css.Sass does not exist on 0.113). Site.BaseURL string concatenation emitted // URLs on every page; now relURL. News listings use site.RegularPages, which also stops the news section page listing itself as a 2019 item.

Verified on Hugo 0.113 (production compose build; output diff limited to the intended URL fixes) and on Hugo 0.164 extended, which now builds with zero errors. Remaining 0.164 items are upgrade-time only: _build front matter rename in six download pages, allowContent for the four 1996 HTML news files, languageCode/languageName/.Site.Data renames (their replacements do not exist on 0.113), and the sitemap output format.

Part of the cleanup stack preparing #638.

The lightbox module was transpiled for old browsers, then loaded with
type=module, which those browsers ignore. Serve the ES module minified
and fingerprinted; drop the @babel devDependencies.
Drop exec allowances for tools the build never invokes
(dart-sass-embedded, postcss, babel, npx) and allow sass ahead of the
Dart Sass switch. Remove the misplaced enableInlineShortcodes key under
[security] and two mounts whose sources do not exist (bootstrap-icons
is not a dependency; there is no root assets directory).
- .Data.Pages to .Pages; unguarded .File.UniqueID comparisons to
  .RelPermalink; File.Dir where-clause tightened to direct children
- .Site.Author and .Site.Config.Services.RSS (removed upstream) dropped
  from rss.xml along with its unused page-collection prologue
- where .Site.Pages to site.RegularPages for news listings; the news
  section page no longer lists itself as a 2019 item
- global toCSS/minify/fingerprint aliases to their resources.* forms
- Site.BaseURL string concatenation emitted double-slash URLs; use
  relURL. zenodo-card partial now receives its context.
@cwhite911 cwhite911 self-assigned this Aug 3, 2026
@cwhite911 cwhite911 added CI Continuous Integration dependencies Pull requests that update a dependency file labels Aug 3, 2026
@cwhite911

Copy link
Copy Markdown
Contributor Author

Superseded by the stacked-PR version of this branch (same commits, same-repo branch so it can be stacked); link follows.

@cwhite911

Copy link
Copy Markdown
Contributor Author

Resubmitted as #694, bottom of stack #696.

@echoix

echoix commented Aug 4, 2026

Copy link
Copy Markdown
Member

Superseded by the stacked-PR version of this branch (same commits, same-repo branch so it can be stacked); link follows.

Ok, it doesn't work for PRs from forks... :( Maybe that's why I wasn't able for the main repo to get it working in San-Michele. I didn't find why until now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants