Skip to content

Instantly share code, notes, and snippets.

@sanderson
Forked from tylerflint/0-instructions.md
Last active July 18, 2017 21:16
Show Gist options
  • Save sanderson/298a77f95393523446300d9794a61244 to your computer and use it in GitHub Desktop.
Save sanderson/298a77f95393523446300d9794a61244 to your computer and use it in GitHub Desktop.
Install Hugo on Nanobox

Hugo Project Bootstrap with Nanobox

If you haven't already, go ahead and download and install Nanobox.

# Create a new directory for your project and cd in
mkdir hugo-proj && cd hugo-proj

# Create a `boxfile.yml` using the content from this gist
curl -sL http://tinyurl.com/ya23f5ry > boxfile.yml

# Start the local environment
nanobox run

### Create a new hugo site
cd /tmp
hugo new site NAME
shopt -s dotglob
cp -a NAME/* /app/
cd -

# Start hugo
hugo server --bind "0.0.0.0"

Visit the app

In your browser, visit the IP provided at the begginging of the nanobox run output at port 1313. You can also add a dns alias for your locally running app if you don't want to use the raw IP.

nanobox dns add local hugo.dev

Develop

Write the app!

run.config:
# use the static engine
engine: static
# install hugo
extra_steps:
- bash <(curl -sL 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment