Remembering How to Update My Website

It seems like an age since I last wrote my first article for my website. I'd researched and experimented with Docker for quite a while before reevaluating my approach and then doing it this way. That was fun but then there was a lot of domain work to do, and then a last push to get some content online. The mission really was to write my first website article and then forget about it for a bit. After that I decided to I wanted to go back into education so I'm currently studying some courses that are of a high-level and are intensive. I do other things as well and I could go on, but as it's 3:13 am I would prefer to finish this article. I feel as though my studying is going well so to reward myself I though I'd write up my analysis of some IT hardware and some upgrades I was going to make. Nothing too major but I thought someone may enjoy following along with my logic as I explored different options. When I said earlier "forget about it for a bit" I knew I'd have to spend a few minutes reverse engineering how I did the website upload!  It's not hard but I thought I'd spend a bit longer and run through that process and produce this documentation, which I absolutely would have done before now if IT was my job. It'd also be nice to have some documentation in place to remind me until I can get around to doing the upload workflow "properly".

One of the reasons I have this website is so that I can start to store some of my documentation on there, this article will be my first. A good reason for hosting documentation on a website or an Intranet is that it's easy to use the power of HTML to link between documents. Because the way I upload my website is wrong I can update this document by linking back to it from another document which describes the correct procedure.

There are many other reasons why I wanted a website and I will write those up one day.

A Simple Test and an Improvement

I wanted to remove the double-spacing after the full stops in the first article I wrote: "Making a Second Version of this Website". After uploading my first article I noticed that the browsers word wrap seemed to get confused by the double-spacing, I think that this was more noticeable on a mobile phone's screen. Double-spacing after a full stop was once-upon-a-time a typing gold-standard but alas no more.

Publii supports the shortcut CTRL-F which is the shortcut for Find in other applications but in Publii it serves as a CTRL-H for Find And Replace. It was unusual enough for me to have to do a Google Search when I hit CTRL-H and nothing happened and I couldn't find any obvious icons to do the same function. CTRL-F in Publii brings up a Find and Replace dialogue box. After figuring that out I searched for a full stop and two spaces and replaced them with full stop and one space. 

Publii AppImage

Publii is installed as an AppImage. This was a good option at the time whilst I was evaluating the software. Thinking about it, a disadvantage of an independent AppImages is that it won't update when the Ubuntu's Software Updater runs. Publii has notifications when there is an update available which you can then Download from within the AppImage.

The Publii AppImage called "Publii.AppImage" lives in Downloads.

Publii Output Directory

In Server section of Publii the Output directory is /home/andrew/Downloads/my-website2. Inside that directory is an information-industries-files directory.

Dumped in Downloads there are several other directories. I'll need to find out what these for and if they are useful where they should be stored:

  • my-website
  • versionofwebsite
  • test_an_older_version_of_website
  • simple_3.3.0.0

Publii AppImage's "Internal Files"

In Documents is a Publii directory which must contain the AppImage's working files, it contains a backup tar file.

There are several websites in /home/andrew/Documents/Publii/sites and you can switch to the same set of websites within Publii's interface, so that with the backup file means it's a good bet this is the location Publii uses as its working directory. There are a few websites listed in there because I was experimenting with the website having its own version control of itself, like its own Wayback Machine and how I could roll-back to an earlier version of the website if I break the website after an upload.

In: /home/andrew/Documents/Publii/sites/information-industries/output there are my news items and article the dates on these didn't change when I saved my spacing update but /home/andrew/Documents/Publii/sites/information-industries/input/db.sqlite was re-stamped with the article's saved date and time. I need to look into this further as a Preview didn't seem to recent-time-stamp any HTML files anywhere that I could see. I have investigated into these directories before when I experimented with hosting versions of my website within the main website itself.

There is also a partially constructed "Workflow" directory in Documents which I've created.

Update Website and Upload

I remember that this process is wrong. I suspect that Publii when set up properly will look at the dates of the files on the website and compare them to local copies and only upload the changed files, reducing upload costs. I currently do a full upload of the website for every little change I make to content:

  1. Run Publii.AppImage from /home/andrew/Downloads
  2. Update content. There needs to be a backup workflow before updating any content.
  3. Press Preview Changes button and check the website. I previously set up a local web server so I could see the style sheet issues locally before upload when I was experimenting with my websites own Wayback Machine. Preview Changes is good enough for normal Publii use like content changes.
  4. Press Sync your website button (safety catch)
  5. Press Sync your website button again (trigger)
  6. Press Get website files button which really helpfully opens /home/andrew/Downloads/my-website2 which proves that these files are Output or what needs to be uploaded to website.
  7. I host my website on netlify, login, click informationindustries.com.
  8. Drag and drop from: /home/andrew/Downloads/my-website2 the directory information-industries-files onto Production deploys.

I think I should really have used code blocks or distinct formatting on the paths, especially in the final workflow steps to help make the document easier to read when I use it. But then, that should be justified in a documentation style guide which I have to write first.