Migrate to static CMS
I have been using WordPress for many years, and I am satisfied with it. Unfortunately, after I moved the hosting to Azure App service I encountered many recurring challenges:
- Lost assets (images, videos)
I still do not understand why due to unknown circumstances, I images/videos are deleted from wp-content/uploads. Initially I think I do not upload properly, hence I re-upload. After few days, the images/video suddenly disappear from the post. The full count of the problem only identified when I tried to backup the whole site folder. All images/video from mid 2018 were unknowingly deleted.
- WordPress upgrade always reverted
This is another challenge that WordPress upgrade always reverted to the original version. I always upgrade the WordPress and plugins on time, however few days after upgrade process completed - I notice that the same warning the WordPress needs an upgrade.
Coming from developer background, I am looking for the historical changes in my files, the version history. However, the version history in WordPress does not include storing history for all assets. The assets are stored in wp-content/uploads file, while the posts are stored in MySQL database. So I left with no option, with broken images in many of my posts.
Keep back-up and be aware of any anomalies when moving application from one hosting to another.
I need to find a CMS that backed-up by a solid versioning system, so that it tracks the version history of everything in the post (text, images, video). I don’t want to have another situation in the future, where my post lost its assets (images, videos) and I left without any option to restore.
Git backed CMS
CMS such as WordPress provides an easy way to manage our content such as blog, portfolio etc. The tool provides web editing, theming, taxonomies (tags, categories) to the post. Git on the other hand was never meant for CMS, it provides source versioning control and keeps track any changes (especially to non binaries file).
Since Git does not provide editing, theming and taxonomies, we need to find tools/framework that will convert a post to a nice web page. There are many available freely such as Hugo, Vuepress, Jekyll etc. I choose Hugo since it has large supporter and lot of themes available. Initially I want to use Vuepress since I am also fan of VueJs, however I want to focus on content and not creating themes. The large collection of themes in Hugo gives me a good head start.
Hugo requires posting in markdown (*.md) format , yet another language format. It is not so complicated compared to HTML, but I can not upload and attach images or link easily in the post. In Wordpress, I can click upload media and insert it into a paragraph. I need to use a front-end editor that allow me to create a post, upload media and insert it to paragraph using web editor. Many options available online and after some research, I decided to use Forestry.io.
And if you curious how it looks like, see following image. I drag and drop the image to Forestry.io just as if I use WordPress. The media and text are now tracked by Git, an industry proven versioning system, and I can be sure that all my post’s images are properly tracked and versioned.