PortuguΓͺsEnglish
netlify-cms.png
2022.03.19

Netlify CMS

English

I do maintain, for almost 10 years now, a personal journal. A diary. It’s a self psychotherapy. It’s a way to express my thoughts and feelings.

I originally used Google Docs. I created dozens and dozens of files, one for each day. Eventually, I realized that Google was not supposed to be trusted with confidential and personal information. Their spiders crawl and index everything. These thoughts may be still there, even after I delete all the files. Who knows.

Then I migrated to a secondary solution: Wordpress. I hosted a blog and used a add-on to lock it up, allowing just me to see. It’s really good for blogging, with a lot of tools. I designed myself some extra add-ons to manage some aspects of the journal, like a word count and a title generator (based on the post date).

However, maintaining a up-to-date Wordpress installation is critical. Due it’s popularity, and broad usage for e-commerce, Wordpress is a target for many many hackers. I started to think that I could let hacked and let all my stuff exposed. So I decided to export all posts and move once again.

I tried to only maintain it offline, in my computer. It’s, for sure, the most secure way. Anything that is in the internet, even if it’s secured, could be hacked. But sometimes I want to write while away from home. In a trip, for instance.

I looked for a solution that was hosted online, secure (bonus if it was encrypted), and versatile (super bonus if it was open source). I tried some days using SimpleNote then Notion. Notion is very nice and I was using not only to write my journal, but also I started to use it to track some daily routines, like checking weight, sleep time, amount of water that I’ve consumed.

But again I was not very confident about security. So, I’ve exported everything and decided to create host it only in my computer. This time, with a caveat: I was liking the usage of Hugo static site generator, so I designed a blog front end and only enable it locally. And use git to track changes and host at Gitlab. If eventually I’m not in home and want to write, I could find an app to connect to the repository and write. Months passed but I’ve never found a mobile app. So I was locked to just write locally or access the repository using VSCode or whatever.

Finally, the Main Topic

Other day I decided to check Netlify CMS. Created by Netlify hosting service, it tries to create a dynamic admin front end to manage static websites. The result will still be very much static, but the admin section is a single page with a JavaScript that will do everything. It will communicate with a online git repository and commit any new post. The authentication is done thru the git service, Gitlab in my case. It could be Github or any other git service. If the user do not have access to the repository, the admin page will be blank. It reads the source in real time.

Besides that, I could also host the final journal online using Gitlab pages, but settings that only visible to maintainers. The same authentication would be required to see both front end and admin pages. Nice solution.

Netlify CMS is VERY simple. I can only imagine how complex is under the hook, but the final experience for users are simplistic. However, it does the job: I can now access and write my journals from anywhere, including the browser in my phone.

The system relies in a monolithic configuration file that is hosted side by side the content in the git repository. Traversing all the posts from a remote git repository is very slow and not efficient. I cannot imagine dealing with a more complex team structure using it at the same time.

A nice feature is the draft mode: it creates automatically a fork with the draft content. Only when the user click “Release”, it merges the content into the main branch and publish. Netlify CMS does not require Netlify itself, but they are nicely integrated if you decided to use it.

After the successful first experience with my diary, I implemented in my blog. In fact, this very post was written using this pseudo-CMS!

Bruno π•„π”Έπ•Šπ•Šπ”Έ