change from mtime to dateCreated

This commit is contained in:
Raven Scott 2024-09-19 01:44:03 -04:00
parent 32d6465bf9
commit aed95beea1

5
app.js
View File

@ -84,10 +84,10 @@ function getAllBlogPosts(page = 1, postsPerPage = 5) {
// Get the last modified date of the markdown file
const stats = fs.statSync(path.join(__dirname, 'markdown', file));
const lastModifiedDate = new Date(stats.mtime); // Use mtime for last modification time
const dateCreated = new Date(stats.birthtime); // Use mtime for last modification time
// Format the date
const formattedDate = lastModifiedDate.toLocaleDateString('en-US', {
const formattedDate = dateCreated.toLocaleDateString('en-US', {
year: 'numeric',
month: 'long',
day: 'numeric'
@ -270,7 +270,6 @@ app.get('/sitemap.xml', (req, res) => {
});
// RSS Feed Route
// RSS Feed Route
app.get('/rss', (req, res) => {
const hostname = req.headers.host || 'http://localhost'; // Adjust for production if needed