Commit c5bae0a
committed
Pin emails to one line, hide single-entry TOCs
Two small quality-of-life fixes noticed during a mobile review.
## Email addresses never wrap
Auto-linked `<a href="mailto:...">` elements now carry
`white-space: nowrap` via a global CSS rule. `sw@wintermeyer-consulting.de`
is short enough that it fits on any viewport, so this just prevents the
browser from breaking an address between the `@` and the domain (or
worse, mid-TLD) when a paragraph happens to wrap at that point. Applies
site-wide (header, body, footer, Kontakt button) since every email
occurrence already ships as an `a[href^="mailto:"]` in the output.
## TOC with a single entry is removed
Antora's default client-side TOC (`aside.toc`) removes itself when the
page has no matching headings. It happily renders a one-item list
though — just the one section title, which looks like dead weight on
pages like `recipes/index` that only have `h1 + h2`. Tightened the
check in `site.js` from `if (!s.length)` to `if (s.length < 2)`, so
the aside (and the embedded mobile copy) is dropped unless the page
has at least two anchors worth linking to.
Verified in a 390px-wide iframe harness: `recipes/index.html` now has
no TOC, `ash/index.html` (two `h2`s) keeps its TOC, and every mailto
link reports `whiteSpace: nowrap` with no increased page scrollWidth.1 parent 0bf970b commit c5bae0a
2 files changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
275 | 282 | | |
276 | 283 | | |
277 | 284 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments