diff --git a/.eleventy.js b/.eleventy.js index 48a2aab..a8eddbe 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -17,6 +17,11 @@ module.exports = function(eleventyConfig) { return array.slice(0, n); }); + // https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string + eleventyConfig.addFilter('htmlDateString', (dateObj) => { + return DateTime.fromJSDate(dateObj).toFormat('yyyy-LL-dd'); + }); + // only content in the `posts/` directory eleventyConfig.addCollection("posts", function(collection) { return collection.getAllSorted().filter(function(item) { diff --git a/404.md b/404.md index a5465e4..c3d1080 100644 --- a/404.md +++ b/404.md @@ -1,6 +1,7 @@ --- layout: layouts/home.njk permalink: 404.html +excludeFromSitemap: true --- # Content not found. diff --git a/_includes/postslist.njk b/_includes/postslist.njk index 88882d9..edbf4e9 100644 --- a/_includes/postslist.njk +++ b/_includes/postslist.njk @@ -2,13 +2,13 @@ {% for post in postslist | reverse %}
  • {% if post.data.title %}{{ post.data.title }}{% else %}{{ post.url }}{% endif %} - {{ post.date | readableDate }} + {% for tag in post.data.tags %} - {%- if tag != "post" -%} - {% set tagUrl %}/tags/{{ tag }}/{% endset %} - {{ tag }} - {%- endif -%} - {% endfor %} + {%- if tag != "post" -%} + {% set tagUrl %}/tags/{{ tag }}/{% endset %} + {{ tag }} + {%- endif -%} + {% endfor %}
  • {% endfor %} diff --git a/feed/feed.njk b/feed/feed.njk index 636c9c2..f889671 100644 --- a/feed/feed.njk +++ b/feed/feed.njk @@ -1,5 +1,6 @@ --- permalink: feed/feed.xml +excludeFromSitemap: true --- @@ -23,4 +24,4 @@ permalink: feed/feed.xml {{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }} {%- endfor %} - \ No newline at end of file + diff --git a/feed/htaccess.njk b/feed/htaccess.njk index 3318d60..8b4e0d9 100644 --- a/feed/htaccess.njk +++ b/feed/htaccess.njk @@ -1,5 +1,6 @@ --- permalink: feed/.htaccess +excludeFromSitemap: true --- # For Apache, to show `{{ metadata.feed.filename }}` when browsing to directory /feed/ (hide the file!) -DirectoryIndex {{ metadata.feed.filename }} \ No newline at end of file +DirectoryIndex {{ metadata.feed.filename }} diff --git a/posts/firstpost.md b/posts/firstpost.md index 55f3af9..8bd3e44 100644 --- a/posts/firstpost.md +++ b/posts/firstpost.md @@ -19,4 +19,7 @@ function myCommand() { let counter = 0; counter++; } + +// Test with a line break above this line. +console.log('Test'); ``` diff --git a/posts/thirdpost.md b/posts/thirdpost.md index d128384..cae99a4 100644 --- a/posts/thirdpost.md +++ b/posts/thirdpost.md @@ -13,6 +13,9 @@ function myCommand() { let counter = 0; counter++; } + +// Test with a line break above this line. +console.log('Test'); ``` Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring. diff --git a/sitemap.xml.njk b/sitemap.xml.njk new file mode 100644 index 0000000..d1745a3 --- /dev/null +++ b/sitemap.xml.njk @@ -0,0 +1,16 @@ +--- +permalink: /sitemap.xml +excludeFromSitemap: true +--- + + +{%- for page in collections.all %} +{%- if not page.data.excludeFromSitemap %} + {% set absoluteUrl %}{{ page.url | url | absoluteUrl(metadata.url) }}{% endset %} + + {{ absoluteUrl }} + {{ page.date | htmlDateString }} + +{%- endif %} +{%- endfor %} +