Convert about me to MD

This commit is contained in:
Raven Scott
2024-09-26 02:41:22 -04:00
parent 1634778e57
commit 815cbc034a
6 changed files with 49 additions and 98 deletions

18
app.js
View File

@ -122,9 +122,23 @@ app.get('/', (req, res) => {
});
// About Route
// About Route (Load markdown and render using EJS)
app.get('/about', (req, res) => {
res.render('about', { title: `About ${process.env.OWNER_NAME}` });
const aboutMarkdownFile = path.join(__dirname, 'me', 'about.md');
// Read the markdown file and convert to HTML
fs.readFile(aboutMarkdownFile, 'utf-8', (err, data) => {
if (err) {
return res.status(500).send('Error loading About page');
}
const aboutContentHtml = marked(data); // Convert markdown to HTML
res.render('about', {
title: `About ${process.env.OWNER_NAME}`,
content: aboutContentHtml
});
});
});
// Display the Request a Quote form