First create a boxfile using the content from this gist
nanobox run
cd /tmp
hugo new site NAME
cp -a NAME/* /app/
cd -
hugo server --bind "0.0.0.0"
In your browser, visit the IP or domain if added at port 1313
Write the app!
First create a boxfile using the content from this gist
nanobox run
cd /tmp
hugo new site NAME
cp -a NAME/* /app/
cd -
hugo server --bind "0.0.0.0"
In your browser, visit the IP or domain if added at port 1313
Write the app!
run.config: | |
# use the static engine | |
engine: static | |
# install hugo | |
extra_steps: | |
- bash <(curl -s -L https://tinyurl.com/y8yojxte) |
#!/bin/bash | |
if [[ ! -f /data/bin/hugo ]]; then | |
cd /tmp | |
wget https://github.com/gohugoio/hugo/releases/download/v0.25.1/hugo_0.25.1_Linux-64bit.tar.gz | |
tar -xzf hugo_0.25.1_Linux-64bit.tar.gz | |
mv hugo /data/bin/hugo | |
cd - | |
rm -rf /tmp/* | |
fi |
You'll want to add the baseUrl
flag when running the server locally:
# If you specify a custom local dns alias:
hugo server --baseUrl=mysite.dev --bind="0.0.0.0"
# If no custom dns alias, use the IP address provided by nanobox
hugo server --baseUrl=172.19.0.4 --bind="0.0.0.0"
NOTE, I haven't figured out how to get livereload to work yet, but this is the start:
run.config:
# use the static engine
engine: static
# enable file watching for live reload
fs_watch: true
Don't worry about the
install.sh
script. The tinyurl included in theextra_steps
will pull the content and install hugo.