ScottLogic / blog

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

Linting only runs on two files! #253

Open chriswilty opened 1 month ago

chriswilty commented 1 month 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 month 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 month ago

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

ColinEberhardt commented 1 month 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 month 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.

dogle-scottlogic commented 5 days ago

Opened a PR to look at this - it's a bit big 😬 https://github.com/ScottLogic/blog/pull/274 Couple of bits to note: