ScottLogic / blog

The Scott Logic blog
http://blog.scottlogic.com
Other
9 stars 85 forks source link

Linting only runs on two files! #253

Open chriswilty opened 1 week ago

chriswilty commented 1 week ago

Whoops:

image

Turns out we are linting just two posts, because the glob pattern in lintPosts.js is this: "*/_posts/**/*.{md,html}"

The pattern should be "_posts/**/*.{md,markdown,html}"

And with that, predictably, we see a colossal amount of errors! However, all is not lost:

chriswilty commented 1 week ago

If we reinstate linting, I believe we can drop the restiction on having a single category. Our current rendering logic chooses the first category as the "primary" for the post header, but the post is actually visible under all given categories, which can make it easier to find when searching for a post from way back, so I believe that is a good thing.

We will still need at least one category, and we should also check that all given categories are valid names from _data/categories.yml.

We should run this as a github workflow.

chriswilty commented 1 week ago

Note that an alternative to multiple categories would be #197 to provide a keyword search.

ColinEberhardt commented 1 week ago

I have no objection to posts being in more than one category, as long as this is done sparingly! otherwise, this just becomes a form of tagging, as per the issue referenced above!

chriswilty commented 1 week ago

I have no objection to posts being in more than one category, as long as this is done sparingly! otherwise, this just becomes a form of tagging, as per the issue referenced above!

Very true! We could of course set a limit on number of categories, and fail the build if folks are abusing the system. But just occasionally, it's difficult to choose between two different categories.