Last Updated: February 25, 2016
· samuelclarke

Coda + Hammer + MAMP PRO

Looking to hand code a site in a local dev and needing a mix of mostly HTML but with some included PHP? Hammer for Mac is a game changer for local dev of a hand coded site with its includes, optimisation and auto build. Getting Coda and Hammer to play nice together is simply a matter of adding MAMP PRO to the mix - it's a perfect dev environment. The full benefits of hand coding with the time saving elements of a CMS/PHP.

Here's the workflow I'm using for

Coding: Coda 2 -

Compiling: Hammer 1.6 -

Dev Server Environment: MAMP PRO 2.1 -

Here's how I do it:

  1. Setup Hammer with your project folder.

  2. Setup MAMP PRO with the disk location as the Hammer build folder inside your project folder and give your dev server a name (for the above site I used www.lvs which gives a local address of: www.lvs:8888).

  3. Setup Coda with the local root of your project folder and the local URL as the one you specified in MAMP PRO (don't forget the :8888 on the end).

You're done! Code away in Coda and as you save files in your project folder, Hammer will auto build them and update the preview back in Coda.

Two problems I've found are:

  1. If you're using the <!-- @reload --> tag from Hammer it can sometimes cause a refresh in Coda before Hammer has rebuild the file giving a 404. If this happens just hit save again on the file in Coda and it will update.
  2. If you select the Optimise option in Hammer the auto build takes a lot longer. I only turn it on when I'm about to publish to the live environment.

Hit me up in the comments on how it worked for you or if you think there's a better workflow!