Lando + Hugo [+ ARM]

Geoff St. PierreGeoff St. Pierre|Fri, Aug 27, 2021

tl;dr Developing a static Hugo site with Lando and a team on varying chipsets.

πŸ”§ Use Case πŸ”§

Our team is made up of developers in multiple locations on Linux, Intel Macs, M1 Macs, etc. Our documentation is written using the Hugoopen in new window static site generator. Hugo is great, but it was not long after rollout that various developers inside and outside of the documentation team were running into local dev stack dependency nightmares 😱.

πŸ”₯ Lando to the Rescue πŸ”₯

Our first step was easy: we burned down all those different versions of node, npm, hugo cli etc and put A L L the necessary tooling into the dev stack managed by Lando. But we still had the different underlying chipsets to deal with! The magic bullet came by building the hugo cli from source via go install --tags extended. The extended part is what allows us to watch and compile SASS and rebuild new content.

      - rm -rf $HOME/src
      - mkdir -p $HOME/src
      - cd $HOME/src && git clone
      - cd $HOME/src/hugo && go install --tags extended

By building form source, this allows Go to detect the chipset and build the right version of hugo cli per developer.

πŸ›‹οΈ Living the Easy Life πŸ›‹οΈ

Now developers are living the dream:

git clone REPO
lando start
lando serve


⏺️ Resources ⏺️

Here is the full .lando.ymlopen in new window file.

Happy coding!