diff --git a/app.js b/app.js index 508f6c2..1c9bad1 100644 --- a/app.js +++ b/app.js @@ -215,10 +215,14 @@ app.get('/blog/:slug', (req, res) => { const blogPosts = getAllBlogPosts(); const { contentHtml, lead } = loadMarkdownWithLead(markdownFile); + // Fallback to a generic description if lead is not available + const description = lead || `${originalTitle} - Read the full post on ${process.env.OWNER_NAME}'s blog.`; + res.render('blog-post', { title: originalTitle, content: contentHtml, - lead: lead, + lead, + description, // Pass the description to the view blogPosts }); } else { @@ -226,6 +230,7 @@ app.get('/blog/:slug', (req, res) => { } }); + // Sitemap Route app.get('/sitemap.xml', (req, res) => { const hostname = req.headers.host || 'http://localhost'; diff --git a/views/about.ejs b/views/about.ejs index 949d0f4..4016a32 100644 --- a/views/about.ejs +++ b/views/about.ejs @@ -5,6 +5,7 @@ + <%= title %> | <%= process.env.OWNER_NAME %>'s' Blog diff --git a/views/blog-post.ejs b/views/blog-post.ejs index 20f5f68..39166d9 100644 --- a/views/blog-post.ejs +++ b/views/blog-post.ejs @@ -3,6 +3,7 @@ + <%= title %> | <%= process.env.OWNER_NAME %>'s Blog diff --git a/views/contact.ejs b/views/contact.ejs index 4c5dbca..2104b8a 100644 --- a/views/contact.ejs +++ b/views/contact.ejs @@ -5,6 +5,8 @@ + + Contact Me - <%= process.env.OWNER_NAME %> diff --git a/views/index.ejs b/views/index.ejs index 22af010..eee22b4 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -3,6 +3,7 @@ + <%= title %>