$ ❯ CrowderSoup

A website about programming, technology, and life.

front-end

Basics Plus: A new Hugo Theme

by Aaron Crowder on in Site Updates

This site has had a couple new themes lately, but I’ve finally settled on one: Basics Plus. This is actually a theme that I’ve forked from Basics. It’s a fairly simple and paired down theme. I forked it so that I could change a couple things: The top menu (more dynamic, able to add more items) Add Disqus comments The byline These are some fairly small feature changes. I plan to make more changes / refinements going forward while keeping the clean / simple look and feel.

Read more...

New Theme!

by Aaron Crowder on in Site Updates

I recently started using Pelican static site generator for this blog. I was drawn to it for a few reasons: It uses Jinja2 for templates, which I love. It written in python It reminds me a lot of Flask (this might be because of using Jinja2…) I’ve done a few interesting things with this site though. I’m hosting the repo that contains the source content, configuration, etc. on Gitlab.

Read more...

Using vh with calc In CSS

by Aaron Crowder on in CSS

I often have need to build layout’s that vary depending on the content put in them. I can’t always count on that content being the same (cough CMSs cough). It’s just one of those things you have to do. One thing I’m having to do a lot though, is making the body of a page take up a certain amount of space so that the footer doesn’t look weird. In the past I’ve used JavaScript to make the footer take up the remaining space on the page if the content didn’t take up enough.

Read more...

Managing Scope Using Call, Apply, and Bind

by Aaron Crowder on in JavaScript

Call Calls a function, with the specified arguments passed in The first argument becomes this, the rest are passed in as regular arguments. Using call allows you to maintain the scope of this accross methods. It works like this: Here we’re using prototypical inheritance to allow us to inheirit properties from Animal in Dog and Cat. Using call allows us to invoke Animal to initialize it’s properties while maintaining the correct scope.

Read more...

JavaScript: Array's with named Properties

by Aaron Crowder on in JavaScript

Adding named properties to arrays in JavaScript can be handy in a few different cases. For instance: You need a nice formatted title / description for a data set. Rather than having multiple objects you can use named properties and get away with only using one. You want to add some functions to an array for whatever reason Lots of other reasons that I can’t think of right now! Basically, this just buys you a nice way to encapsulate all the data you might need, without having to use an object with a nested array, or multiple objects.

Read more...