Welcome to the new blog engine
A few days ago, I released the new version of the blog engine.
Original development of the blog engine started in the beginning of 2014. Back then, I was publishing my articles in a form of a static website. I was convinced that I need to move to something more dynamic, but among the existing blog engines, none was nice enough for me to want to use it. So I came with a natural idea of drafting my own blog engine, which I kept updating on regular basis for five years.
In 2019, I decided that it's time to make some radical changes: I wanted a better experience for the readers, and I also wanted to explore an idea I had for some time in terms of the user experience when it comes to editing the articles. The big change didn't went well, and as a result, the blog wasn't updated for the following two years. But it's over now.
Changes for the readers
The new engine contains a lot of small changes in order for the articles to look exactly as I want any article of any blog to look if I have to read it.
Figure 1 The old layout.
Figure 2 The new layout.
One of the changes is naturally the choice for a new font. The older version was using a popular sans-serif font, which is great for applications in general—and I'm relying on the same font in most of my web applications—but when it comes to reading large chunks of text, nothing beats serif fonts. Serif fonts didn't perform well ten years ago, with low-resolution screens. Things changed since then. Now, most visitors have displays with an excellent resolution, some exceeding 300 ppi, and technologies such as Microsoft's ClearType also help making sure the text is rendered perfectly. Since I wanted to provide to the readers an experience which would be close enough to reading a book, serif fonts appeared a good alternative, and among them, Spectral was looking exactly like what I expect for a high-quality book. Did you notice how nice is the italic text?
Another noticeable change is the introduction of hyphenation. It relies both on the hyphen library, which determines where a hyphen may be used in a word, and on the support by most browsers of text formatting with hyphenation. The support wasn't granted two years ago, so I'm happy that it's all good now, as this is an important enhancement.
In terms of the page layout, the left panel listing the other articles was removed. The useful links are now at the bottom of an article. Since it frees the space on the sides of the article, on large monitors, the text reflows in two columns.
I kept in focus that the articles should look nice on any device, and especially when printed. This was always my emphasis, and it still is. If you print an article, you get a nice, clean layout with nothing wasting the ink. If you view it on a small tablet or a smartphone, all secondary elements move away, ensuring the article itself can use all the space.
Most blogs use syntax highlighting for code blocks:
const groupBy = (elements, key) => Object.fromEntries(elements.map(x => [x[key], x]));
const displayDate = value => moment(value).format('MMMM D, YYYY');
const isAuthorOf = (user, revision) => revision.authors.includes(user._id);
What other blog engines don't do is to use syntax highlighting inside the inline snippets: const r = x.format('MMMM D, YYYY');
I'm convinced that this would enhance even more the readability of the small chunks of code that I put here and there in my articles.
One funny thing which affected a bunch of users was the login feature. The previous blog engine has a “Login” link, the small text beneath it telling “Authors & owners.” Some readers thought, however, that once they login, they will be able to write comments, without knowing that this feature was never available. They logged in, and were disappointed. More worrisome is the fact that their personal information, the one provided by Google's OAuth 2, was stored in the database, but this was absolutely unclear for the users, and they had no choice to remove this information later. The new engine redesigned the process. Instead of being logged in directly, a newcomer goes to a page explaining what would happen if he logs in, and what's the exact purpose of the thing. It belongs to the user, then, to either accept and continue, or to come back to the original page. In the future, I'll also add a page which would list to a user all the information that the blog engine stores about him, and a page which would allow to remove all his personal information.
Changes for the authors
The way I write the articles was radically redesigned. When writing an article, it is important to see how the article is shown to a reader. As I write on a PC, I don't necessarily know whether the article would look correctly or not at the moment of writing. If I want to double-check on my smartphone, I have to either publish it first, or save a draft, login from my smartphone, and then go edit the article in order for it to generate a preview. Even worse, when typing an article, the previews were generated on the front-end, and there is always a risk of having small discrepancies creeping in.
With the new version, any change to an article is reflected automatically on any device. Every time I type something, I see the change live, would it be on the same PC in a different browser window, or on a different device. The rendering is now performed by the server, meaning that there are no discrepancies possible.
One major flaw of the previous blog engine was that if I closed the browser window without saving the changes, those changes would have been lost. Although I never lost any change this way, the risk was still there. With the new blog engine, there is no risk of losing the changes any longer: I can close the window, and reopen it to find the article in the exact same state I left it.
As an administrator, I also get more actions on other users. One of the weird things in the previous blog engine was that anyone who logs in could write an article. I would have liked to say that this is not a bug, but a feature, but the fact is, I didn't think at all about this aspect when creating the original engine, and was surprised to discover one day an article written by a person I don't know personally. With the new engine, this is not possible any longer: while anyone can register, only an administrator can grant author permissions to a user.