Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grunt module to inject HTML templates

Recently started using Grunt as a build tool for a web app I'm hobbyist developing. I have a series of HTML files (to be used as templates), in a single folder, that I'd like injected at a particular point in the main HTML file.

Ideally, I could also wrap each file in a tag, but having to manually include this in the template files themselves is acceptable.

Is there an existing Grunt module to perform this?

EDIT: I may have worded my problem poorly before. Essentially, I have a single HTML file where the app will run (Single page app, business simulation game). In a separate folder, I have a series of HTML templates. Each of these template represents a dialog, or custom info page, something of that nature. As the app is developed, more and more templates will be in this folder.

Rather than manually including each one in my page, I'd like a way to automate injecting them that I can manage through Grunt.

like image 435
Jordaan Mylonas Avatar asked Jan 21 '14 22:01

Jordaan Mylonas


1 Answers

I may be late to answer this question, but for anyone that end up here, I found this grunt-plugins, maybe they help you too:

  • grunt-replace.
  • grunt-html-build.
  • grunt-processhtml.
like image 171
Yahya KACEM Avatar answered Sep 21 '22 08:09

Yahya KACEM