问题
I use haml
a lot when developing web applications but for the job I am doing right now all the client needs is flat HTML
files and some javascript
. There are quite a few files I thought it might be easier to code them all up using haml
, with a layout file to capture the stuff common to each page.
I checked the haml
docs and they offer a simple example:
haml hello_world.haml hello_world.html
that happily generates a hello world page from my template. I've scoured the docs for information on how I could get it to recognise a layout.haml
file however but have not had any luck.
The goal is to set up a directory structure like
/
- templates/
- layout.haml
- other.haml
- pages.haml
- output/
and from command line just go
haml templates output
and generate other.html
and pages.html
Is this possible, or am I looking at the wrong tool for this job?
回答1:
I'd look at using Jekyll with a HAML workflow something like this http://mikeferrier.com/2011/04/29/blogging-with-jekyll-haml-sass-and-jammit/
回答2:
nanoc is pretty good too.. possibly simpler than jekyll in some ways, though with less goodies
来源:https://stackoverflow.com/questions/12242144/how-to-use-haml-to-generate-standalone-html-files-via-a-layout-template