How to Build a Hugo Site

hugo logo

Image Source

When I decided to build a new website, I knew that I wanted to use a static site generator that could take in Markdown, and spit out HTML. I tried a handful of different options, none of which worked out of the box as advertised. Some were very difficult to install, some would crash when running, some would generate something, but not enough to really get going, and the documentation across the various options was all over the spectrum. Then, I found Hugo.

I used homebrew to install it, but since it’s written in Go Lang, it is pretty simple to run. The other nice thing that it does for you is to generate a very basic structure, where it is very obvious where the content lives, and you’re one command from running a dev server.

The following instructions are from the Hugo Quickstart Guide.

To install with homebrew (on a Mac):

brew install hugo

To create a new site:

mkdir new_site
cd new_site
hugo new site .

To create your first page:

hugo new about.md

The above post will live in ./content/about.md, and will be accessible at http://my_site.com/about.

Or, to create a post in a subdirectory:

hugo new post/first.md

The above post will live in ./content/post/first.md, and will be accessible at http://my_site.com/post/first.

Install all the themes:

git clone --recursive https://github.com/spf13/hugoThemes themes

Run the dev server:

hugo server --theme=hyde --buildDrafts

Now, all of your static content has been generated in the ./public directory. You can copy the URL printed out into your browser to view the site.

If all you want to do is rebuild the site with new content (to be published to production):

hugo -t hyde

I don’t like committing the ./public directory to git, so I added the following lines to my .gitignore:

public
public/*

This way, on your production server, you can pull changes from the source, and run the hugo command to generate the new public content.

From there, you can play with trying out different themes, and once you pick a theme, hacking on the HTML/CSS in the theme to customize it to exactly what you want.

Update

Here’s a link to the source for this particular site.

Ads

As an experiment, I’ve decided to try out a couple of ad services, Google’s AdSense, and Amazon’s affiliate links. I don’t expect to make much at all from these, but I would like to poke around with them and see how they work. If ads on websites bother you, please read on.

privacy badger logo

Last week, the EFF announced a new browser extension called Privacy Badger. The idea is that while websites should be able to monetize through advertisement, the ad networks should not be able to track you all over the web without your knowledge and approval. This seems pretty reasonable to me.

Here’s how it works:

As you browse the Web, Privacy Badger looks at any third party domains that are loaded on a given site and determines whether or not they appear to be tracking you (e.g. by setting cookies that could be used for tracking, or fingerprinting your browser). If the same third party domain appears to be tracking you on three or more different websites, Privacy Badger will conclude that the third party domain is a tracker and block future connections to it.

For certain websites, if Privacy Badger were to block an embedded domain entirely it would break the site’s core functionality. For example, if Privacy Badger were to block ’licensebuttons.net,’ Creative Commons buttons would no longer load. In these cases Privacy Badger blocks the domain from setting or receiving any cookies or ‘referer’ headers, but allows the embedded content to load.

I’ve been using it since it was announced, and it seems to work as advertised.

Capellini with Meat Sauce

capellini with meat sauce

Tonight, I decided to go with a fairly simple pasta. The noodles are capellini, the cheese is pecorino romano, and it’s topped with a home made red sauce.

The sauce was made with:

  • canned whole peeled tomatoes
  • tomato paste
  • fresh garlic
  • fresh basil
  • ground beef
  • shallots
  • mushrooms
  • olive oil

Here’s how I made the sauce:

  1. Dice the shallots, a few cloves of garlic, and a few mushrooms, and put them into a pan with some olive oil.
  2. Cook until the shallots start to turn clear.
  3. Add the ground beef, pulling it apart into small, even chunks, and reduce the heat down to medium.
  4. In a food processor, add the 28oz can of whole peeled tomatoes, 6oz can of tomato paste, 4 cloves of garlic, a few mushrooms, a bit of olive oil, and the fresh basil.
  5. Turn on the food processor, and run until it’s the consistency that you want.
  6. Once the meat is thoroughly cooked, drain the grease, and add the sauce from the food processor.
  7. Cook on medium-low.

Amazon Echo Review

echo in hand

The Echo has definitely grown on me a lot, I have been surprised at how much use I’ve gotten out of it. I’m using it more than I expected to be, and now find myself frustrated with Google’s limited voice actions on other platforms. I’ve had mine since January 2015, and I use it throughout the day. It lives in the kitchen, and it’s primary uses are as follows:

  1. Listening to NPR while I cook
  2. Adding things to the shopping list as I run out of them
  3. Setting timers for cooking and other things
  4. Listening to other podcasts and audiobooks
  5. Listening to Pandora

I do periodically do other things with it as well, but the above represents probably 90% of my usage.

One killer feature for me is that I can play NPR’s Morning Edition and All Things Considered every day. I really love those shows, but don’t have much of a commute to listen to them, so listening while I’m cooking.

echo in box

Voice

Outside of the difficult to pronounce or spell names, the voice recognition is really great. The voice controls are the best that I’ve seen for any product (I regularly use several other voice control devices). This was actually the reason that I bought it, because I wanted to see how it would be to interact with a computer without any input outside of voice. I wanted to know how they would handle the user experience, and I’ve learned a lot. When I’m giving feedback on other voice driven products, my number one advice is usually, “try out the Amazon Echo, they really nail this”.

That said, the voice input isn’t perfect, so the app does get used once in a while. I’ll use the app if I want to listen to a podcast episode that is not the latest, or if I want to play a playlist or pandora station that I can’t remember the name of.

Echo App

The app sucks. It’s an HTML5 web app dumped onto the phone, and I’ve had updates to the Amazon app that have broken the Echo app. The performance is terrible, and it doesn’t seem to remember anything locally. This is particularly frustrating when attempting to use the shopping list at the grocery store where I don’t have a mobile connection. There have been times where the page tried to refresh, and couldn’t load, which meant that I lost access to my shopping list. The searching for podcasts and other media is clunky, and again, does not remember anything.

The app is functional, but poorly done.

Audiobooks

I was thrilled when they added support for Audible. No complaints here.

Podcasts

Podcast support is OK. Attempting to play a podcast by voice will allow you to listen to only the latest episode. It has no notion of podcast episodes listened to, and what’s not been heard yet. It also does not remember the podcasts that you listen to in general. It doesn’t autoplay the next in the series. This means that you need to go to the app and search and dig every time, for each episode. I would also appreciate if they opened this up to other providers, or provided some way of keeping in sync with PocketCasts.

Music

As for music, I wish that Spotify were an option. Amazon’s music service is kind of awful, and I’m annoyed that I now have yet another place that I need to spend time managing my music. I’ve already got iTunes, Google Music, and Spotify. Amazon Music is kind of like Google Play Music, but worse in every respect (and I’m not much of a Google Music fan).

Shopping and Todo Lists

The shopping list is a really great feature, and the voice recognition works better than expected. It is incredibly useful, especially since mine is in the kitchen, which is where I typically realize that we’re running out of something that we need to buy more of. And, since it’s always there, when I use the last onion, or the last battery, I can just tell Alexa, and not need to try to remember all at once when I’m making a list.

That said, the app is a limiting factor on the usefulness of this feature. With IFTTT support, it helps things a bit, since you can get your data out to another service like Evernote, but it’s not a great solution. I’ve turned this on, and now have a list in Evernote that needs to be managed in addition to the list on the Echo.

There are basically two features that would make shopping lists/todo lists perfect for me. First, is storing the list information locally on my phone, or allowing me to use a different app as the default list store. Second, is support for showing the list on Android Wear, since when I’m shopping, it would is way easier to check things off from my watch than my phone.

Interoperability and Ecosystem

The ecosystem is very limited and tightly controlled right now. I think that there’s a ton of potential if they open this up. If they don’t, I have a feeling that the more interesting features will be quickly eclipsed by Android and iOS offerings, while my Echo will be relegated to being a smart radio (or replaced altogether with an audio-only Chromecast setup). I would also love to see native apps running on the Echo.

Final Thoughts

While I do have some gripes, overall, I am very happy with the Echo. It’s a great showcase for how to do voice interaction really well, and I have found it quite useful. I expect that most of my issues will be resolved as the user base for this product grows, and the team has resources to put some effort into polishing up the experience. They’ve been steadily improving things thus far, IFTTT and Audible support are two important examples of major improvements that have come recently.

Update

As an experiment, I’m going to add an Amazon affiliate link here, if you’re interested in checking out the product (since I conveniently forgot to include a link before).

Political Correctness or Treating People With Respect?

There was an article on Vox earlier today that I found very interesting. It was discussing the following tweet:

I posted the above link on Facebook, and got a great response from a friend:

The problem now with “political correctness” is that outrage is apparently the only permissible reaction to slights, real or perceived. We’ve lost all sense of scale and are too quick to pile-on and inflict massive damage in response to minimal slights or things that that ultimately don’t matter to us, our families, or our community.

Take Cecil the lion. It’s a shitty thing, but big game hunting can be important for conservation efforts. But because the lion was a beloved local figure (on the other side of the world) and the hunt was questionable (and I’m not sure of what the dentist knew, it’s possible he was unaware), people in the United States lose their minds. As far as priorities go, the whole thing was bullshit. It’s not news. But the outrage monster must be fed, so here we are.

I’m starting to think Twitter has made society demonstrably more petty, vindictive, and stupid. In 140 characters.

Note: bad shoots and abuse by overzealous or unfit officers are obviously a problem that needs addressing. Hell I’ve handled excessive force cases for both sides. I’m only talking about the new outrage economy we seem to be building and its blind rush to judgment.

Here was my response to him:

I am not so sure. I think that there are times where political correctness goes too far, and I agree about the Cecil the Lion case. Though, I was surprised that the hive-mind successfully picked out the guy who did it, since most of the time it seems they get it completely wrong. However, I’m not sure that that is the general case, and likely the exception more than the rule.

Also, on the Cecil the Lion topic, I had several very level-headed conversations with people. I have not been able to have meaningful conversations with many conservatives on basic economics issues, because they start saying very offensive things about how lazy Millenials, minorities, and poor people are (seriously, this has come up too many times to count). So, instead of being able to make progress in a conversation, we get stuck because they’re being bigoted, and when you call them out on that, they’re the ones getting offended. Whatever, I don’t have time to argue with dumb people.

It seems like Fox News and the GOP have been cultivating a rhetorical lack of respect, and encouraging intellectually dishonest shots across the bow, as opposed to thoughtful, issues based discussions. It seems like Trump is a natural result of such an effort, and I think that they’re getting exactly what they deserve with him.

The reason that I bring up Trump, is that I think that he sort of exemplifies this anti-political correctness campaign, where the basic thrust is that you don’t need to treat people with respect. The Megyn Kelly thing was a great example, where Trump was being extremely disrespectful to her, and played it off has him not wanting to bend over backwards being politically correct. When you look at what he said to her, there is nothing but at attempt to be offensive, no substance at all. This is Trump’s m/o, over and over, be extremely disrespectful offensive, and then take offense at people being offended by the awful things you said.

In general, if people were more politically correct, especially our politicians and news media, perhaps they would have to actually discuss and deal with the issues, as opposed to discounting people wholesale because their group doesn’t count.

What’s more, is it really such a bad thing if we could not be shitty to each other, and treat others as they would like to be treated? Is that a bad goal to have?

I do think that we need to be able to have honest conversations without the fear of getting jumped on by SJWs. And, I think that most of the time, if you’re not being overly offensive, and genuinely trying to understand people, they’ll be forgiving and not give you a hard time about minor screw-ups.

I totally agree that the PC concerns need to be tempered, when they go too far, and that we should be on the look-out for that. But, when they’re not going too far, maybe the notion of PC does some useful work.

As far as Twitter goes, I think that there are some parallels with Reddit. The similarity between them is anonymity, as opposed to a character limit. Giving people a mouthpiece and a mask can have both positive and negative results.

Oh, and I’m not opposed to a lot of conservative ideas. I love to get into discussions where people have a good head on their shoulders, and can actually discuss issues without getting into the weeds. It saddens me that we don’t have more of these sorts of discussions as a society.

Update

Link to Chrome Extension for PC to Treat with Respect

Junior Citizens

Trump Hell Toupée

Image source

A few years ago, I was an independent consultant, doing various programming jobs for a handful of clients. I also was the project manager for a lot of the time, and was responsible for hiring and firing, making sure that people were getting things done, and that we were building quality stuff. Overall, it was a great experience, and I learned a ton.

The rates that I was hiring at were quite low. I didn’t have any control over that part of things, and so we were hiring people at $25/hr, about a quarter (or less) of what a decent engineer should have been able to get. When we did hire somebody, I always wondered why they chose to work for us, at such a low rate. We ended up with a lot of junior engineers, one guy who was scamming us, a couple really solid senior guys who knew what they were doing, and a few misfits. Some of the jobs that we would do were short, quick things that just needed to be pounded out and shipped, but I would say that more of it was longer running things, where we would rotate through two or three developers on a single project.

I noticed something funny that seemed to keep happening over and over. Whenever we had a developer come onto an existing codebase to continue development, their immediate reaction would almost always be, “this is garbage, I have to rewrite it from scratch”. The first time this happened, I was fooled, and I think that I let them go ahead and do it. After that, not so much. However, this kept happening, and it was something that I wondered about for a while.

There were a few possible reasons that someone might want to do that:

  1. They want to make themselves look good, and others look bad. They do this by putting down someone else’s work, and rebuilding the existing piece themselves.
  2. They want more billable hours, so they create tasks for themselves.
  3. They don’t understand what they’re looking at, and it seems easier to them to rewrite the thing from scratch, as opposed to making the effort to deeply understand someone else’s code.

The first two reasons were plausible, but didn’t fit the guys that I was working with. Few of them had big egos, or were insightful enough about politics to try to take this opportunity to make themselves look good. (There was one exception, but that was an obvious one.) There was plenty of work to be done, and no big limits on billable hours, as long as things were getting done. So, there was no reason to create extra work.

I landed on the third option as being the most likely. It is difficult to look at a system that someone else has built, and get to a point of understanding it and all its detail. It’s even harder when that system is incomplete, or has a number of bugs that should be addressed. It is hard when you were not around when it was built, so you might not understand why things are built in the way that they are. It takes time, effort, flexible thinking, and some amount of empathy to do this task well.

However, for all its trouble, if you keep rebuilding the thing every time you hit a bug, or the person doing the work changes, you’ll never move forward, and all of the important details in the spec will never be hammered out. Instead, you will be stuck in this endless cycle of rewrites, where little is accomplished, but that people feel like they’re doing something big and important.

Today, whenever someone comes onto a codebase, and says that it needs to be rebuilt from scratch, if that person is not a junior engineer, it’s a huge red flag for me.

There’s a reddit thread asking Trump supporters why they want to see Trump win. On Google+, +Koushik Dutta has summarized the post with some choice quotes, that I will include below:

I’m seriously thinking about voting for trump, and here is why. I firmly believe that our system of government is deeply flawed, if not completely broken. Yet we still keep voting for the same type of people. If trump wins, there’s a good chance the whole thing will collapse from his absurdity. Then maybe we could start over and build something better that works. A vote for trump is a vote for full system breakdown, which I believe is exactly what we need.

I think we probably deserve it as a people. I think maybe we have to hit rock bottom.

He’s not the president we need, he’s the president we deserve. I’m older than most of you. I remember when politicians worked together sometimes for the greater good. Now, with MSDMC and Faux News controlling the conversation, this country is so divided, nothing gets done. The whole system is what it wasn’t supposed to become. The only way to fix it is if the entire system emplodes so we can start over. That’s what Trump would do.

Because over time our entire political system has become a complete joke. It’s completely based on money. And these are just the popular mantras, but after 30 something years on this planet, I’ve decided they’re true, but for specific reasons. Seriously…how the fuck could Trump be WORSE than the parade of human turds in suits that march into the Capitol and White House every day, every year? He can’t. He can’t possibly. But the sheer fact that he’s universally hated by every one of those lying out of touch idiots makes me want to vote for him as King let alone President. Go Trump

These are people who don’t understand government deeply, and have no interest in doing so. They sit back, and complain about how bad things are, but assume that the only fix is to tear everything down and start over. I find a lot of similarities between the quotes, and the experience that I’ve described of people who don’t fully understand things desiring to rebuild instead of fix.

Perhaps we should refer to Trump supporters as Junior Citizens, for their lack of depth, experience, and understanding.

Kids Who Die, by Langston Hughes

Will the new CEO pay ratio rules by the SEC be effective?

graph of ceo compensation

Image source Wikipedia

I was reading this article in the NY Times today that the SEC just passed a new rule requiring public companies to disclose the ratio of the CEO’s salary compared to that of the average worker. The article covers some of the arguments for and against. Transparency against logistical difficulties for multi-national corporations (where pay may vary wildly). There was also the question of whether or not the shareholders will find the data useful.

One issue that I did not see addressed was the problem with CEO compensation disclosure in general, which is that instead of tending to put downward pressure on executive compensation, it has done the opposite. Since the previous disclosure rules went into effect in the early 1990’s, executive compensation has skyrocketed, increasing faster than it had before. This may seem counterintuitive, until you realize that executives are highly competitive people. When they see that their competitor is offering higher pay, they can pressure their board to increase their salary. When they are approached by another company offering better compensation, they can leave if their current company can’t counter. Since companies need CEOs, and the board is going to want the best CEO they can find, compensation goes up.

I wonder if this new rule will have a different effect, though I can’t honestly think of why it would, when the compensation was already known, against a lot of additional data.

Chained to Notifications

priority phone notifications

Priority mode on stock Android

A while back, there were a few months where I was wearing multiple smart wearables. The wearables were nice, but both of them subscribed to my phone’s notifications. Whenever I got an email, or a text, I would have three things on my body vibrating and making noise. Phone calls were the worst, because they would continuously vibrate and ring until I did something, and I was a little disoriented as to which one to interact with. Texts and emails were probably the worst, especially being subscribed to a couple chatty groups.

I was getting more and more stressed, and anxious. The notifications were not helping me to feel more on top of things, instead they made me feel trapped and forced to be constantly interacting with my devices. I also noticed that I would check my device every 5 minutes anyways, even if I didn’t notice anything coming in, that had just become a habit.

So, I decided to try something, I set my device on “Priority” mode for notifications, where phone calls, alarms, and calendar events were still allowed to make noise and vibrate, but nothing else was.

I figured that since I was checking my phone frequently enough anyways, the extra audio and haptic feedback wasn’t particularly important or useful. That day, I felt a lot better. Not nearly as much stress and anxiety, at least not that my devices were causing me. I could still use the wearables to check my notifications quickly, and they worked great for that. The big difference was that I was in control of when I wanted to interact. I continued the practice through the week, and continued to notice the benefits.

At this point, it’s been almost a year since I started the experiment, and my behavior has shifted a little. I pay even less attention to all the little notifications that are there. I don’t check my phone as frequently when I’m busy, either focused on work, or outside of work socializing with other people. This has turned out to be a really great trick to put me in control of my device usage. I also feel less pressure to respond immediately. If it’s something important, I’m not unreachable, people can always call. I’ve gotten calls from the boss when stuff’s broken, not a huge deal. But all those other little things? They can probably wait.

If you’re habitually checking your phone, I would suggest trying this out, chances are you won’t miss much, and you’ll feel better about it.

Minimum Wage Increase

Jens Rushing posted the following on Facebook recently:

Fast food workers in NY just won a $15/hr wage.

I’m a paramedic. My job requires a broad set of skills: interpersonal, medical, and technical skills, as well as the crucial skill of performing under pressure. I often make decisions on my own, in seconds, under chaotic circumstances, that impact people’s health and lives. I make $15/hr.

And these burger flippers think they deserve as much as me?

Good for them.

Look, if any job is going to take up someone’s life, it deserves a living wage. If a job exists and you have to hire someone to do it, they deserve a living wage. End of story. There’s a lot of talk going around my workplace along the lines of, “These guys with no education and no skills think they deserve as much as us? Fuck those guys.” And elsewhere on FB: “I’m a licensed electrician, I make $13/hr, fuck these burger flippers.”

And that’s exactly what the bosses want! They want us fighting over who has the bigger pile of crumbs so we don’t realize they made off with almost the whole damn cake. Why are you angry about fast food workers making two bucks more an hour when your CEO makes four hundred TIMES what you do? It’s in the bosses’ interests to keep your anger directed downward, at the poor people who are just trying to get by, like you, rather than at the rich assholes who consume almost everything we produce and give next to nothing for it.

My company, as they’re so fond of telling us in boosterist emails, cleared 1.3 billion dollars last year. They expect guys supporting families on 26-27k/year to applaud that. And that’s to say nothing of the techs and janitors and cashiers and bed pushers who make even less than us, but are as absolutely crucial to making a hospital work as the fucking CEO or the neurosurgeons. Can they pay us more? Absolutely. But why would they? No one’s making them.

The workers in NY made them. They fought for and won a living wage. So how incredibly petty and counterproductive is it to fuss that their pile of crumbs is bigger than ours? Put that energy elsewhere. Organize. Fight. Win.

I shared the above not because I thought that it was an amazing argument, but that I’ve heard the other side from people in similar lines of work, and was pretty annoyed at their selfishness, and shortsightedness. Where the argument from them was, why should they get $15/hr, I only make $20/hr and I do X.

I’d like to point out up front, that for the most part, we’re not talking very big companies, but smaller ones, where margins are tight. This isn’t necessarily one of those situations where it’s the greedy fat cats against the little guy, at least for many companies that will be affected by the minimum wage increase in New York.

That said, I’d like to speculate on what I do think will happen. I think that it will cause some small increase in prices, but that it won’t be such an increase that it will nullify the shift in earnings. I also think that it’s likely that wages will go up across the board, at all levels, to compensate for trying to attract talent, where they are now competing with minimum wage jobs. I’ve heard conflicting reports on whether or not minimum wage increases cost jobs. Yes, I’ve seen the reports that experts say they will, but I’ve also seen a meta-analysis that plotted the results of many studies where the net-effect was closer to zero.

For the people that get this doubling of pay, I am hopeful that there is a not so small group of people who are the working poor, trying to raise a family on minimum wage jobs, who will be able to perhaps finally have an opportunity to work themselves out of a situation where they’re constantly on the brink of homelessness, or where one small thing can cause huge, catastrophic issues for them. I’ll explain why this is important below.

The bigger picture, for me, is that this will significantly increase the buying power of the lower and middle classes. Even if we don’t assume that everyone’s wages will increase the same, we might assume that there will at least be enough of a shift for everyone else to offset the increase in cost of goods. With that assumption, now everyone has more money. More people with more money can do amazing things for the economy, in a much more sustainable way than a one time tax refund.

I don’t imagine that Basic Income will be a thing in my lifetime, but I do think that this will, at least in many states. In the long run, I think that we will all benefit from those wage increases.