aboutsummaryrefslogtreecommitdiffstats
path: root/src/posts/posts.11tydata.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/posts/posts.11tydata.js')
-rw-r--r--src/posts/posts.11tydata.js6
1 files changed, 4 insertions, 2 deletions
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}/`
+ },
}
}
}