Public Access
1
0

feat: enhance SEO with sitemap and robots.txt, add Open Graph and Twitter meta tags

This commit is contained in:
2025-08-21 19:09:40 -04:00
parent 53223431f1
commit 3b764a3b43
11 changed files with 87 additions and 9 deletions

View File

@@ -6,6 +6,9 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy("src/resume");
eleventyConfig.addPassthroughCopy("src/assets/images");
eleventyConfig.addPassthroughCopy({ "favicon" : "/" } );
eleventyConfig.addPassthroughCopy({ 'src/robots.txt': '/robots.txt' });
eleventyConfig.addPassthroughCopy({ 'src/sitemap.xml': '/sitemap.xml' });
// Add a filter for readable dates using vanilla JS
eleventyConfig.addFilter("readableDate", dateObj => {
// The toLocaleDateString method can be used to format dates
@@ -19,6 +22,14 @@ module.exports = function(eleventyConfig) {
});
});
// Add htmlDateString filter for sitemap <lastmod>
eleventyConfig.addFilter("htmlDateString", dateObj => {
if (!dateObj) return "";
// Format date as YYYY-MM-DD for sitemaps
const d = new Date(dateObj);
return d.toISOString().split("T")[0];
});
// Shortcode for creating a callout box
// This is a "paired shortcode" which means it has a start and end tag.
eleventyConfig.addPairedShortcode("callout", function(content, title) {