Simple way to apply template to existing HTML code
Suppose I have a bunch of (very simple) HTML pages, that I want to apply a common 'theme".
These files are downloaded using various Groovy scripts, and I would like to apply to them this styling during a maven build. How could I do that ? Using which framework/library could I do that ?
Furthermore notice I want to do that in a static fashion, that's to say I want to have the following process to occur
- Files are downloaded by Groovy scripts
- They are processed (in a "magical" fashion) by this library
- They may be sent by FTP/SCP to an hos开发者_高级运维ting server
Do you know such an easy to use library ?
Depends on the details of the task but having in mind the steps you've described you can consider using velocity templates.
I would suggest using sitemesh decorator. I am a user of old version but a new release is being worked on that allows you to do exactly what you are asking for. Do a google search on sitemesh and you should find lots of examples.
In a nutshell sitemesh decoration: basic html + template = decorated page.
精彩评论