Programming Blog

Jeremy Morgan

Mostly Coherent Ramblings of a Silicon Forest Software Developer

How to Set Up Hugo on Pop!_OS

If you want to generate static websites (like this blog) then Hugo is the package for you. There are several cool things about Hugo, the biggest being performance. It compiles static sites faster than any other static site generator I’ve used.

In the last tutorial, I showed how to set it up and deploy to a small Linux server, and in this article I’ll show you how to set it up for personal development in Pop!_OS. You can generate pages and push them to any static host.

Install Golang

The first thing you’ll need to do, if you haven’t already is install Golang

1
sudo apt install golang

but you’ll be a few versions behind. I like to have the freshest version of the language, so I just Download Golang and grab the latest archive for Linux. It’s a binary format so you don’t even have to build it.

Extract it with this command:

1
tar -C /usr/local -xzf [name of archive]

Then add the path to go in your profile:

1
2
3
vi ~/.profile

PATH=$PATH:/usr/local/go/bin

Type in “go version” to verify:

Hugo on Pop!_OS

Install Hugo

Now you’ll need to install Hugo itself. There are a few ways to do it, including using apt, but again I like to have the latest version:

1
2
3
4
5
mkdir $HOME/src
cd $HOME/src
git clone https://github.com/gohugoio/hugo.git
cd hugo
go install --tags extended

This will install the latest version of Hugo to your machine. Now you’ll need to add another folder to the path so you can run hugo:

In ~/.profile:

1
export PATH=$PATH:/home/[Your username]/go

Now you need to test out hugo:

1
hugo help

It should look something like this:

Hugo on Pop!_OS

Create a New Hugo Site

Now you’ll need to create a new Hugo site:

1
hugo new site hellohugo

Now you’re going to need a theme:

You can find a good list of Hugo themes here.

Once you find one you like, copy the link the repo. I choose “Hyde” for this example:

1
2
cd themes
git clone https://github.com/spf13/hyde

Now create a new post:

1
hugo new helloworld.md

Your post will look like this:

1
2
3
4
5
6
7
---
title: "Post"
date: 2020-03-03T22:29:45-08:00
draft: false
---

Hello! This is the first blog post! 

Add some content, and make sure to change “draft” to true.

To test it out:

1
hugo serve

Hugo on Pop!_OS

And you’re ready to view your blog on localhost:1313:

Hugo on Pop!_OS

All files are generated in /public so when you’re ready to publish run:

1
hugo

And then all the files in /public will be your new site.

Hugo on Pop!_OS

Enjoy your new blog!

If you have any questions or comments feel free to contact me. Let me know what cool sites you’ve built with Hugo!



Create Your Own Blog for 5 Dollars a Month

Blogging about tech is fun. Having your own blog allows you to help others, polish your skills, and maybe get you a job.

Blogging on other sites such as Medium, Dev.To, etc can be really fun. I do that all the time. But having your OWN site to manage your content is important as well. This gives you freedom to do things exactly as you want, and you don’t have to worry about losing your content.

If you follow this tutorial, you can have your own statically hosted blog for $5 a month. All you need is a domain name.

Stop Fearing the Whiteboard. Conquer It.

It’s time we stopped fearing, complaining, and arguing about whiteboard coding interviews.

With a solid plan, a little skilling up, and some practice, you can master the whiteboard interview. We can argue for days about the validity of this type of interview, but the fact is many organizations require it. So are you going to let this obstacle stop you from getting the job you want? Of course not. Let’s tackle the whiteboard interview, and defeat it.

Getting Started With WSL

Windows Subsystem for Linux (WSL) is awesome.

It gives you the power to use Linux within your Windows system. A Linux shell can be difficult to learn, but the payoffs are incredible. You can become insanely productive with it. I encourage every Windows developer to give this a try.

Early in my development career, I was a Unix/Linux developer, and I loved working with the shell. In 2010 I was thrust into the world of Windows with GUIS. There was PowerShell and some workarounds, but it wasn’t quite the same. While I eventually gained proficiency and speed at first, it was a drag.

The most significant advantage of WSL right now is improving productivity and bringing powerful Linux programs directly to your Windows desktop. So let’s try it out!

Analyzing Attacks on My Server

I was casually doing a security audit on my blog recently and decided to look a little deeper into my security logs. With a bit of Linux command line kung fu, some Golang, and Google sheets, I was able to get a pretty good idea of where the attacks are coming from.

Become a React Developer in a Weekend

If you want to be a React Developer, there’s a lot to learn. You can get started in a weekend. Yes, in a single weekend, you can learn React and start developing some cool applications!

Here’s how I would approach it.

Using a Raspberry Pi as Your Development Server

In this tutorial, I will show you how to set up a Raspberry Pi 4 as a development (or testing) server. You can use this as a place to push your code and test it in a web browser. For the demo, I’ll use a React application, but with a few modifications, you can build just about anything with it.