CAIN HILL
Home Blog About
Download My CV
Published using Google Docs
off-topic/using-google-docs-as-website-backend
Updated automatically every 5 minutes

Using Google Docs as a website backend

An overview of the technology that I use to build my website

Summary

In this article, I’m going to share the technique that I use to build this website. My technique uses Python code to transform a collection of Google Docs into static HTML/CSS that can be easily uploaded to GitHub/Netlify. This approach may seem unconventional, but I’m happy to say that it has felt much better than using traditional CMS tools and it makes this website run faster for less money with easier maintenance. I’ll detail how the approach works step-by-step, as well as the objective, my approach, a code explanation, some of the conventions I’ve used, and some final wrap-up thoughts.

My Objectives

What I wanted:

✅ Static website with fast page load times

✅ Easy to maintain and update

✅ Secure and reliable

✅ Reduce or eliminate website hosting costs

What I did not want:

❌ Self-hosted solutions that would need unending upkeep

❌ Complicated database backends

The Solution

As in the following graphic, I have a cron job that triggers my Python script at 12AM every night. The script downloads a specific starting Google Doc and any other Google Doc recursively that may be linked to it. The script then strips out any Google Doc formatting or content that I don’t need for the site and mixes in the header.html containing the site navigation. Then outputs a collection of static HTML files and commits this to GitHub/Netlify for free hosting.

My Process

I knew that I wanted to use Google Docs to store all of the actual website content because it is free to use and easy to update from any of my devices. I designated a special folder on my Google Drive to keep all of the Google Docs together. Then proceeded to make one Google Doc for each web page that I wanted.

Google Doc Naming and Formatting Conventions

The following Google Doc naming and formatting conventions are required to help the code work:

Conclusion

In conclusion, using Google Docs as a website backend has been a smart and cost-effective choice. By combining Google Docs with Python, Github, Netlify, and cron, I've built a website that's easy to manage, secure, and dependable.

One big advantage is cutting down hosting and subscription costs, which can be quite high with some website companies. This method has allowed me to save money and have full control over my website's content and structure.

However, it's important to note that this approach might not be suitable for everyone. It requires some technical know-how with tools like Python, Github, and cron. Also, following specific Google Doc naming and formatting rules might take a bit of learning. Results can vary based on skills and needs.

In short, my experience highlights the power of creative problem-solving in website development. Bringing together different tools has led to a practical and resourceful system. As technology keeps advancing, trying out new and effective methods can lead to great outcomes and financial freedom from traditional costs.