↓ Skip to main content

Cloudflare-Pages

How to Develop Locally in Drupal and Host Static Files on your Website

Background # Say you have an old website on Drupal 7 with plugins that don’t work with the latest versions of Drupal. You now cannot migrate over to Drupal 9 or 10 without doing a lot of manual work and/or losing the functionality of your current plugins. If your requirements are still fulfilled by the old Drupal 7 website, there’s a solution to keep using it.

Install Hugo on FreeBSD, commit to Github and deploy to Cloudflare pages

Prerequisites # Install PHP Install nginx Install Hugo # pkg install gohugo (install as root or do sudo) follow this after install - https://web.archive.org/web/20231202094641/https://developers.cloudflare.com/pages/framework-guides/deploy-a-hugo-site/ remember to remove hugo.toml from the root directory otherwise you’ll get a “not Found” error! Tip # Install the GUI (maybe xfce or Kde5) so you edit md files, update them on the fly. Copy pasting and updating is easier with the gui and the terminal available. Refer to Hugo Cheatsheat if you need instructions to create the new site. If you start getting weird errors from Git, just create a new hugo site, copy your contents and config.toml and follow instructions again. IMO Github has a lot to be done before it becomes user friendly. I’ll write about it separately someday. 🌶️

Create static website from Drupal 7 and deploy into Cloudflare Pages

To extract a static website from Drupal 7.x so it can be hosted on Cloudflare Pages, follow the instructions below: Install plugin “Static Generator” from (www.drupal.org/project/static) Run it. All static files will be created under “static” folder in the root of your Drupal Installation after you complete initial setup. Create a new Github repo, upload all files to Github and deploy into Cloudflare. Your website will be live in the URL you set up during deployment. If you do not know git, use “Git Desktop”, load all the files, and sync it up. As soon as the sync is complete, if you’ve set up Cloudflare pages to autodeploy (default mode), your site will be deployed in Cloudflare near instantly.