From 9949b47c83c7fffd6811c6fd617e3b4ab3fab1a0 Mon Sep 17 00:00:00 2001 From: Takashi Fujita Date: Fri, 3 Apr 2026 17:23:23 +0900 Subject: [PATCH 1/2] fix(blog): use getSiteSettings() instead of hardcoded site title Replace hardcoded "My Blog" title and tagline across blog and blog-cloudflare templates with dynamic values from getSiteSettings(), so that changes made in the admin Settings panel are reflected on the site. --- blog-cloudflare/src/layouts/Base.astro | 8 +++++--- blog-cloudflare/src/pages/index.astro | 8 ++++++-- blog-cloudflare/src/pages/posts/[slug].astro | 6 +++++- blog-cloudflare/src/pages/rss.xml.ts | 8 ++++---- blog/src/layouts/Base.astro | 8 +++++--- blog/src/pages/index.astro | 8 ++++++-- blog/src/pages/posts/[slug].astro | 6 +++++- blog/src/pages/rss.xml.ts | 8 ++++---- 8 files changed, 40 insertions(+), 20 deletions(-) diff --git a/blog-cloudflare/src/layouts/Base.astro b/blog-cloudflare/src/layouts/Base.astro index b9bdde6..26cb246 100644 --- a/blog-cloudflare/src/layouts/Base.astro +++ b/blog-cloudflare/src/layouts/Base.astro @@ -1,5 +1,5 @@ --- -import { getMenu, getEmDashCollection } from "emdash"; +import { getMenu, getEmDashCollection, getSiteSettings } from "emdash"; import { WidgetArea, EmDashHead, @@ -36,7 +36,9 @@ const { author, content, } = Astro.props; -const siteTitle = "My Blog"; +const settings = await getSiteSettings(); +const siteTitle = settings.title ?? "My Blog"; +const siteTagline = settings.tagline ?? ""; // If title already includes site title (from getSeoMeta), use as-is const fullTitle = title.includes(siteTitle) ? title : `${title} — ${siteTitle}`; @@ -136,7 +138,7 @@ const isLoggedIn = !!Astro.locals.user;