Creating This Blog
Hello world!
- Create GitHub repo ‘blog’.
- Initialize with Hugo.
- Deploy via CloudFlare Pages. (GitHub Pages requires payment to deploy public pages from private repos.)
Installing a recent Hugo
-
Add the Hugo APT repository:
sudo apt install -y gnupg software-properties-common curl -fsSL https://apt.gohugo.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hugo-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/hugo-archive-keyring.gpg] https://apt.gohugo.io/ stable main" | sudo tee /etc/apt/sources.list.d/hugo.list -
Install Hugo:
sudo apt update sudo apt install hugo
Creating a new blog post
-
Navigate to the blog source repository, or clone it if you haven’t already.
git clone git@github.com:mbdriscoll/blog.git cd blog/src git submodule update --init --recursive -
Create a new post and add content.
hugo new content content/posts/my-new-post.md -
For photos, remove EXIF data and maybe resize with
mogrifyfrom ImageMagick:mogrify -resize 2048x1536\> -strip *.jpg -
Start a development server to preview your new content, usually available at http://localhost:1313/.
hugo server -
Save, commit, and push to GitHub. The site will deploy automatically.