-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
handlebars helper: file name, file name with extension #32
Comments
What does this mean? Is this something that would be better as being a default global variable available in the context? |
This would be probably two helpers which would enable you to add the file name and/or file extension to the page as a string. One for the name of the current file, |
moved to helper-lib |
I know it is old, but I am struggling with a problem that this helper would solve: I want to build the HTML menu dynamically and have the YAML file with the key-value pairs, where key is the same as the filename of the HTML file, so with with a helper I could compare the current filename and the data and export the |
@primozcigler we actually added <ul>
{{#each pages}}
<li class="{{#if isCurrentPage}}active{{/if}}">{{title}}</li>
{{/each}}
</ul> |
Or just get https://github.com/helpers/handlebars-helper-isActive (and follow the instructions on the README of that project), then you can do: <ul>
{{#each pages}}
<li {{isActive}}>{{title}}</li>
{{/each}}
</ul> |
That's awesome, I will take a look, thank you! |
No description provided.
The text was updated successfully, but these errors were encountered: