Feb 2, 2023

Previous

lpubsppop01's site

I restored and modified the blog feature of this site that was provided in the base implementation. I plan to write a development diary.

If I decide the title every time, I don't think I can continue, so I tentatively adapted /blog/YYYY/MM/DD for the routes instead of the original /posts/TITLE.

I implemented recursive directory traversal to retrieve blog posts. It seems there are different ways depending on the API used. fs has one readdirSync() and two readdir(). I adapted to use fsPromises.readdir(path[, options]).

I learned how to write a function that returns an async generator and how to convert it to an array.

I used jest to write the unit tests. I've probably used it before, but I forgot most of it, so I checked how to use it. VS code extension Jest looks nice.

I checked the difference between "content" and "contents". It seems that "contents" is suitable for data of file.

Auto Time Stamp

The Gitpod extension search results don't seems to contain vscode-auto-timestamp. I couldn't find the cause. Instead of marketplace, it can be installed by specifying url, but the artifact of the last build on AppVeyor was already deleted. I knew that is better to change to upload to other storage, but deferred it and re-built.