Hugo is a great static site generator. It is crazy fast and has tons of options, but one thing I had not been able to discover was how to use variable data in make, my build tool, and pass it to a Hugo template. I wanted a way to create unique CSS filenames, and use those filenames in my Hugo templates.
Go has a robust JSON library for consuming and outputting JSON. The standard json.Marshal() and json.Unmarshal() functions do a great job of aligning primitive types and converting them from Go into JSON, and vise versa. Beyond the basic types you will have to create custom marshaling methods on your types and write some logic to handle the conversion process. We will go over writing these custom methods for types that contain time and URL data.Continue Reading►
The most frustrating part of the Everyday Messenger is that it is damn near perfect; not quite, but almost. The unique locking latch, a thoughtful strap, and quality construction make this bag a great everyday carry. The Everyday Messenger is intended to be a photographers bag; with the main compartment set to house a camera and extra lenses. The bag is intended for carrying camera gear, but remove the padded dividers and it works for a laptop and “office” stuff.Continue Reading►
Sometimes I want a quick way to build some web pages. A way that does not require installing a lot of servers locally, but is still better than opening the file directly in my web browser. When I start a new web project I break it up into small steps. These steps form a natural set of milestones, and helps me to reason about the project as a whole. Focusing on each step helps me make progress on the entire project.Continue Reading►
With most variables in Go we can declared them in a couple of different ways. Using the var keyword, initialize them as we declare them with the := operator; or using the new or make keywords. Most variables can be declared with var, which only reserves storage for a named variable. If no assignment accompanies the statement, the variable is set to it’s zero value. Using var to declare a channel crates a nil channel.Continue Reading►