hexo icon indicating copy to clipboard operation
hexo copied to clipboard

How can I disable layout for index.ejs?

Open myst729 opened this issue 12 years ago • 4 comments

I have layout.ejs for every sub page/post. But my homepage have a very different design, how can I render index.ejs without being wrapped by layout.ejs? In other words, can I disable layout for "root" page?

myst729 avatar Oct 23 '14 13:10 myst729

I'm looking for the same feature. Any idea ?

asvdw avatar Sep 15 '15 09:09 asvdw

By "root" do you mean the landing/index page? If so, refer to #1491, add index.md and remove hexo-generator-index.

leesei avatar Sep 28 '15 18:09 leesei

necro, but it's still open so /shrug

the best way to do this would just be to create a new layout (assuming you want to use hexo functionality), and call that from the front-matter via https://hexo.io/docs/templates.html it

By default, the layout template is used by all other templates. You can specify additional layouts in the front-matter or set it to false to disable it. It’s even possible to build a complex nested structure by including more layout templates in your top layout.

though it seems a little odd that you can disable layout.js or add a layout to it, but not specify a peer layout for it (apparently).

erutan avatar Nov 13 '15 10:11 erutan

@erutan Yep, that's how I have done :laughing:

myst729 avatar Nov 13 '15 11:11 myst729