Installing Hugo on Ubuntu

The following is the process I used to install Hugo on POP_OS! 19.04.

$ symbol in the steps below represent the linuxbrew or current directory within linuxbrew. In my case that’s located at…
joe@pop-os:/home/linuxbrew/$

Install Git

$ sudo apt install git

Install Homebrew for Linux

$ cd /home

$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

Hugo

$ cd linuxbrew/

$ sudo apt install linuxbrew-wrapper

$ brew install hugo

$ sudo apt install hugo

$ hugo version

$ hugo new site quickstart

$ cd quickstart/themes/

Choose and download a theme to the themes folder within quickstart. In my case i”m going to use the Ananke Gohugo Theme.

$ git clone https://github.com/budparr/gohugo-theme-ananke.git

$ cd ..

$ git init

Edit your config.toml file and add the folder name to the theme file.

baseURL = "http://example.org/"
languageCode = "en-us"
title = "My New Hugo Site"
theme = "gohugo-theme-ananke"

Start Hugo

$ hugo server -D

If everything worked as expected your hugo site should be live at http://localhost:1313/

If you’re curious the test site I published to netlify is at https://epic-mayer-0e6e10.netlify.com/

Reading for quality not quantity

What Happened When I (Tried to) Read 30 Books in 30 Days” popped up in the Firefox New Tab, Pocket recommendations but stopped a bit abruptly in the recommendations to read more. I have a few tricks I like to use to accomplish more productive reading.

Ebooks

Regardless of whether you prefer print or digital books load up a few and download them to your phone. I know this sounds obvious but instead of looking at Instagram or Twitter when waiting in a queue or dare I say sitting on a toilet (don’t lie to yourself we all do it) open up a book and read a page or two. Here are some other quick read ideas to get more reading in when you’re alone and not ignoring friends and family.

  • Read while eating a meal
  • Read while drinking
  • Read a page before checking social media every damn time.

Print

I like to set a minimum limit on reading such as 20 minutes or until the end of the chapter. I suggest a manageable and practical goal. If you want to read a whole book every day go for it but be realistic.

Kidding aside, don’t bring printed books into the restroom unless they stay there. That just not right.

Sort Archive Posts Alphabetically

I recently worked on a documentation project that required posts to be sorted alphabetically by title. The process can be done by using pre_get_posts() and the is_archive() conditional tag.

/*
 * Order post archives by title in descending order
 */
add_action( 'pre_get_posts', 'jd_archive_sort_alpha_title'); 

function jd_archive_sort_alpha_title($query){

	if(is_archive()) {

		// Set the order to ascending order
		$query->set( 'order', 'ASC' );

		// set the orderby to title
		$query->set( 'orderby', 'title' );

	}

};

As always if you want to use this plugin on your website test it first in a safe environment to verify that it doesn’t create a conflict. Happy hacking. 🙂