update AI page

This commit is contained in:
Raven Scott
2024-10-02 05:30:13 -04:00
parent c2a658c61c
commit ded4c43700
5 changed files with 122 additions and 0 deletions

20
app.js
View File

@ -166,6 +166,26 @@ app.get('/about', (req, res) => {
});
});
// About Route (Load markdown and render using EJS)
app.get('/about-rayai', (req, res) => {
const aboutMarkdownFile = path.join(__dirname, 'me', 'about-rayai.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 RayAI`,
content: aboutContentHtml,
menuItems // Pass the menu items to the view
});
});
});
// Contact Route (Render the contact form)
app.get('/contact', (req, res) => {
res.render('contact', {