Add meta
This commit is contained in:
7
app.js
7
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';
|
||||
|
Reference in New Issue
Block a user