Back to Posts

Creating This Blog

Hello world!

  1. Create GitHub repo ‘blog’.
  2. Initialize with Hugo.
  3. Deploy via CloudFlare Pages. (GitHub Pages requires payment to deploy public pages from private repos.)

Installing a recent Hugo

  1. 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
    
  2. Install Hugo:

    sudo apt update
    sudo apt install hugo
    

Creating a new blog post

  1. 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
    
  2. Create a new post and add content.

    hugo new content content/posts/my-new-post.md
    
  3. For photos, remove EXIF data and maybe resize with mogrify from ImageMagick:

    mogrify -resize 2048x1536\> -strip *.jpg
    
  4. Start a development server to preview your new content, usually available at http://localhost:1313/.

    hugo server
    
  5. Save, commit, and push to GitHub. The site will deploy automatically.