diff --git a/.eleventy.js b/.eleventy.js index b78d61c..9f252d3 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -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 + 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) { diff --git a/src/_data/site.json b/src/_data/site.json index 3573431..41f4846 100644 --- a/src/_data/site.json +++ b/src/_data/site.json @@ -1,4 +1,5 @@ { + "url": "https://jesus.twk95.com", "author": { "name": "Jesus Otero", "email": "jesus@twk95.com", diff --git a/src/_includes/layout.njk b/src/_includes/layout.njk index 498e309..15cbcf8 100644 --- a/src/_includes/layout.njk +++ b/src/_includes/layout.njk @@ -5,6 +5,36 @@ {{ title }} + + + + + + + + + + + + + diff --git a/src/blog.njk b/src/blog.njk index d109a4f..76483f5 100644 --- a/src/blog.njk +++ b/src/blog.njk @@ -1,6 +1,8 @@ --- title: "Blog" layout: "layout.njk" +sitemapPriority: 0.8 +sitemapChangefreq: "monthly" ---

All Posts

diff --git a/src/blog/8.14.25.md b/src/blog/8.14.25.md index 8c7fd3a..5b08250 100644 --- a/src/blog/8.14.25.md +++ b/src/blog/8.14.25.md @@ -3,7 +3,10 @@ title: "Junos ZTP with Dnsmasq DHCP in OPNsense" date: "2025-08-14" layout: "post.njk" tags: "posts" +description: "Stop configuring your new lab devices manually!" excerpt: "Stop configuring your new lab devices manually!" +sitemapPriority: 0.5 +sitemapChangefreq: "never" --- Most people know that DHCP (Dynamic Host Configuration Protocol) is a protocol used to dynamically allocate IP addresses. But did you know that it can be used to configure other host device settings? Network device vendors like Junip... *ermm*, HPE Networking... take advantage of DHCP to implement "Zero Touch Provisioning" and even perform software upgrades for out-of-the-box devices. Here I will show you how to use OPNsense with Dnsmasq DHCP to "auto-provision" your Junos devices. diff --git a/src/blog/8.5.25.md b/src/blog/8.5.25.md index 5eaee0e..596d4c6 100644 --- a/src/blog/8.5.25.md +++ b/src/blog/8.5.25.md @@ -3,7 +3,10 @@ title: "My First Blog Post" date: "2025-08-05" layout: "post.njk" tags: "posts" +description: "First post made using Eleventy!" excerpt: Made using Eleventy! +sitemapPriority: 0.5 +sitemapChangefreq: "never" --- Welcome to my new blog! This is my very first post. This website was created using eleventy in a custom nodejs docker container, pretty cool huh?? Maybe I'll post the source code here one day! diff --git a/src/blog/template.md b/src/blog/template.md deleted file mode 100644 index 8b17228..0000000 --- a/src/blog/template.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "" -date: "" -layout: "post.njk" -#tags: "posts" -excerpt: "" ---- - -Type here \ No newline at end of file diff --git a/src/blog/test.md b/src/blog/test.md index c7dc737..6fd41e0 100644 --- a/src/blog/test.md +++ b/src/blog/test.md @@ -2,6 +2,7 @@ title: "Test page!" date: "2025-08-07" layout: "post.njk" +draft: true excerpt: This post is a feature showcase of what you can do with Eleventy --- diff --git a/src/index.md b/src/index.md index 05819b3..e78c32d 100644 --- a/src/index.md +++ b/src/index.md @@ -2,6 +2,8 @@ title: "Jesus - Network Engineer" layout: "layout.njk" descrption: "A website showcasing my skills and experience as a network engineer" +sitemapPriority: 0.9 +sitemapChangefreq: "weekly" ---
diff --git a/src/robots.txt b/src/robots.txt new file mode 100644 index 0000000..5b40df2 --- /dev/null +++ b/src/robots.txt @@ -0,0 +1,9 @@ +User-agent: * +Allow: / + +User-agent: GPTBot +Disallow: / + +Host: https://jesus.twk95.com + +Sitemap: https://jesus.twk95.com/sitemap.xml diff --git a/src/sitemap.xml.njk b/src/sitemap.xml.njk new file mode 100644 index 0000000..d67fc68 --- /dev/null +++ b/src/sitemap.xml.njk @@ -0,0 +1,25 @@ +--- +permalink: /sitemap.xml +eleventyExcludeFromCollections: true +--- + + + {%- for page in collections.all %} + {%- set draft = page.data.draft %} + {%- if not draft %} + {%- set priority = page.data.priority if page.data.priority else "0.5" %} + + {{ site.url }}{{ page.url }} + {{ page.date | htmlDateString }} + {{ page.data.sitemapChangefreq | default("monthly") }} + {{ page.data.sitemapPriority | default(0.8) }} + + {%- endif %} + {%- endfor %} + + https://jesus.twk95.com/resume/jesus.pdf + 2025-08-21 + monthly + 0.8 + +