|
| 1 | +--- |
| 2 | +title: Oink 0.7.1 — Nothing leaves the page, and bad input stops breaking builds |
| 3 | +linkTitle: Oink v0.7.1 |
| 4 | +date: 2026-08-26T00:00:00+08:00 |
| 5 | +lastmod: 2026-08-26T00:00:00+08:00 |
| 6 | +draft: false |
| 7 | +description: >- |
| 8 | + Oink 0.7.1 is a security and validation patch. Swagger UI stops sending your |
| 9 | + spec URL to a third party, misconfigured values warn instead of killing an |
| 10 | + ordinary build, and the OpenAPI and terminal components finally behave in |
| 11 | + print, Markdown and RSS the way every other component already did. |
| 12 | +authors: [oink] |
| 13 | +categories: [release] |
| 14 | +tags: [Oink, Release] |
| 15 | +series: [oink-releases] |
| 16 | +series_weight: 8 |
| 17 | +release_url: https://github.com/pgsty/oink/releases/tag/v0.7.1 |
| 18 | +--- |
| 19 | + |
| 20 | +Oink 0.7.1 changes no component API and needs no content edits. It closes the |
| 21 | +code findings from an external review of the 0.7.0 line: one real privacy leak, |
| 22 | +a class of configuration values that could stop a build outright, and three |
| 23 | +components that had never been taught what a non-HTML output is. |
| 24 | + |
| 25 | +{{< release-card >}} |
| 26 | + |
| 27 | +## At a glance {#at-a-glance} |
| 28 | + |
| 29 | +- Swagger UI no longer contacts the online validator. A published API page made |
| 30 | + a third-party request on every view; it no longer makes any. |
| 31 | +- A URL written into site configuration now passes the same safety check as one |
| 32 | + written by an author. |
| 33 | +- A mistyped number or boolean in `params` warns and falls back instead of |
| 34 | + ending an ordinary `hugo server` session. |
| 35 | +- `swagger`, `redoc` and `asciinema` emit a plain link in print, Markdown and |
| 36 | + RSS, and load their runtime only in interactive HTML. |
| 37 | + |
| 38 | +## Swagger stopped phoning home {#swagger-validator} |
| 39 | + |
| 40 | +Swagger UI ships with an online validator enabled by default, pointed at |
| 41 | +`validator.swagger.io`. It skips that request for `localhost`, which is why no |
| 42 | +local preview and no browser test ever showed it — and why every *deployed* |
| 43 | +API page was quietly handing your spec URL to a third party. On an intranet |
| 44 | +that URL is an internal hostname. |
| 45 | + |
| 46 | +The initializer now pins `validatorUrl: null`, and it moved out of an inline |
| 47 | +`<script>` into a cacheable `js/chunks/swagger-init.js`. A normal build still |
| 48 | +downloads nothing, and now a normal *view* uploads nothing. |
| 49 | + |
| 50 | +## Configured URLs go through the same gate as authored ones {#url-policy} |
| 51 | + |
| 52 | +Two settings reached an `href` unchecked: the custom links in |
| 53 | +`params.ui.page_context_menu.links` and the archived-site banner's |
| 54 | +`params.url_latest_version`. A `javascript:` URL in either one rendered as a |
| 55 | +working, clickable script. |
| 56 | + |
| 57 | +Both now run through the theme's shared URL policy: an unsupported scheme |
| 58 | +warns and the link is dropped rather than repaired. The archived-version |
| 59 | +banner additionally escapes its URL where it is written into the page, because |
| 60 | +clearing the scheme is not the same as being safe inside an HTML attribute. |
| 61 | + |
| 62 | +Custom links also skip entries with a missing or non-text name, and the |
| 63 | +separator above them only appears when a link actually survives. |
| 64 | + |
| 65 | +## Bad configuration warns; it no longer kills the preview {#validation} |
| 66 | + |
| 67 | +The theme's rule has always been that invalid author or config input warns, |
| 68 | +falls back to a documented default, and keeps `hugo server` usable — with |
| 69 | +`--panicOnWarning` turning that warning into a failure where you publish. |
| 70 | +A group of numeric and boolean keys had never been wired into it. |
| 71 | + |
| 72 | +Before 0.7.1, a value like `blog_index_size: nope` ended the build with a Go |
| 73 | +template error. Others were worse for being quiet: `sidebar_width_min: -50` |
| 74 | +emitted a negative pixel width without a word, and `blog_index_columns: 2.5` |
| 75 | +fed a fraction into a CSS grid. |
| 76 | + |
| 77 | +Every numeric and boolean key now resolves through the shared validator: |
| 78 | + |
| 79 | +| Input | Before | Now | |
| 80 | +| --- | --- | --- | |
| 81 | +| `blog_index_size: nope` | build fails | warns, uses `12` | |
| 82 | +| `blog_index_size: 0` | silently becomes `12` | warns, uses `12` | |
| 83 | +| `sidebar_width_min: -50` | emits `-50px` | warns, uses `220` | |
| 84 | +| `sidebar_width_min: 300` with `max: 200` | inverted layout | warns, uses `220`/`480` | |
| 85 | +| `blog_index_columns: 2.5` | fraction into CSS | warns, uses `3` | |
| 86 | +| `sidebar_item_overflow: clip` | silently `ellipsis` | warns, uses `ellipsis` | |
| 87 | +| `print.toc: nope` | silently `true` | warns, uses `true` | |
| 88 | + |
| 89 | +The same treatment reaches the Landing sections: the hero's `media.ratio` and |
| 90 | +`media.max_width`, the capabilities board's `columns` and `rules`, and a |
| 91 | +marquee's `rows`. The hero's two style inputs were the notable ones — they were |
| 92 | +written straight into a `style` attribute, so a page's own front matter could |
| 93 | +put arbitrary CSS on the page. `ratio` now takes exactly two track sizes |
| 94 | +(`'1fr 240px'`), `max_width` a plain CSS length. |
| 95 | + |
| 96 | +If you have been running with a value the theme silently corrected, you will |
| 97 | +see a new warning. That is the point — build once with `--panicOnWarning` after |
| 98 | +upgrading to find them. |
| 99 | + |
| 100 | +## OpenAPI and terminal recordings respect the other outputs {#outputs} |
| 101 | + |
| 102 | +Every Oink component renders once and then adapts to the output it lands in: |
| 103 | +interactive HTML, static print, plain Markdown for agents, and RSS. Sixteen |
| 104 | +components already did this. `swagger`, `redoc` and `asciinema` did not — they |
| 105 | +rendered their interactive markup into all four. |
| 106 | + |
| 107 | +The result was a Markdown output carrying `<div class="td-asciinema">` and a |
| 108 | +JSON config block, a printed page holding an empty container where a player |
| 109 | +should be, and a single-page print that actually downloaded the player runtime |
| 110 | +to show one frozen frame. |
| 111 | + |
| 112 | +All three now read the output format: |
| 113 | + |
| 114 | +| Output | What you get | |
| 115 | +| --- | --- | |
| 116 | +| HTML | the full interactive component | |
| 117 | +| Print | a labelled static link showing the URL | |
| 118 | +| Markdown / LLMS | a plain Markdown link, nothing else | |
| 119 | +| RSS | the same plain link | |
| 120 | + |
| 121 | +Only interactive HTML registers the runtime, so print and machine outputs load |
| 122 | +no player, no Swagger bundle and no ReDoc bundle. A cast or spec URL now also |
| 123 | +goes through the shared URL policy, and a mistyped `speed`, `cols`, `rows` or |
| 124 | +marker time warns and is ignored instead of ending the build. |
| 125 | + |
| 126 | +## Smaller repairs {#smaller-repairs} |
| 127 | + |
| 128 | +- The capabilities board's rule bars render at their authored widths. The |
| 129 | + template had always emitted them; the stylesheet never read them. |
| 130 | +- The generated configuration schemas match what Hugo actually parses. Trailing |
| 131 | + comments in `hugo.yaml` were leaking into eleven default values — `print.toc` |
| 132 | + shipped as the *string* `"true # section print views…"` — and four comment |
| 133 | + blocks documented the wrong key. Keys that exist only to warn about a rename |
| 134 | + no longer appear in editor completion. |
| 135 | +- A `hero` whose `media` is not a map warns and drops the media instead of |
| 136 | + ending the build. |
| 137 | + |
| 138 | +## Upgrading {#upgrading} |
| 139 | + |
| 140 | +```bash |
| 141 | +hugo mod get github.com/pgsty/oink@v0.7.1 |
| 142 | +hugo mod tidy |
| 143 | +``` |
| 144 | + |
| 145 | +No content, configuration or template changes are required. One thing to do |
| 146 | +after upgrading: run a build with `--panicOnWarning` once. Configuration that |
| 147 | +used to be corrected silently now says so, and that build is where you will |
| 148 | +see it. |
| 149 | + |
| 150 | +The complete list is in [CHANGELOG.md](https://github.com/pgsty/oink/blob/main/CHANGELOG.md). |
0 commit comments