--- title: "Fighting the web obesity crisis using Hugo and Skeleton CSS" date: 2023-02-12T12:45:48-05:00 toc: true topics: ["css","web design","hugo", 'self-host'] --- Now that I've graduated from my PhD, I find that I have more free time that was previously spent working on my dissertation. I also have the desire to continue to publish in some manner. My solution to both of these problems is to revamp my previous website which I only used as a portfolio site for job search purposes into a random blog. In my time online I once came across a talk titled [The Website Obesity Crisis](https://webdirections.org/blog/the-website-obesity-crisis/). Since I'm already obsessed with minimalist systems, obligatory "I use [Artix Linux](https://artixlinux.org) and run [dwm](https://dwm.suckless.org/)," I internalized everything immediately and searched for the best way to design a modern and actually minimalist website (both design and size). I decided to try and serve a website which followed the design paradigm of the web pyramid graphic shown below: {{< figure src="/img/the_web_pyramid.jpg" width="100%" caption="The ideal design for any website, [source](https://idlewords.com/talks/website_obesity.htm)" >}} I found that using [Hugo](https://gohugo.io) combined with the [Skeleton CSS boilerplate](http://getskeleton.com/) was the solution to a modern, minimalist, and "responsive" website. **Read on to learn how I did it!** ## Website design paradigm The rest of this article describes the different components and how I've adjusted them to suit my purposes. There exist a [plethora of themes](https://themes.gohugo.io/) with complex Hugo shortcodes that allow easy customization from the config files. My personal site's Hugo theme does not bother with attempting to offer endless customization options. Instead, if you want to use this theme you should be ready to adjust the CSS files and the Hugo HTML templates. With that in mind let's get started. ## Skeleton CSS The most important component of this site is [Skeleton CSS](http://getskeleton.com), which is a simple CSS boilerplate that serves as the foundation of my site. Detailed documentation can be found at the link previously mentioned but I'll describe the layout succinctly. The fundamental container that everything should go into is `
{{ dateFormat "Jan 2, 2006" .Date }}
{{.Summary }}
{{end}} ``` You will notice that the important part is the range statement which selects only pages with `Type "posts"` and selects the first five of them. The rest of the code pulls out the various frontmatter of the post being display. I like to show the date of the post as well as a brief summary. ### 2. Tagging The full guide to taxonomies is [on the Hugo site](https://gohugo.io/templates/taxonomy-templates/). I use two types of taxonomies that I define in my config.yaml: ``` taxonomies: tag: "tags" topic: "topics" ``` The format for a taxonomy is that you have to specify the taxonomy as the key and the plural of the taxonomy as the value. I use the `tags` taxonomy for organizing my recipes and the `topics` taxonomy to organize my posts. You can list all values for a specific taxonomy in the list page by including the following code in your `list.html` for the specific topic. Each value for the taxonomy will link to a page that lists all post with that specific value. The example below lists the `topics` taxonomy for my posts, so this is included in `list.html` at `themes/personal/layout/posts/list.html`: ``` {{ range .Site.Taxonomies.topics }} {{ .Page.Title }} {{ .Count }} ยท {{ end }} ``` ### 3. Table of Contents This is another neat little feature that I really enjoy from Hugo. First, I always use `##` to denote section headings while `#` is used only for the page title. To ensure the Hugo table of contents captures the hierarchy correctly, I set the following code in my `config.yaml`: ``` markup: tableOfContents: startLevel: 2 ``` The table of contents command creates a `