fix(blog-cloudflare): read site title from getSiteSettings()#4
Open
integrate-your-mind wants to merge 1 commit intoemdash-cms:mainfrom
Open
Conversation
…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.
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.
Summary
The
blog-cloudflaretemplate hardcodes"My Blog"in four files instead of reading fromgetSiteSettings(). 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-levelsiteTitle/siteDescriptionconstants withgetSiteSettings()call inside the route handlersrc/layouts/Base.astro— replacedconst siteTitle = "My Blog"withgetSiteSettings(), madetitleprop optional (homepage defaults to bare site title), replaced hardcoded footer tagline"Thoughts, stories, and ideas."withsettings.tagline(hidden when empty)src/pages/index.astro— removed hardcodedtitle="My Blog"prop from<Base>, letting the layout use the settings-derived defaultsrc/pages/posts/[slug].astro— replacedsiteTitle: "My Blog"ingetSeoMeta()call withgetSiteSettings().titleReproduction
npm create emdash@latest→ choose Blog template<title>, and browser tab all say "My Blog"Test plan
@astrojs/cloudflare13.1.8<title>now reads the admin-configured title<title>defaults to bare site titlegetSeoMeta()on post pages uses the correct site title for OG tagssrc/