dciccale / grunt-processhtml

Process html files at build time to modify them depending on the release environment
MIT License
407 stars 30 forks source link

Variable in value #102

Closed adrigm closed 8 years ago

adrigm commented 8 years ago

I can get a variable with the name of the html file where the command is executed?

Where "foo.html" is the html file where is the comment.

Mi componentsMenu Block: https://gist.github.com/adrigm/e6f8780ef937015366a6f2080088ae32

dciccale commented 8 years ago

no, why do you need the name of the file?

adrigm commented 8 years ago

To generate a menu.

Check if the current html file to add the link a class.

dciccale commented 8 years ago

Adding an active class to a link is not the purpose of this plugin. Normally you should try doing that in another part of your workflow.

And don't get me wrong, this would not be even possible right now, since the processor is being created once, and not per file.

I'm sorry, I think you should do this in the website itself not in the development process. use some javascript to check that on the dom or on the server side.

tip https://css-tricks.com/snippets/jquery/add-active-navigation-class-based-on-url/