diff options
Diffstat (limited to '')
-rw-r--r-- | src/posts.11tydata.js | 10 | ||||
-rw-r--r-- | src/posts.html | 16 | ||||
-rw-r--r-- | src/posts/posts.11tydata.js | 6 |
3 files changed, 17 insertions, 15 deletions
diff --git a/src/posts.11tydata.js b/src/posts.11tydata.js new file mode 100644 index 0000000..0185d9c --- /dev/null +++ b/src/posts.11tydata.js @@ -0,0 +1,10 @@ +export default function () { + return { + layout: "page", + title: "Posts", + eleventyNavigation: { + key: "Posts", + order: 2 + } + } +}
\ No newline at end of file diff --git a/src/posts.html b/src/posts.html index fde3bfd..10ebe3b 100644 --- a/src/posts.html +++ b/src/posts.html @@ -1,20 +1,10 @@ ----json -{ -"layout": "page", -"title": "Posts", -"eleventyNavigation": { -"key": "Posts", -"order": 2 -} -} ---- <div itemscope :itemtype="schema('Blog')" role="feed" aria-busy="false" webc:for="(post, index) of collections.post"> <article itemprop="blogPost" itemscope :itemtype="schema('BlogPosting')" :aria-posinset="index" :aria-setsize="collections.post.lenght"> <h3 itemprop="headline"><a :href="post.url" itemprop="sameAs" @text="post.data.title"></a></h3> <small> - <time :datetime="htmlDateString(post.date)" itemprop="datePublished" - @text="readableDate(post.date)"></time> - + <time :datetime="htmlDateString(post.date)" itemprop="datePublished" @text="readableDate(post.date)"></time> + - <span itemprop=" author" itemscope :itemtype="schema('Person')"></span> <a :href="metadata.author.url" rel="author" itemprop="url"> <span itemprop="name" @text="metadata.author.name"> @@ -22,4 +12,4 @@ </small> <p itemprop="abstract" @text="post.data.description"></p> </article> -</div> +</div>
\ No newline at end of file diff --git a/src/posts/posts.11tydata.js b/src/posts/posts.11tydata.js index f03d0cf..c9924d9 100644 --- a/src/posts/posts.11tydata.js +++ b/src/posts/posts.11tydata.js @@ -1,13 +1,15 @@ import slugify from '@sindresorhus/slugify'; -export default _ => { +export default function () { return { layout: "post", tags: [ "post" ], eleventyComputed: { - permalink: data => `posts/${slugify(data.title)}/` + permalink(data) { + return data.title ? `posts/${slugify(data.title)}/` : `posts/${data.page.fileSlug}/` + }, } } } |