Skip to content

specify layout globally, so pages don't have to do it in frontmatter #2056

Answered by pdehaan
ahillio asked this question in Q&A
Discussion options

You must be logged in to vote

@ahillio It might depend on how your site is set up. If you have all your *.md files in a subdirectory, you could try using a directory data file which sets "layout": "the-same-layout.liquid" via JSON or JavaScript.

If you aren't using a subfolder, you could possibly try creating a _data/layout.json file and paste the following. It worked on my simple test case, but it was admittedly a very basic test case with only 3 templates and I didn't try overwriting the layout in any of other templates, so your mileage may vary:

"layouts/the-same-layout.liquid"

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ahillio
Comment options

@pdehaan
Comment options

pdehaan Oct 27, 2021
Collaborator

@cfjedimaster
Comment options

@pdehaan
Comment options

pdehaan Oct 27, 2021
Collaborator

Answer selected by ahillio
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