Skip to content

Commit 2badb6a

Browse files
committed
Enhance Release Preparation: Auto-update datePublished in index.html #7746
1 parent 5a20280 commit 2badb6a

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

buildScripts/prepareRelease.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ if (insideNeo) {
8080

8181
fs.writeFileSync(footerPath, footerContentArray.join(os.EOL));
8282
}
83+
84+
// Update the datePublished in apps/portal/index.html for SEO purposes.
85+
// This ensures the structured data reflects the latest publication date.
86+
const indexPath = path.join(root, 'apps/portal/index.html');
87+
if (fs.existsSync(indexPath)) {
88+
let indexContent = fs.readFileSync(indexPath, 'utf-8');
89+
const today = new Date().toISOString().slice(0, 10); // YYYY-MM-DD format
90+
indexContent = indexContent.replace(/"datePublished": "\d{4}-\d{2}-\d{2}"/, `"datePublished": "${today}"`);
91+
fs.writeFileSync(indexPath, indexContent);
92+
console.log('Updated apps/portal/index.html datePublished');
93+
}
8394
}
8495

8596
// Generate sitemap.xml and llm.txt to ensure SEO files are up-to-date with the latest content and routes.

0 commit comments

Comments
 (0)