Skip to content
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
52 changes: 26 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:

env:
GO_VERSION: stable
HUGO_VERSION: latest
HUGO_VERSION: "0.166.0"
GOTOOLCHAIN: local

jobs:
Expand Down Expand Up @@ -56,22 +56,10 @@ jobs:
hugo-version: ${{ env.HUGO_VERSION }}
extended: true

- name: Install Dart Sass 1.105.2
shell: bash
run: |
sass_archive="$RUNNER_TEMP/dart-sass-1.105.2-linux-x64.tar.gz"
curl --fail --location --silent --show-error \
--output "$sass_archive" \
https://github.com/sass/dart-sass/releases/download/1.105.2/dart-sass-1.105.2-linux-x64.tar.gz
echo "a530ee08d5792c80bdb9d9614b45fb58219c890cb42a280a80775f0af9c29582 $sass_archive" | sha256sum --check
tar --extract --gzip --file "$sass_archive" --directory "$RUNNER_TEMP"
echo "$RUNNER_TEMP/dart-sass" >> "$GITHUB_PATH"

- name: Record build tool versions
run: |
go version
hugo version
sass --version

- name: Install PDF inspection tools
run: |
Expand Down Expand Up @@ -195,7 +183,7 @@ jobs:
build:
name: Hugo theme checks
runs-on: ubuntu-latest
# CI follows the latest stable Hugo release. A run that reaches this
# CI uses the minimum supported Hugo release. A run that reaches this
# ceiling is hung infrastructure, and a cancelled six-hour job must never
# again stand in for a release verdict.
timeout-minutes: 60
Expand All @@ -215,22 +203,10 @@ jobs:
hugo-version: ${{ env.HUGO_VERSION }}
extended: true

- name: Install Dart Sass 1.105.2
shell: bash
run: |
sass_archive="$RUNNER_TEMP/dart-sass-1.105.2-linux-x64.tar.gz"
curl --fail --location --silent --show-error \
--output "$sass_archive" \
https://github.com/sass/dart-sass/releases/download/1.105.2/dart-sass-1.105.2-linux-x64.tar.gz
echo "a530ee08d5792c80bdb9d9614b45fb58219c890cb42a280a80775f0af9c29582 $sass_archive" | sha256sum --check
tar --extract --gzip --file "$sass_archive" --directory "$RUNNER_TEMP"
echo "$RUNNER_TEMP/dart-sass" >> "$GITHUB_PATH"

- name: Record build tool versions
run: |
go version
hugo version
sass --version

- name: Check translation key parity
run: python3 bin/check-i18n.py
Expand Down Expand Up @@ -436,3 +412,27 @@ jobs:
exit 1
fi
grep -q 'invalid params.ui.typography' "$RUNNER_TEMP/oink-invalid.log"

scss:
name: Built-in Sass (Hugo ${{ matrix.hugo }})
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
hugo: ['0.166.0', '0.168.0']
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: '3.x'
- uses: peaceiris/actions-hugo@v3
with:
hugo-version: ${{ matrix.hugo }}
extended: true
- name: Build without an external Sass executable
run: |
if [ '${{ matrix.hugo }}' = '0.168.0' ]; then
python3 bin/check-scss.py --allow-libsass-warning
else
python3 bin/check-scss.py
fi
29 changes: 14 additions & 15 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ accepted decisions, dated research, and active proposals.

## Current baseline

The current release is `v1.3.1`, dated 2026-10-18 in `CHANGELOG.md`. The sibling
site's `v1.3.1` Design contracts describe this release. Refresh Git state,
The current release is `v1.3.2`, dated 2026-10-18 in `CHANGELOG.md`. The sibling
site's `v1.3.2` Design contracts describe this release. Refresh Git state,
public tags, and consumer pins before making claims about later releases or
downstream adoption.

Expand Down Expand Up @@ -94,21 +94,20 @@ make -C ../oink.pgsty.com dev

## Theme contracts

