Skip to content

How can I set a default layout and permalink for a collection? #3166

Answered by btrem
drakonicguy asked this question in Q&A
Discussion options

You must be logged in to vote

You can also use a directory data json file instead of a javascript file. I generally use json unless I need to use logic in the data file. I don't know jekyll, so you'll have to create a date filter, maybe a title filter to fine tune the results, but this should give you an idea of how it works:

{
    "layout": "blog-main",
    "permalink": "/blog/{{ page.date | yourDateFilter ') }}-{{ title | slug }}"
}

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
5 replies
@pdehaan
Comment options

pdehaan Jan 14, 2024
Collaborator

@drakonicguy
Comment options

@drakonicguy
Comment options

@pdehaan
Comment options

pdehaan Jan 14, 2024
Collaborator

@drakonicguy
Comment options

Comment options

You must be logged in to vote
1 reply
@drakonicguy
Comment options

Answer selected by drakonicguy
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants