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

pageLayouts for multiple folders inside folder #210

Open
babarogic opened this issue Mar 6, 2020 · 4 comments
Open

pageLayouts for multiple folders inside folder #210

babarogic opened this issue Mar 6, 2020 · 4 comments

Comments

@babarogic
Copy link

babarogic commented Mar 6, 2020

How to achieve with panini to put specific layout for specific pages/folders.
For now i achieved to point as in documentation provided folder blog to blog layout. But panini does not goes deeper and points layout to other folders inside folders. How to achieve that?

It goes something like this but not successful

pageLayouts: {
        'product': 'product',
        'product/folder2/': 'product',
        'product/folder3/': 'product',
        'kontakt': 'kontakt'
      }

folder2 and folder3 are pointed to defauly layout rather not to product layout

@kolejakjozef
Copy link

@babarogic i needed this solution today, and i figured it out.
This way it works for me on windows environment:
pageLayouts: { 'product': 'product', 'product\\folder2': 'product', 'product\\folder3': 'product', 'kontakt': 'kontakt' }

@babarogic
Copy link
Author

babarogic commented Sep 17, 2020

@kolejakjozef Awesome!
Here is another solution, in html pages, just call this on the beginning and it will use the layout you assignee to

---
layout: name-of-layout
---

@TolyanDimov
Copy link

Help: How can you create two partials directories?

.pipe(panini({
  ...
  partials: srcRoot + appDir + '/components/',
  partials: srcRoot + appDir + '/modules/',
  ...
}))

For example: if in the partials folder, place the components and modules folders.
A problem arises when the html file has the same name in both folders.

@LitvinenkoEvgeny
Copy link

@TolyanDimov
as i can see, you can't because
https://github.com/foundation/panini/blob/develop/lib/loadPartials.js#L11
loadPartials function apply only one directory

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

4 participants