hugohugo-theme

How do I serve a Hugo theme exampleSite?


I'm coming from using Jekyll as a Static Site Generator. Content and themes are normally kept in the same directory/git repo.

I'm trying to set up a Hugo site, using the bare-bones theme Hugo Xmin. It contains the standard directory exampleSite.

How can I serve the exampleSite with the theme using Hugo (locally)? after I:

git clone git@github.com:yihui/hugo-xmin.git
cd hugo-xmin

Solution

  • The one-line command is:

    hugo server --source exampleSite/ --themesDir ../..
    

    Alternatively, go into the exampleSite and serve with passing the parent directory as an argument:

    cd exampleSite
    hugo server --themesDir ../..