helpers / handlebars-helpers

188 handlebars helpers in ~20 categories. Can be used with Assemble, Ghost, YUI, express.js etc.
http://assemble.io/helpers/
MIT License
2.22k stars 364 forks source link

Helper to get current filename #301

Closed HaoZeke closed 6 years ago

HaoZeke commented 6 years ago

So maybe something like

{{fname}} which should give the name.html of the current page?

jonschlinkert commented 6 years ago

https://github.com/helpers/handlebars-helpers/blob/master/lib/path.js#L81-L100?

HaoZeke commented 6 years ago

That assumes you can pass the full path...

doowb commented 6 years ago

@HaoZeke handlebars renders string templates so there isn't a way to know that the filename is. You'll need to pass that on the context to handlebars, then you can use the path helpers that Jon linked to.