- As of 2026-10-17, the tested toolchain is Go 1.27.2 and Hugo Extended
0.168.0. CI automatically follows the latest stable Go and Hugo releases
and records the resolved versions. Hugo 0.168.0 remains the declared minimum,
not an exact-version lock. Update module/theme requirements, checkers, and
current bilingual documentation together when raising that minimum.
Do not run older-Hugo compatibility
matrices, adapt code for old versions, or add compatibility shims unless the
user explicitly requests it. Historical release/research records are not
current support requirements.
- SCSS builds use standalone Dart Sass 1.105.2 on `PATH`; CI pins the same
distribution. Preserve the project-variable import hooks and strict warnings.
- Hugo Extended 0.166.0 is the minimum and default development/strict CI
version. Keep this baseline pinned; do not automatically follow latest Hugo.
A focused Hugo 0.168.0 check accepts its known upstream LibSass deprecation
warning while rejecting other diagnostics. Ordinary 0.168.0 builds may warn.
Update requirements, checkers, and current bilingual contracts together.
- SCSS uses Hugo Extended's built-in LibSass, including main and ReDoc styles.
Ordinary consumers must not install Dart Sass or another Sass executable.
Preserve project-variable/style hooks. Future Hugo upgrades must preserve
this dependency boundary; do not add compatibility shims for unrelated versions.
- The module declares Go 1.27.0 as its minimum; the current development default
is Go 1.27.2. Record the actual local tool versions when reporting validation.
- Run checkers with `--panicOnWarning` when they build Hugo output. Ordinary
editing may warn and fall back; publishing gates turn warnings into failures.
- Run default 0.166.0 checkers with `--panicOnWarning`. The focused 0.168.0
compatibility check permits only the upstream LibSass warning; theme warnings
remain failures. Ordinary editing may warn and fall back.
- Keep generated `public/`, `resources/`, locks, and caches out of Git.
- Preserve pre-existing changes in this shared worktree and edit only the
owning implementation, checker, and public Design contract for a change.
Expand Down
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ All notable changes to OINK are documented here. The project follows

## [Unreleased]

## [1.3.2] — 2026-10-18

Restore the Hugo-only build promised to ordinary OINK consumers.

### Fixed

- Remove the mandatory Dart Sass dependency introduced in 1.3.1. Main and
ReDoc styles use Hugo Extended's built-in LibSass again; preserve project
variable/style hooks and the dark Chroma palette.
- Restore Hugo Extended 0.166.0 as the minimum and default development/strict
CI version. Hugo 0.168.0 can build with its upstream LibSass deprecation
warning; no external compiler is required and no warnings are hidden.
- Verify both compiler versions without Sass on `PATH`, including ReDoc and
consumer SCSS hooks. Keep all independent readability and FileTree fixes
from 1.3.1, including the corrected download-channel selector.

## [1.3.1] — 2026-10-18

Readability repairs and an opt-in FileTree comment layout, with a refreshed
Expand Down Expand Up @@ -2315,7 +2331,8 @@ fail the build with the new name rather than being silently ignored.
responsive shell rails, improved footer/hero/blog layouts, and accessibility
repairs.

[Unreleased]: https://github.com/pgsty/oink/compare/v1.3.1...HEAD
[Unreleased]: https://github.com/pgsty/oink/compare/v1.3.2...HEAD
[1.3.2]: https://github.com/pgsty/oink/compare/v1.3.1...v1.3.2
[1.3.1]: https://github.com/pgsty/oink/compare/v1.3.0...v1.3.1
[1.3.0]: https://github.com/pgsty/oink/compare/v1.2.0...v1.3.0
[1.2.0]: https://github.com/pgsty/oink/compare/v1.1.0...v1.2.0
Expand Down
38 changes: 20 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a href="https://oink.pgsty.com/"><img alt="Website" src="https://img.shields.io/badge/website-oink.pgsty.com-17385c?style=flat-square"></a>
<a href="https://github.com/pgsty/oink/releases/latest"><img alt="Release" src="https://img.shields.io/github/v/release/pgsty/oink?display_name=tag&amp;sort=semver&amp;style=flat-square"></a>
<a href="https://github.com/pgsty/oink/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/pgsty/oink/ci.yml?branch=main&amp;label=CI&amp;style=flat-square"></a>
<a href="https://gohugo.io/"><img alt="Hugo Extended 0.168.0 or newer" src="https://img.shields.io/badge/Hugo_Extended-%E2%89%A50.168.0-ff4088?logo=hugo&amp;logoColor=white&amp;style=flat-square"></a>
<a href="https://gohugo.io/"><img alt="Hugo Extended 0.166.0 or newer" src="https://img.shields.io/badge/Hugo_Extended-%E2%89%A50.166.0-ff4088?logo=hugo&amp;logoColor=white&amp;style=flat-square"></a>
<a href="https://github.com/pgsty/oink/blob/main/LICENSE"><img alt="Apache 2.0" src="https://img.shields.io/github/license/pgsty/oink?label=license&amp;style=flat-square"></a>
</p>

Expand Down Expand Up @@ -41,7 +41,7 @@ print and RSS for publication, semantic Markdown for reuse, and optional
## Why OINK

- **One deterministic toolchain.** Resolve the Hugo Module once, then build and
preview with Hugo and the standalone Dart Sass compiler.
preview with Hugo Extended and its built-in Sass compiler.
- **Complete publishing surfaces.** Docs, Blog, Book, Expo image albums, OpenAPI, releases,
downloads, and data-driven landing pages share one navigation and visual
system.
Expand All @@ -62,10 +62,10 @@ print and RSS for publication, semantic Markdown for reuse, and optional
JavaScript; interaction, accessibility, responsive behavior, print, and
machine-readable outputs are tested as separate contracts.

OINK 1.3.1 improves Markmap contrast, footer clearance, technical table widths,
and optional FileTree comment wrapping. It requires Hugo Extended 0.168.0 and
standalone Dart Sass 1.105.2. See the [changelog](CHANGELOG.md) for the fixes,
upgrade requirements, and contributor credits.
OINK 1.3.2 restores builds with Hugo Extended alone: Dart Sass is no longer
required. Hugo Extended 0.166.0 is the minimum and default validation version.
The Markmap, footer, table, and FileTree fixes from 1.3.1 remain included.
See the [changelog](CHANGELOG.md) for upgrade details and contributor credits.

## Start a site

Expand All @@ -82,8 +82,8 @@ repository's internal fixtures.
· [Setup guide](https://oink.pgsty.com/docs/start/)

For development and validation, use Git, Go 1.27.2, and Hugo Extended
0.168.0 or newer with [Dart Sass 1.105.2](https://github.com/sass/dart-sass/releases/tag/1.105.2)
on `PATH` (the standalone distribution, not the npm package). The site does not require Node.js. To evaluate the neutral template locally:
0.166.0 or a newer release that retains built-in LibSass. No external Sass
compiler or Node.js is required. To evaluate the neutral template locally:

```sh
git clone https://github.com/pgsty/oink-starter.git
Expand Down Expand Up @@ -129,8 +129,8 @@ HTML, RSS, Print, Markdown, LLMS, LLMSFULL, and NAVJSON outputs the site needs;
the [configuration reference](https://oink.pgsty.com/docs/customize/config/)
documents their defaults and scope.

For production, commit `go.mod` and `go.sum`, build with warnings promoted to
errors, and inspect representative routes:
For production, commit `go.mod` and `go.sum`. The default Hugo 0.166.0 release
gate promotes warnings to errors; inspect representative routes after building:

```sh
hugo --cleanDestinationDir --gc --minify --environment production \
Expand Down Expand Up @@ -212,18 +212,20 @@ assuming drop-in compatibility.

| Dependency | Policy |
| --- | --- |
| Hugo | **Extended 0.168.0 or newer**; CI follows the latest stable release |
| Dart Sass | Standalone 1.105.2 on `PATH`; no Node.js or npm dependency |
| Hugo | **Extended 0.166.0 minimum**; default development and strict CI version 0.166.0 |
| Sass | Built-in LibSass; no separately installed compiler |
| Go | 1.27.0 minimum for Hugo Module resolution; current default 1.27.2, CI follows the latest stable release; not needed when using an offline archive or submodule |
| Node.js | Not required to build or run an OINK site |
| Locales | Native OINK interface text for all 31 locale names shipped by Docsy, plus generic `zh`; every bundle owns the same 218-message schema, including CLDR plural forms, with no English placeholder blocks |

CI automatically resolves stable Go and Hugo releases and records their actual
versions. OINK 1.3.1 is validated with Go 1.27.2 and Hugo Extended 0.168.0;
these are not exact-version locks. Update declared requirements and current
documentation together when raising the minimum. Older Hugo versions receive
no compatibility testing or adaptation. Dated release and research records
retain their original tool versions.
CI follows stable Go releases and pins Hugo 0.166.0 for strict checks. A separate
Hugo 0.168.0 check verifies builds without an external Sass executable and
accepts only Hugo's known LibSass deprecation warning. Ordinary builds and
previews on 0.168.0 remain supported; `--panicOnWarning` makes that upstream
warning fatal, so use 0.166.0 for the strict gate. No warnings are hidden by the
theme. Future Hugo releases that remove LibSass require a separate compatibility
decision; upgrading must not add a mandatory Sass installation for consumers.
Dated release and research records retain their original tool versions.

## Community and releases

Expand Down
4 changes: 1 addition & 3 deletions assets/scss/td/_chroma.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@use "sass:meta";

// Class-based syntax highlighting (Chroma).
//
// Requires `markup.highlight.noClasses: false`, which the theme sets in its
Expand Down Expand Up @@ -146,7 +144,7 @@

@if $enable-dark-mode {
[data-bs-theme='dark'] {
@include meta.load-css('chroma/dark');
@import 'chroma/dark';

.chroma {
--td-code-hl-bg: color-mix(
Expand Down
105 changes: 105 additions & 0 deletions bin/check-scss.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#!/usr/bin/env python3
"""Build real theme styles and consumer hooks without an external Sass tool."""

from __future__ import annotations

import argparse
import os
from pathlib import Path
import re
import shutil
import tempfile

from test_site import ROOT, run_hugo_process


LIBSASS_WARNING = (
"WARN deprecated: css.Sass: libsass was deprecated in Hugo v0.153.0 "
"and will be removed in a future release. Use dartsass instead. "
"See https://gohugo.io/functions/css/sass/#dart-sass"
)


def main() -> None:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--hugo", default="hugo")
parser.add_argument("--allow-libsass-warning", action="store_true",
help="accept only Hugo 0.168's known LibSass warning")
args = parser.parse_args()
hugo = shutil.which(args.hugo)
if not hugo:
raise SystemExit(f"Hugo executable not found: {args.hugo}")

with tempfile.TemporaryDirectory(prefix="oink-scss-") as directory:
site = Path(directory)
tools = site / "tools"
tools.mkdir()
# A fresh PATH and fresh resources prevent an installed Sass compiler
# or a previously compiled asset from making this regression pass.
env = os.environ.copy()
env.update(PATH=str(tools), GOWORK="off", HUGO_MODULE_WORKSPACE="off",
HUGO_RESOURCEDIR=str(site / "resources"))
env.pop("HUGO_MODULE_REPLACEMENTS", None)
assert shutil.which("sass", path=env["PATH"]) is None
files = {
"hugo.yaml": """baseURL: https://example.org/
title: Sass regression
theme: oink
disableKinds: [taxonomy, term, RSS, sitemap]
markup:
highlight:
noClasses: false
""",
"content/_index.md": "---\ntitle: Sass regression\n---\n",
"content/docs/_index.md": "---\ntitle: Docs\n---\n",
"content/docs/api.md": (
'---\ntitle: API\n---\n\n{{< redoc "/spec.yaml" >}}\n'
'\n```go\nfunc main() {}\n```\n'
),
"static/spec.yaml": "openapi: 3.0.0\ninfo: {title: Probe, version: '1'}\npaths: {}\n",
"assets/scss/_variables_project.scss": "$primary: #13579b;\n",
"assets/scss/_variables_project_after_bs.scss": "$oink_probe_width: 42px;\n",
"assets/scss/_styles_project.scss": (
".oink-scss-hook-probe { width: $oink_probe_width; color: $primary; }\n"
),
}
for name, content in files.items():
path = site / name
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(content)
command = [hugo, "--source", str(site), "--themesDir", str(ROOT.parent),
"--destination", str(site / "public"), "--cacheDir", str(site / "cache"),
"--ignoreCache", "--noBuildLock", "--logLevel", "warn",
"--environment", "development"]
if not args.allow_libsass_warning:
command.append("--panicOnWarning")
result = run_hugo_process(command, env=env, text=True, capture_output=True)
output = result.stdout + result.stderr
if result.returncode:
raise SystemExit(output)
diagnostics = [line for line in output.splitlines() if re.match(r"^(WARN|ERROR)\b", line)]
unexpected = [line for line in diagnostics
if not (args.allow_libsass_warning and line == LIBSASS_WARNING)]
if unexpected:
raise SystemExit("Unexpected build diagnostics:\n" + "\n".join(unexpected))
if args.allow_libsass_warning and LIBSASS_WARNING not in diagnostics:
raise SystemExit("Expected the Hugo 0.168 LibSass warning to remain visible")
public = site / "public"
page = (public / "docs/api/index.html").read_text()
styles = {path.name: path.read_text() for path in (public / "scss").glob("*.css")}
main_css = next((css for name, css in styles.items() if name.startswith("main.")), "")
redoc_css = next((css for name, css in styles.items() if name.startswith("redoc.")), "")
assert re.search(r"\.oink-scss-hook-probe\s*\{\s*width: 42px;\s*color: #13579b;", main_css), \
"consumer variable/style hooks were not compiled"
assert "--bs-primary: #13579b" in main_css, "Bootstrap ignored the consumer primary color"
assert re.search(r"\[data-bs-theme=['\"]?dark['\"]?\] \.chroma", main_css), \
"dark Chroma palette is missing"
assert ".td-redoc" in redoc_css and re.search(r'href="[^"]*redoc[^\"]*\.css"', page), \
"ReDoc stylesheet was not compiled and linked"
for diagnostic in diagnostics:
print(diagnostic)
print("SCSS checks passed: built-in compiler, main/ReDoc CSS, dark Chroma, and consumer hooks; no Sass on PATH")


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ mediaTypes:
module:
hugoVersion:
extended: true
min: 0.168.0
min: 0.166.0
mounts:
- source: assets
target: assets
Expand Down
11 changes: 4 additions & 7 deletions layouts/_partials/head-css.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{{ $scssMain := "scss/main.scss" -}}
{{/* Bootstrap 5.3 and the public project-variable hooks still share Sass's
legacy import scope. Silence only their known language deprecations;
Sass @warn, invalid selectors, and Hugo diagnostics remain visible. */ -}}
{{ $scss := resources.Get $scssMain | toCSS (dict
"transpiler" "dartsass"
"silenceDeprecations" (slice "import" "global-builtin" "color-functions" "if-function")
"enableSourceMap" (not hugo.IsProduction)) -}}
{{/* Use Hugo Extended's built-in compiler; consumers need no external Sass
executable. Hugo 0.168 may report its upstream LibSass deprecation. */ -}}
{{ $scss := resources.Get $scssMain
| toCSS (dict "enableSourceMap" (not hugo.IsProduction)) -}}
{{/* Concatenate Font Awesome's official compiled CSS into one stable vendor
resource. Keep it separate from consumer SCSS so an ordinary theme or site
style edit does not invalidate the icon distribution. The target remains
Expand Down
Loading
Loading