Fixes from Running a Starlight Blog: A Hand-Kept List, Empty Share Cards, and a Font That Never Loaded
This blog runs on Astro 6.1 and Starlight 0.38. It uses the starlight-blog 0.26, starlight-sidebar-topics 0.7, and starlight-image-zoom 0.14 plugins, and GitHub Actions builds it and deploys it to GitHub Pages. On top of that sit a few custom component overrides and a post-build step that edits the generated HTML.
This post covers problems fixed in two recent commits. None of it is a new feature. Most of it is existing configuration that behaved differently from what it was meant to do. For each problem I describe the symptom, the code that caused it, the fix, and the values I checked.
A hand-kept list that caused a localization bug
Section titled “A hand-kept list that caused a localization bug”Structure
Section titled “Structure”The site has a Korean root locale and an English locale under /en/. Technical articles are written as KO/EN pairs, but the Blog, which holds food and everyday posts, is written only in Korean. The catch is that Starlight generates a fallback page for every locale even when no translation exists. Adding a Korean post at /blog/<slug>/ also creates /en/blog/<slug>/ with the same body.
Left alone, that fallback causes three mismatches.
- The Korean original carries an
hreflang="en"alternate in its head, telling search engines that an English translation exists. - The language picker shows an English option that leads to the same Korean body.
- Cards on the
/en/blog/listing link to the fallback pages.
At the time, the astro:build:done hook in astro.config.mjs picked out Korean-only posts, removed their alternate links and English options, and rewrote card links on the English listing to point to the Korean originals. In 8d023ab, I moved alternate filtering into route middleware and exclusion of the native English option into a LanguageSelect.astro override. The hook now only rewrites English Blog listing card links to the Korean originals. The code below shows the earlier post-processing.
How Korean-only posts are picked
Section titled “How Korean-only posts are picked”The earlier post-processing step picked out Korean-only posts with this condition.
const untranslatedBlogPaths = generatedHtml.filter((relativePath) => relativePath.startsWith('blog/') && !shouldNoindex(relativePath) && generatedPaths.has(`en/${relativePath}`) && shouldNoindex(`en/${relativePath}`));A post counts as Korean-only when its English page is a noindex target. That noindex decision came from noindexPaths in src/utils/index-policy.mjs, which listed each English fallback path one line per post.
const noindexPaths = [ // ... 'en/blog/datadog-live-seoul-2026/index.html', 'en/blog/geudaeege-dongtan/index.html', 'en/blog/google-cloud-onboard-2026/index.html', // 11 lines like these];Symptom
Section titled “Symptom”A new travel post went up on October 27, and its path was never added to this list. Its English fallback therefore dropped out of the noindex targets, and the post-processing step no longer treated the post as Korean-only. The result was exactly the three mismatches above. The first card on /en/blog/ linked to /en/blog/daegwallyeong-yeongwol-autumn-plan/, the Korean original kept its English hreflang, and the language picker still offered English.
The build did not fail at the time. The post-processing step only checked posts it had selected, so a post missing from the list passed through without an error. The repository’s tests/test_blog_locale_visibility.py opens the build output and checks English listing links, hreflang, language picker options, and the sitemap. Finding this kind of omission requires checking the output, not just whether the build succeeded.
I deleted the per-post list and replaced it with one rule. The Blog is Korean only, so every English Blog post path is noindex without exception.
function shouldNoindex(relativePath) { return noindexPaths.includes(relativePath) // The Blog is Korean only. Starlight still generates an /en/ fallback for // every post; keep the Korean originals indexable and never the copies. || /^en\/blog\/[^/]+\/index\.html$/.test(relativePath) // ...}Adding a Blog post no longer requires touching this file. These are the values checked on the live site after deployment.
- All 11 card links on
/en/blog/, 10 on page 1 and 1 on page 2, start with/blog/. - The Korean original of the travel post has 0 hreflang alternate links, and no language picker option has a
/en/blog/...value. - The English fallback carries
<meta name="robots" content="noindex,follow">and is absent fromsitemap-0.xml.

The same kind of problem also appeared in a test. At the time, test_korean_only_blog_does_not_advertise_translations asserted that there were exactly 10 Blog posts, so adding an eleventh made it fail with 11 != 10. The fixed value is now 11, but it still needs another edit when content grows. Any value that someone has to update whenever content grows will eventually be missed. Instead of writing lists or counts by hand, derive them from a path rule or from the content directory.
Empty share cards
Section titled “Empty share cards”Symptom and cause
Section titled “Symptom and cause”Pasting a post link into a messenger or social site produced a preview card with no image. The head showed two causes.
Starlight’s default head (@astrojs/starlight/utils/head.ts) gives every page og:type set to article and twitter:card set to summary_large_image. It declares a large image card but adds no og:image, because Starlight has no site-wide image setting for it.
On top of that, the head setting in astro.config.mjs had an entry fixing og:type to website. Starlight merges the head from the defaults, then the config head, then the page frontmatter head. A later meta with the same property replaces the earlier one, so every page, articles included, ended up as website.
I removed the fixed og:type entry from the config and moved the per-page decision into the src/components/Head.astro override. The override wraps Starlight’s default Head. Emitting another tag would produce two og:type values, so it edits Astro.locals.starlightRoute.head, the array the default Head renders, in place.
const shareImage = imageUrl ?? new URL('/og-default.png', site).href;const routeHead = Astro.locals.starlightRoute.head;function setMeta(key: 'property' | 'name', value: string, content: string) { const existing = routeHead.find((entry) => entry.tag === 'meta' && entry.attrs?.[key] === value); if (existing) existing.attrs = { ...existing.attrs, content }; else routeHead.push({ tag: 'meta', attrs: { [key]: value, content } });}setMeta('property', 'og:type', isArticlePage ? 'article' : 'website');setMeta('property', 'og:image', shareImage);setMeta('name', 'twitter:image', shareImage);if (!imageUrl) { setMeta('property', 'og:image:width', '1200'); setMeta('property', 'og:image:height', '630');}isArticlePage is true for pages under /blog/ or /blogs/ that are not the listings themselves. imageUrl takes whichever of the frontmatter fields image, cover, or heroImage is set. When none is set, the page uses public/og-default.png, a 1200x630 image composed from the site mascot with sharp.

After deployment, the head of a technical article showed og:type article, and both og:image and twitter:image were https://noisonnoiton.github.io/og-default.png. The home page showed og:type website. When a given messenger shows the new card depends on that service’s cache policy, and I did not check each service separately.
A font that was declared but never loaded
Section titled “A font that was declared but never loaded”Symptom and cause
Section titled “Symptom and cause”The site’s --sl-font listed 'Pretendard' first. But nothing loaded the font files: no @font-face rule and no external stylesheet. The font looked as intended only on devices that had Pretendard installed. Everywhere else, text fell through to the next entry in the list, the system font.
I added the dynamic subset build of Pretendard Variable to the repository (src/styles/fonts/pretendard/). It is 92 woff2 files totalling about 2.96 MB, licensed under the SIL Open Font License 1.1, with the LICENSE file kept alongside. Its CSS goes first in Starlight’s customCss, and 'Pretendard Variable' became the first value of --sl-font.
customCss: ['./src/styles/fonts/pretendard/pretendard-variable.css', './src/styles/choonsik.css'],--sl-font: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;Each of the 92 @font-face blocks has a unicode-range, so the browser downloads only the subsets containing characters the page actually uses. Every block uses font-display: swap, so text renders in the system font while the font downloads. Vite processes the relative paths inside the CSS, and the build output references hashed paths of the form /_astro/PretendardVariable.subset.N.<hash>.woff2. The URL stays the same as long as the file content does, so browsers can keep using their cached copy.
This adds downloads that did not exist before. To see how much, I disabled the cache in headless Chromium, scrolled each page to the end, and summed transferSize from Resource Timing.
| Page | woff2 requests | Font transfer |
|---|---|---|
| Home | 14 | about 365 KB |
| Korean technical article (KServe HTTPRoute) | 16 | about 423 KB |
| Korean Blog post (travel) | 22 | about 606 KB |
| English technical article (same KServe post) | 7 | about 199 KB |
These are single measurements and will vary with device, browser, and content. The more varied the Hangul syllables on a page, the more subsets it pulls, so the everyday post needed more than the technical one. Later pages reuse overlapping subsets from the cache. I accepted this transfer in exchange for the same typeface on every device.
Smaller fixes
Section titled “Smaller fixes”Last updated date
Section titled “Last updated date”Turning on Starlight’s lastUpdated: true shows each page’s last modified date at the bottom. The date comes from the last git commit that touched the file. The deploy workflow’s checkout uses fetch-depth: 0 to fetch full history, so each file gets its own date. With a shallow clone, every file would have shown the date of the same single commit.

There is a caveat. Commits such as typo cleanups or bulk replacements also update the date, so an article whose content did not change can look recently edited.
Reserving ad slot height
Section titled “Reserving ad slot height”When the ad script filled a slot late, the body and footer were pushed down, causing layout shift (CLS). The top PC slot now reserves 728x90, and the bottom slot reserves a min-height of 90px on PC and 250px on mobile. The cost is a blank space of that height when no ad fills the slot.
Sidebar Tech link
Section titled “Sidebar Tech link”The Tech link at the top of the sidebar went to the Kubernetes category overview. It now points to the same topic hub as Tech Topics in the header (/topics/, or /en/topics/ in English).
Structural changes since then and work still left
Section titled “Structural changes since then and work still left”When I first wrote this post, I left manual sidebar registration and build post-processing for later work. In 06e8fbe, I switched some sidebar groups to automatic generation. In 8d023ab, I moved the post-processing into rendering and sitemap configuration, except for listing link rewrites.
At the time, astro.config.mjs was 754 lines long, with 143 entries registered by hand using slug. The sidebar <nav> measured about 58 KB in that build: 27.7% of the KServe article (about 209 KB) and 23.1% of the agent collaboration article (about 251 KB). These are measurements from before the changes. Eight groups now use autogenerate, including GitOps, ModelOps, and Agentic Coding. Hand-maintained groups remain, so the risk of missing a registration has not disappeared. Automatic generation also does not by itself reduce the sidebar HTML embedded in every article.
The earlier build:done step handled noindex insertion, hreflang cleanup, English listing link rewrites, ad removal, sitemap filtering, and Pagefind re-indexing in one place. Now Head.astro renders the robots meta, and route middleware filters hreflang and the AdSense loader. LanguageSelect.astro leaves out the English option on Korean-only originals, and Footer.astro does not render the AdFit block or loader on routes excluded from ads. Instead of editing every source frontmatter, the route middleware sets pagefind: false in page data for shouldNoindex targets. The sitemap uses @astrojs/sitemap’s filter and serialize to select routes and supply source-commit dates. I removed the separate Pagefind re-indexing pass.
The remaining regex post-processing rewrites English Blog listing card links to the Korean originals. This is the only task left in build:done. It stops the build if it rewrites no links on a listing page, but it still depends on the plugin’s output markup.
The Head override also had an issue that stayed open for a while. Head.astro put a custom canonical, og:locale, og:url, and BreadcrumbList and BlogPosting JSON-LD inside Default. However, Starlight’s default Head only renders the starlightRoute.head array and does not render a slot, so these child tags never reached the generated HTML. The canonical and og:url tags were already coming from the array’s defaults, so the override now drops the children and pushes the two JSON-LD blocks and og:locale into the array directly, the same way the share-image fix does.
The diagram below shows the post-processing before 8d023ab. It records the earlier structure, which edited HTML and the sitemap after generation and then re-indexed Pagefind, not the current build order.
The lesson most likely to last came from the first problem. A list that someone must update whenever content grows will eventually miss an entry, and the miss shows up not as a build failure but as quietly wrong output. When you find such a list, replace it with a rule, and check that the rule holds with tests that open the build output.