Merge branch 'master' into last-x-posts

This commit is contained in:
Mathias Bynens 2018-09-29 10:49:44 -04:00 committed by GitHub
commit 81a2f8c135
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 38 additions and 8 deletions

View File

@ -17,6 +17,11 @@ module.exports = function(eleventyConfig) {
return array.slice(0, n); 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 // only content in the `posts/` directory
eleventyConfig.addCollection("posts", function(collection) { eleventyConfig.addCollection("posts", function(collection) {
return collection.getAllSorted().filter(function(item) { return collection.getAllSorted().filter(function(item) {

1
404.md
View File

@ -1,6 +1,7 @@
--- ---
layout: layouts/home.njk layout: layouts/home.njk
permalink: 404.html permalink: 404.html
excludeFromSitemap: true
--- ---
# Content not found. # Content not found.

View File

@ -2,13 +2,13 @@
{% for post in postslist | reverse %} {% for post in postslist | reverse %}
<li class="postlist-item{% if post.url == url %} postlist-item-active{% endif %}"> <li class="postlist-item{% if post.url == url %} postlist-item-active{% endif %}">
<a href="{{ post.url | url }}" class="postlist-link">{% if post.data.title %}{{ post.data.title }}{% else %}<code>{{ post.url }}</code>{% endif %}</a> <a href="{{ post.url | url }}" class="postlist-link">{% if post.data.title %}{{ post.data.title }}{% else %}<code>{{ post.url }}</code>{% endif %}</a>
<span class="postlist-date">{{ post.date | readableDate }}</span> <time class="postlist-date" datetime="{{ post.date | htmlDateString }}">{{ post.date | readableDate }}</time>
{% for tag in post.data.tags %} {% for tag in post.data.tags %}
{%- if tag != "post" -%} {%- if tag != "post" -%}
{% set tagUrl %}/tags/{{ tag }}/{% endset %} {% set tagUrl %}/tags/{{ tag }}/{% endset %}
<a href="{{ tagUrl | url }}" class="tag">{{ tag }}</a> <a href="{{ tagUrl | url }}" class="tag">{{ tag }}</a>
{%- endif -%} {%- endif -%}
{% endfor %} {% endfor %}
</li> </li>
{% endfor %} {% endfor %}
</ol> </ol>

View File

@ -1,5 +1,6 @@
--- ---
permalink: feed/feed.xml permalink: feed/feed.xml
excludeFromSitemap: true
--- ---
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"> <feed xmlns="http://www.w3.org/2005/Atom">
@ -23,4 +24,4 @@ permalink: feed/feed.xml
<content type="html">{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</content> <content type="html">{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</content>
</entry> </entry>
{%- endfor %} {%- endfor %}
</feed> </feed>

View File

@ -1,5 +1,6 @@
--- ---
permalink: feed/.htaccess permalink: feed/.htaccess
excludeFromSitemap: true
--- ---
# For Apache, to show `{{ metadata.feed.filename }}` when browsing to directory /feed/ (hide the file!) # For Apache, to show `{{ metadata.feed.filename }}` when browsing to directory /feed/ (hide the file!)
DirectoryIndex {{ metadata.feed.filename }} DirectoryIndex {{ metadata.feed.filename }}

View File

@ -19,4 +19,7 @@ function myCommand() {
let counter = 0; let counter = 0;
counter++; counter++;
} }
// Test with a line break above this line.
console.log('Test');
``` ```

View File

@ -13,6 +13,9 @@ function myCommand() {
let counter = 0; let counter = 0;
counter++; 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. 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.

16
sitemap.xml.njk Normal file
View File

@ -0,0 +1,16 @@
---
permalink: /sitemap.xml
excludeFromSitemap: true
---
<?xml version="1.0" encoding="utf-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{%- for page in collections.all %}
{%- if not page.data.excludeFromSitemap %}
{% set absoluteUrl %}{{ page.url | url | absoluteUrl(metadata.url) }}{% endset %}
<url>
<loc>{{ absoluteUrl }}</loc>
<lastmod>{{ page.date | htmlDateString }}</lastmod>
</url>
{%- endif %}
{%- endfor %}
</urlset>