Skip to content
Permalink
Browse files

move posts to the root of the URL path

  • Loading branch information...
samsalisbury committed Jul 4, 2019
1 parent adb498e commit be3831a202f30309e7c4074c96d0f40e46935f4d
@@ -8,6 +8,9 @@ Paginate = 10
enableRobotsTXT = true
enableGitInfo = true

[permalinks]
posts = /:filename

[params.rss]
includeContent = true
authorName = "Sam Salisbury"
@@ -1,6 +1,10 @@
---
title: "Hello World"
date: 2019-03-03T09:48:12Z
tags:
- meta
aliases:
- /posts/hello-world/
---

Hello world, welcome to fieldnotes.tech!
@@ -5,6 +5,8 @@ tags:
- make
- pragmatism
- bash
aliases:
- /posts/how-to-shell-for-compatible-makefiles/
---

The upshot is if you care about maximum compatibility with different versions of GNU Make,
@@ -5,6 +5,8 @@ tags:
- hugo
- make
- meta
aliases:
- /posts/hugo-makefile/
---

This blog is hosted on [GitHub Pages](https://pages.github.com)
@@ -5,6 +5,8 @@ tags:
- nitpick
- readability
- bash
aliases:
- /posts/yes-no-boolean-env-vars/
---

I use `YES` and `NO` in environment variables to store Boolean values. I have come to the conclusion that this is in some way optimal after trying all the other obvious options and finding that each has readability flaws:
@@ -26,4 +28,4 @@ fi

Completely ignoring the potential `NO` value, treating anything that's not `YES` as false. Coupling this with default false values for options dictated by env vars usually makes this safe. If you really need a decision to have been made (i.e. it is not safe to default to false) then you might want to fail if it's not set explicitly to `YES` or `NO`.

So, after many years of writing and maintaining software, I have come to the firm belief that environment variables indicating the Boolean True or False should be stored in environment variables as `YES` or `NO` respectively. This simply sidesteps many potential readability and usability downsides with the other methods. You can be as strict as you like with casing, or ignoring/handling malformed values, but default to YES/NO and stop confusing yourself and others. (Well, me anyway.)
So, after many years of writing and maintaining software, I have come to the firm belief that environment variables indicating the Boolean True or False should be stored in environment variables as `YES` or `NO` respectively. This simply sidesteps many potential readability and usability downsides with the other methods. You can be as strict as you like with casing, or ignoring/handling malformed values, but default to YES/NO and stop confusing yourself and others. (Well, me anyway.)

0 comments on commit be3831a

Please sign in to comment.
You can’t perform that action at this time.