开发者

How to watch for changes to HAML files and save them

开发者 https://www.devze.com 2023-01-02 20:16 出处:网络
I want to run a HAML command every time I save a particular file.I know this can be d开发者_C百科one by compass but only for sass not HAML has anyone done this or guide me how to.On MacOS (and I assum

I want to run a HAML command every time I save a particular file. I know this can be d开发者_C百科one by compass but only for sass not HAML has anyone done this or guide me how to.


On MacOS (and I assume, on linux too) you can use the 'watch' command from the terminal.

First, you need to install it using, for example "homebrew"

brew install watch

and then you can run it like:

watch haml haml/mypage.html.haml html/mypage.html


Or if anyone stumbled in here like I did. There is a newer tool: LiveReload that does all these automatically and more.


Sure, check out StaticMatic, nanoc, or Webby (search for these on gitHub). You can make them work with Compass too.

0

精彩评论

暂无评论...
验证码 换一张
取 消