Skip to content

fix: apply title templates to active articles - #5

Merged
bao-cn merged 5 commits into
mainfrom
fix/title-template
Aug 16, 2026
Merged

fix: apply title templates to active articles#5
bao-cn merged 5 commits into
mainfrom
fix/title-template

Conversation

@bao-cn

@bao-cn bao-cn commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Summary

Make configured title templates take effect while reading articles with cat and less.

Implementation

  • Apply the configured template when an article becomes active.
  • Restore the default site title when article reading ends.
  • Keep initial layout metadata consistent with the configured site title.
  • Add template rendering and fallback tests.

Behavior and compatibility

Article pages now update document.title according to the configured template. This PR depends on feat/cookie-notice because both touch terminal and site configuration code.

Risk

The main risk is leaving a stale article title after navigation; title reset behavior is included in the implementation and tests.

Verification

npx prettier --check .
npm run lint
npx tsc --noEmit --incremental false
npm test
npm run build

All checks passed, including browser interaction checks.

Checklist

  • The change is focused.
  • Tests and bilingual documentation are updated.
  • Visible title behavior was manually verified.

@bao-cn
bao-cn merged commit 87cb6a5 into main Aug 16, 2026
3 checks passed
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