Search code examples
htmlhamlpreprocessor

Do I need to convert each file from haml to html?


I'm just getting into preprocessors, and I'm beginning with haml. I've got the basics down, and have yet to put this to any practical use. I'm not great with the command line, but at the very least, I've managed to convert my index.haml file to a readable html file.

My question is twofold.

1) Do I need to individually convert EACH file within my site directory i.e index.haml | service.haml | contact.haml etc or am I able to bulk convert the entire directory?

2) My second question relates to CMS's such as Wordpress. Am I able to use preprocessors with platforms such as this? If so, how would that work?

Apologies if these questions sound basic and/or stupid, but gotta start somewhere!

Thanks, Scott


Solution

  • 1) NO, you don't need to convert each file to HAML. your server serves back HTML back to the client. If it's just plain HTML, it just serves without pre-processing through HAML engine. If it's haml, it pre-processes to generate HTML which will be finally served to the client.

    2) CMS's such as WordPress support plain HTML by default, maybe some plugins might allow you to use HAML. you can always use conversion tools like htmltohaml to convert HAML templates to HTML if you want skip plugins.