Convert about me to MD
This commit is contained in:
18
app.js
18
app.js
@ -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
|
||||
|
Reference in New Issue
Block a user