-
Notifications
You must be signed in to change notification settings - Fork 105
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
Listing pages in menu list automatically as they are created #178
Comments
I am also in need of this functionality. |
You might want to create a custom handlebars helper for this as panini is based on handlebars. |
Is there a way to add these helpers to the foundation stack to use them? |
Yes, you can define it in the configuration. https://github.com/foundation/panini/blob/develop/index.js#L27 https://github.com/foundation/panini/blob/develop/lib/loadHelpers.js#L6-L10 https://github.com/foundation/panini#usage
I'm not 100% sure but this should not be a problem. But self-contained helpers are often probably better. Best it you try what works as I have not used Panini for a long time. |
Ok, this is going to be a really noob question, but if I have the handlerbars-helpers package installed how do I point my config to those helpers? I shouldn't have to/can't point it to the node_modules folder its in right? |
Technically you can do it but it's better to copy the needed helpers into your project and reference this path like we do it in the readme. |
|
That shouldwork, yes, the required / imported packages / modules inside of them should be resolved by Nodejs itself so you can do anything you want in there, even require / import things from node_modules by package name or path). |
Probably not possible, but I never tried to achieve something like this. Maybe there is some way. |
I got this to work inside my own helper.js
A bit modified from the main helper, but it works. So it is possible to, just kind of a pain.
I don't know how to actually go through it. If I just put {{ this }} in between the readdir it outputs it, but removing the each doesn't work |
Hello,
I have a desire to automatically list pages to a menu list. How can I go about doing this (creating the menu list of pages automatically) with panini when the pages are created in the /src/pages folder?
Thank you in advance!
The text was updated successfully, but these errors were encountered: