Skip to content

Commit 793aaaf

Browse files
committed
Blog posts: set default permalink URL for new posts
Currently each post needs to have its URL manually specified, but all of the information we use to construct that URL (date + short title) is available in its file name. This commit sets the default permalink URL using that metadata; it can still be overridden by manually putting a "permalink:" entry in the post's YAML header. The benefit of this change is that it's one fewer date that needs to be manually set by somebody on release day. I tested that this change does not change the URLs of any existing pages.
1 parent d78dbee commit 793aaaf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

_config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ defaults:
8888
layout: doc
8989
lang: en
9090
share: true
91+
- scope:
92+
path: "_posts/en/posts"
93+
type: posts
94+
lang: en
95+
values:
96+
permalink: /en/:year/:month/:day/:title/
9197

9298
collections:
9399
releases:

0 commit comments

Comments
 (0)