DC

Personal blog with GatsbyJS

  • Created: 2020-June-01 2020-June-01
  • Reading time: 2 minutes 2 minutes
Tags: blogging

Now, this is a game changer. The old blog is obsolete, long live the new one! After some time working with JavaScript it was time to move on from some old learned things (I look at you PHP, even if I still love you, we must move on).

What’s new? Only the backend changed: now the blog runs on Gatsby.JS as a static page.

This is part of the JAMstack you can read on the web about it.

Reasons to switch

From PHP to JavaScript?

Now some ProcessWire evangelists might burn me with their eyes, for whatever reasons I did that (telling the truth: the PW community is a bunch of nice people, hopefully this will not happen).

The reasons:

  • Because I can
  • I am working mainly as a frontend developer with React.JS
  • I need to learn more about GraphQL and React.JS
  • No need for a database API

There was the possibility to use ProcessWire as the content delivery source. Sure, and maybe I do that. There is one thing I am not able to do right now with it: use React Components in posts with preview. That is why I develop and write content directly in the code base and not in a database.

Content writing

I write content right now in Markdown files and these are converted to HTML code.

How does this work? This is based on a git flow:

  1. Create a new git branch from master branch
  2. Create content as md/mdx file
  3. Push change to git branch
  4. Check content on branch deployed in netlify automatically
  5. Merge content to master
  6. Netlify deploys master branch to production environment automatically

Done. Now I have the content history inside the git history rather than a database layer. No need for additional plugins or other layers that disturb me. If my PC crashes? - fml.

With this I can take the static sites wherever I want, and it runs without PHP or other backends. What I need now is only a web server, or more like only a domain, because hosting is done over netlify.

What tools do I need now?

Simply:

  • Visual Studio Code (or any other IDE/editor)
  • Git repository (local/online)
  • Node.JS + Gatsby.JS
  • Huge amount of file space for node packages
  • netlify for static file deployment
  • domain

And what is missing?

  • PHP
  • Apache/nginx Webserver
  • webhoster for files (not true, as netlify is hosting it)

What happens to ProcessWire?

Nothing, it do some stuff because I need some backend for other things. It stays in the back until some projects need some API of some sort. But even then I try to learn about microservices… I’ll give it a long rest for now.

© Damian Cyrus - All rights preserved