Skip to content

docs(site): add configuration tab to locale - #181

Merged
ryanlewis merged 2 commits into
mainfrom
docs/configuration-locale
Sep 5, 2026
Merged

ryanlewis merged 2 commits into
mainfrom
docs/configuration-locale

Conversation

@ryanlewis

Copy link
Copy Markdown
Owner

What changed

Two commits, separable.

docs(site): add configuration tab to locale — the fix. Chirpy takes a tab page's browser title from the tabs: map in docs/_data/locales/en.yml, keyed by the lowercased page title. The map listed install and commands but not configuration, so the tab added in #178 rendered with an empty <title>. One line: configuration: Configuration.

docs(site): fall back to the page title when a tab has no locale entry — optional, drop it if you would rather not touch the override. docs/_includes/head.html:63 reads the locale map with no default: filter, which is why a missing key produced an empty title rather than an imperfect one. The theme's own equivalents both carry the fallback, so the override looks like it diverged by accident:

Where Code Fallback
docs/_includes/head.html (this repo) site.data.locales[include.lang].tabs[tab_key] none — the bug
theme _includes/sidebar.html ... tabs.[tab_name] | default: tab.title | upcase yes
theme _layouts/page.html ... tabs[tab_key] | default: page.title yes

Adding | default: page.title matches upstream and makes the next tab self-healing.

What else depends on the locale

Nothing else on the page was broken. The sidebar label and the <h1> both go through the theme, and both already fall back to the front-matter title, so they rendered "CONFIGURATION" and "Configuration" correctly all along — the empty <title> was the only symptom. jekyll-seo-tag uses page.title directly and is unaffected.

Checked every tab against the map: about, commands, configuration and install all now have a key matching their lowercased title.

How verified

Not by building the site — there is no PR-time docs check (pages.yml runs only on push to main), and a local bundle exec jekyll build is not possible here: system Ruby is 2.6.10 and jekyll-theme-chirpy ~> 7.2 needs 3.1+.

Instead: en.yml parses as YAML with the expected tabs map, every docs/_tabs/*.md front-matter title lowercases to a key present in it, and the two theme templates were read at the v7.2.4 tag to confirm where the fallbacks are and that head.html is the only place without one.

make test and make lint are clean, though neither touches the site.

Possible follow-up

A tab whose locale key is missing is now cosmetic rather than broken, so nothing further is needed. If you would rather it were caught outright, a check that every docs/_tabs/*.md title has a key in en.yml would do it — it is the same shape as the docs-sync tests from #178, though it would need a home, since nothing under docs/ is Go.

Chirpy takes the browser title for a tab page from the tabs map in
_data/locales/en.yml, keyed by the lowercased page title. The map had
no entry for the Configuration tab added in #178, so the page rendered
with an empty <title>.
This override drops the `| default:` that the theme's own sidebar and
page heading both carry, so a tab missing from the locale map renders an
empty <title> rather than an imperfect one. That is what happened to the
Configuration tab. Matching upstream makes the next one self-healing.
@ryanlewis
ryanlewis merged commit 981d818 into main Sep 5, 2026
7 checks passed
@ryanlewis
ryanlewis deleted the docs/configuration-locale branch September 5, 2026 12:16
ryanlewis added a commit that referenced this pull request Sep 5, 2026
## What changed

"A missing file is not an error" describes the config file by what does
not go wrong. "The file is optional" says what it is. Replaced
everywhere it appeared.

**User-facing text:**

- `docs/_tabs/configuration.md` — the callout under the lookup table:

> **The config file is optional.** Without one, `things` runs on its
built-in defaults. The same applies to a path you name yourself; run
`things config path` to see which file is in use and whether it exists.

- `README.md` — "The file is optional — without one, `things` runs on
its built-in defaults."

- `internal/config/config.go`, the `config init` template header:

  ```
  # Read from $XDG_CONFIG_HOME/things-cli/config.toml, or
  # ~/.config/things-cli/config.toml. Override with --config PATH or
  # $THINGS_CLI_CONFIG. The file is optional; without it, things runs on
  # its built-in defaults.
  ```

Wrapped over two lines to stay inside the 72 columns the rest of the
header uses; the suggested single line was 73.

**Doc comments**, so the code reads the same way as the docs: the
comments on `config.File` and `config.Load` now say the file is optional
rather than that its absence is not an error.

## The template and the page

The `toml` block on the configuration page has to stay byte-identical to
`Template()` — `TestDocsPageQuotesTheTemplate` enforces it — so both
changed together. The page block was regenerated by running `things
config init` and pasting the result, not hand-edited, so the two cannot
have drifted in the edit.

## Also checked

`docs/_tabs/commands.md` and `internal/skill/SKILL.md` do not carry the
phrase. Neither describes the missing-file case at all: `commands.md`
links to the configuration page for it, and SKILL.md says "the user
**may** have a TOML file", which already reads as optional. Left both
alone.

`grep -rn "not an error"` across `README.md`, `docs/`, `internal/` and
`cmd/` now returns nothing.

## How tested

`make test` (`go test -race ./...`) and `make lint` clean, including the
three docs-sync tests from #178 — the template check is what proves the
page and the binary still agree.

Not verified by building the site, for the reasons in #178 and #181: no
PR-time docs check, and no local Ruby new enough for
`jekyll-theme-chirpy ~> 7.2`. The page edits are prose inside an
existing callout and an existing fenced block, with no structural
change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant