Run a hugo powered static site blog
Run a hugo
powered static site blog.
Install
Check the hugo releases
for the latest hugo_0.XX_Linux-64bit.tar.gz
and uncompress it in the
current working directory.
Check its working:
$ ./hugo version
Hugo Static Site Generator v0.42 linux/amd64 BuildDate: 2018-06-12T06:37:22Z
Development
Start the hugo server in hot-reload development mode:
$ ./hugo server -D
Content
Create a file in mysite.com/content/article/
e.g.:
cat <<EOF > "$(date --iso-8601=seconds)"-my-post-title.md
---
title: "My Post Title"
date: "$(date --iso-8601=seconds)"
featuredImage: "/images/my-post-image.png"
categories: ["tutorial"]
tags: ["bash", "hugo"]
author: "ubergarm"
noSummary: false
draft: true
---
Edit post contents here.
EOF
Production
Create a production build in default ./public/
directory:
$ ./hugo
Deployment
Deploy to live webserver root:
rsync -azvh ./public/* mysite.com:/srv/mysite.com/