The new blog

static-blog

My previous blog was created using WordPress. Overall, it was a good experience, but in course of time I understood that it is simply too much for my personal blog because of several reasons.

Pros and cons of the WordPress

WordPress is a great platform for blogging. Initially, I thought that I just need to create a new WordPress blog, choose the theme, and I'm ready to go. In fact, it is not true.

Everything starts from finding the hosting. The free blog version on the official wordpress.com has limited possibilities and contains the platform footer. Thus, it is better to find some cheap hosting where you have full control over the blog.

The next problem is choosing the theme. And most probably, something modern and flexible will be also paid.

After basic things are done, from my experience, the following should be prepaid for the simplest personal blog:

  • regular database and files backup,
  • regular WordPress and plugins update check,
  • anti-spam protection for comments, and security protection for the admin panel,
  • collecting statistics of visits,
  • monitoring of the broken links,
  • SEO-optimization,
  • a possibility to exclude some pages from the search,
  • additional post type for portfolio,
  • syntax highlight for code blocks,
  • optional plugins, for example, to show embedded PDFs, to redirect specific URLs, to generate custom buttons, etc. because out of the box WordPress is not suitable for coding blogs,
  • additionally, a bunch of CSS tweaks to adjust the visual look of the chosen theme.

Overall, it is quite a lot of effort and time. For every missing feature you need to search for a suitable plugin. Every plugin has some limitations, and of course, not everything works like expected.

Considering, that a personal blog usually doesn't have multiple authors (so, the support of roles and permissions is not needed), the content is static (posts are written once, and their content doesn't change), using WordPress feels like shooting birds from the cannon.

What are the alternatives?

There are plenty of static website generators:

The idea is that the website is completely pre-generated and doesn't require any backend and database. Of course, such approach is not suitable for every type of website. But for the personal blog, I think, it is just perfect.

I have tried all listed above and stopped on the NextJS. It is a very simple and convenient modern framework based on React.

NextJS and static rendering

  • Every blog page is implemented as a React component,
  • every blog page has special functions used by the framework during the build to understand what routes are related to this page, and what static content should be prepared for it for every route that it supports,
  • as an output of the build NextJS generates a set of .html and .js files for every possible website route.

Hosting static blog

There are many free options how to host a static website. I have tried two:

  • GitHub Pages - easy and simple, directly on the same service, where most probably, you will store the blog source code.
  • Vercel - very simple as well, from the authors of NextJS.

Comparing to GitHub Pages, Vercel provides the route redirection that is very convenient to use short links based on the blog domain name. It also integrates with GitHub repository in a few clicks. That's was my choice.

Writing blog posts

The idea behind the static blog is having every blog post as a markdown .md file with YAML metadata on top. It can be stored on GitHub or any other VCS that is very convenient.

Editing of markdown is simple, fast and supported by all popular editors (including VS Code) and VCS services directly on their websites.

During the project build, the .md files are converted into pre-generated pages, the lists of tags and categories are updated.

The static blog comparing to WordPress

  • Hosting is free of charge,
  • backup is not needed as the content and website source is stored in VCS,
  • there is no admin panel to break-in,
  • the website looks exactly how you want, every part can be changed, including how the markdown content is rendered,
  • the development of the blog requires knowledge and effort as well, however possibilities are almost limitless.

Missing features

Some features of WordPress are simply not possible in form of a static website. Here is my list of free external tools:

  • Google Analytics to see the visits statistics. From my opinion, it is a much better option comparing to the native one from WordPress.
  • Google Search Console to configure website visibility and quality in Google.
  • Lyket provides a possibility to include a Like button on the website pages, and displays the statistics.
  • Seobility to optimize the website in terms of SEO.
  • Dr. Link Check to validate all links used on the website.

Summary

From my perspective, the approach with static websites generator is much more flexible and convenient for having a personal blog, or, for example, a website with documentation.

The backbone of my own blog is available at GitHub. Feel free to use it and leave feedback.