Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add layouts into folders #533

Closed
HammyNZ opened this issue Jun 21, 2013 · 7 comments
Closed

How to add layouts into folders #533

HammyNZ opened this issue Jun 21, 2013 · 7 comments

Comments

@HammyNZ
Copy link

HammyNZ commented Jun 21, 2013

Is there a way to add layouts into separate folders and be able to specify them with in a document.

Example:
I would like to have the following directory structure for my layouts:

src/layouts/template1/default.html.eco
src/layouts/template1/...

and

src/layouts/template2/default.html.eco
src/layouts/template2/...

Then is there a way to specify these layouts from their specified folder locations e.g


---
title: 'Page Title'
layout: 'template2/default'

---
...
@balupton
Copy link
Member

This should already work... doesn't it?

@dospuntocero
Copy link

it does sound like an ordering overkill to me... whats the point of doing something like that??
why not something like:

left-column-right-sidebar.html.eco
one-big-column.html.eco
etc...

instead of naming all template[something]/default.html.eco
you will end with 100s defaults... and nothing helping you to identify which one is the one you wanted...

it doesn't have much sense (at least to me...)

@HammyNZ
Copy link
Author

HammyNZ commented Jun 22, 2013

@balupton
When I tried this at work it didn't seem to work and come up with an error. I'll come back with specifics tomorrow when I'm back in the office.

@dospuntocero
Not what I quite meant, I want to be able to set up 2 different versions of templates grouped by theme

src/layouts/theme1/default.html.eco
src/layouts/theme1/landing.html.eco
src/layouts/theme1/homepage.html.eco
src/layouts/theme1/...

and

src/layouts/theme2/default.html.eco
src/layouts/theme2/landing.html.eco
src/layouts/theme2/homepage.html.eco
src/layouts/theme2/......
``

@balupton
Copy link
Member

Added some tests to the core test suite, definitely working on my side. Actually, I should test this on windows, as you may have to do: layout: "a\\b\\c\\layout-nested" on windows instead of layout: "a/b/c/layout-nested"

@balupton
Copy link
Member

Yep, above suspiscion is correct. Will need to normalize this.

@balupton
Copy link
Member

Fixed in v6.42.2

balupton added a commit that referenced this issue Jun 25, 2013
- v6.42.2 June 25, 2013
	- Fixed backslash and slash inconsistencies on windows in regards to
searching
		- Thanks to [Hamish](https://github.com/HammyNZ) for [issue
#533](#533)
@HammyNZ
Copy link
Author

HammyNZ commented Jul 1, 2013

Just tried the above suggestion, but double slashes didn't seem to work on my windows installation (I believe I'm running Docpad v6.34.2).

Works if you use only single slashes: layout: "a\b\c\layout-nested" instead of layout: "a/b/c/layout-nested"

Thanks for leading me in the right direction :)

balupton added a commit that referenced this issue Oct 23, 2013
- v6.42.2 June 25, 2013
	- Fixed backslash and slash inconsistencies on windows in regards to
searching
		- Thanks to [Hamish](https://github.com/HammyNZ) for [issue
#533](#533)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants