Skip to content

fix(blog-cloudflare): read site title from getSiteSettings()#4

Open
integrate-your-mind wants to merge 1 commit intoemdash-cms:mainfrom
integrate-your-mind:fix/blog-template-hardcoded-site-title
Open

fix(blog-cloudflare): read site title from getSiteSettings()#4
integrate-your-mind wants to merge 1 commit intoemdash-cms:mainfrom
integrate-your-mind:fix/blog-template-hardcoded-site-title

Conversation

@integrate-your-mind
Copy link
Copy Markdown

Summary

The blog-cloudflare template hardcodes "My Blog" in four files instead of reading from getSiteSettings(). This means the site title and tagline entered during the setup wizard are only visible in the admin panel — the RSS feed, navigation, footer, homepage <title>, and SEO meta all show "My Blog" regardless of what the user configured.

Changes

  • src/pages/rss.xml.ts — replaced module-level siteTitle/siteDescription constants with getSiteSettings() call inside the route handler
  • src/layouts/Base.astro — replaced const siteTitle = "My Blog" with getSiteSettings(), made title prop optional (homepage defaults to bare site title), replaced hardcoded footer tagline "Thoughts, stories, and ideas." with settings.tagline (hidden when empty)
  • src/pages/index.astro — removed hardcoded title="My Blog" prop from <Base>, letting the layout use the settings-derived default
  • src/pages/posts/[slug].astro — replaced siteTitle: "My Blog" in getSeoMeta() call with getSiteSettings().title

Reproduction

  1. npm create emdash@latest → choose Blog template
  2. Run setup wizard, enter a custom site title (e.g. "Romy Mondello")
  3. Visit the live site — nav, footer, RSS <title>, and browser tab all say "My Blog"

Test plan

  • Verified on a live Cloudflare Workers deployment (mondello.dev) with EmDash 0.1.1, Astro 6.1.5, @astrojs/cloudflare 13.1.8
  • RSS feed <title> now reads the admin-configured title
  • Nav and footer show the correct site title
  • Footer tagline hides when the tagline setting is empty
  • Homepage <title> defaults to bare site title
  • getSeoMeta() on post pages uses the correct site title for OG tags
  • No remaining instances of "My Blog" in src/

…of hardcoding

The blog-cloudflare template hardcodes 'My Blog' in four places:

  - src/pages/rss.xml.ts (line 4): const siteTitle = 'My Blog'
  - src/layouts/Base.astro (line 39): const siteTitle = 'My Blog'
  - src/pages/index.astro (line 61): <Base title='My Blog'>
  - src/pages/posts/[slug].astro (line 58): siteTitle: 'My Blog'

This means the setup wizard's site title and tagline are only visible
in the admin — the RSS feed, nav, footer, homepage, and SEO meta all
keep showing 'My Blog' regardless of what the user configured.

Fix: replace all four with getSiteSettings() calls. The site title
and tagline now come from the EmDash settings table, editable via
the admin Settings page.

Additionally:
  - Footer tagline was hardcoded to 'Thoughts, stories, and ideas.'
    Now reads settings.tagline and hides when empty.
  - Base layout title prop is now optional — homepage defaults to
    the bare site title instead of requiring an explicit prop.
  - rss.xml.ts no longer imports siteTitle/siteDescription as
    module-level constants.

Tested on a live Cloudflare Workers deployment (mondello.dev) with
EmDash 0.1.1, Astro 6.1.5, @astrojs/cloudflare 13.1.8.
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