Repository navigation
Put each Kiln post's Chinese and English on one page with a language switch - #21
Merged
Merged
Conversation
…switch Each post now holds both languages behind a 中文 / English switch, Chinese by default. The switch is two radio inputs and CSS, so it works without JavaScript; a small script opens English from a #en link and keeps the hash in step. The separate -en posts are removed and their addresses redirect to the merged page's #en. Reading time counted both languages. reading.ts and post-audit.mjs now skip a section marked data-alt-lang, so a bilingual note shows the time for one language. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NzupDBSP7FkrPA5FsJbeYs
Deploying fun-fun-zone with
|
| Latest commit: |
1f34a20
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://81de02fe.fun-fun-zone.pages.dev |
| Branch Preview URL: | https://claude-sleepy-gauss-284pwd.fun-fun-zone.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Follow-up to #20. Each Kiln post now holds both languages on one page behind a 中文 / English switch, Chinese by default:
kiln-automation-flowandkiln-orca-connectorcontain a<section lang="zh-CN">and a<section lang="en" data-alt-lang>. The switch is two radio inputs and CSS, so it works without JavaScript; a small inline script opens English from a#enlink and keeps the hash in step with the switch.-enposts are removed.public/_redirectssends their old addresses to/posts/<slug>/#en.src/utils/reading.tsandpost-audit.mjsskip a section markeddata-alt-lang, so the reading time counts one language (10 and 8 min) instead of both.The page header (title, description, tags) comes from the layout and stays Chinese; the English section opens with its own title.
How to test
npm run buildnpx astro preview --port 4329/posts/kiln-automation-flow/: Chinese shows; click English; open/posts/kiln-orca-connector/#en: English shows.node .claude/skills/post-review/scripts/post-audit.mjs --only kiln-automation-flow(andkiln-orca-connector)Checklist
npm run buildpasses#enchecked at 375px in a browser, including keyboard arrows)--foreground,--background,--mutedand--accentpost-audit.mjsandmeasure.mjsclean for both posts. The full audit's one defect is the existingrobotics-six-month-roadmap(base64 images), untouched hereGenerated by Claude Code