Skip to content

fix: show the language note on the blog listing page - #116

Merged
sametcelikbicak merged 1 commit into
mainfrom
feat/blog-language-note
Oct 19, 2026
Merged

sametcelikbicak merged 1 commit into
mainfrom
feat/blog-language-note

Conversation

@sametcelikbicak

Copy link
Copy Markdown
Owner

Problem

enShortNote / trOnlyNote exist in both locales but were only read by RecentPosts. On the blog listing page an English visitor silently saw one post where there are 28 — getPostSummaries(i18n.language) filters by language, so 27 Turkish-only posts vanish with no explanation.

The note on the home page told them. The page they land on did not.

Fix

BlogPage renders the same note whenever the active language has fewer posts than one page:

visitor posts one page? note
Turkish 6 yes hidden
English 1 no shown

The condition is allPosts.length < postsPerPage, not a language check — so every Turkish visitor is not told their own content is "Turkish only", and the rule stays correct if a second Turkish post is ever published.

The note reuses the keys RecentPosts already reads (home.recentPosts.enShortNote / trOnlyNote), so no translation changes were needed and tr/en parity holds.

New .blog-language-note style mirrors .recent-posts-note: same margin, size and --color-text-subtle, which measures 7.25:1 on dark and 6.31:1 on light — AA for 12px text.

Verification

  • tsc -b clean
  • biome check . clean across 146 files
  • 31 suites / 198 tests pass
  • note contrast 7.25:1 dark / 6.31:1 light — AA
  • build succeeds, agent gate passes
  • CI green
  • Post-deploy: confirm the note appears at /blog under lang=en and is absent under lang=tr

`enShortNote` / `trOnlyNote` live in both locales but were only read by
`RecentPosts`. On the blog listing page an English visitor silently saw one post
where there are 28 — `getPostSummaries(i18n.language)` filters by language, so
27 Turkish-only posts vanish with no explanation.

BlogPage now renders the same note whenever the active language has fewer posts
than one page:

| visitor | posts | one page? | note |
|---|---|---|---|
| Turkish | 6 | yes | hidden |
| English | 1 | no | shown |

The Turkish note is hidden on purpose — every Turkish visitor would otherwise be
told their own content is "Turkish only". The condition is `allPosts.length <
postsPerPage`, not a language check, so it stays correct if a second Turkish
post is ever published.

The note reuses the keys `RecentPosts` already reads, so no translation changes
were needed; tr/en parity holds.

## Verification

- [x] `tsc -b` clean
- [x] `biome check .` clean across 146 files
- [x] 31 suites / 198 tests pass
- [x] note contrast: 7.25:1 dark, 6.31:1 light — AA for 12px text
- [x] build succeeds, agent gate passes
- [ ] CI green
- [ ] Post-deploy: confirm the note appears at /blog under `lang=en` and is absent under `lang=tr`
@cloudflare-workers-and-pages

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
web-site f4ef288 Commit Preview URL

Branch Preview URL
Oct 19 2026, 12:53 PM

@sametcelikbicak
sametcelikbicak merged commit ce44d9a into main Oct 19, 2026
2 checks passed
@sametcelikbicak
sametcelikbicak deleted the feat/blog-language-note branch October 19, 2026 12:54
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