Run makestaticsite.sh


Having run the setup script to generate the configuration file, we can now run the main script, makestaticsite.sh. Generated files are stored together with the option of distinguishing each one with a timestamp, so you can manage multiple projects quite easily.

Launch a terminal window and at the command prompt navigate into the makestaticsite/ directory. To get help on options available, run:

$ ./makestaticsite.sh -h

Most of the time it suffices run the script and point to a configuration file; supposing you have already created myconfig.cfg), run the script with the -i (input) option as follows:

$ ./makestaticsite.sh -i myconfig

MakeStaticSite will then try and read the configuration from config/myconfig.cfg (where you should replace myconfig by the name you actually gave) and proceed to build the static site. Running the script will generate further folders, log/, mirror/ and tmp/.

We outline below what actually happens during a typical run.

  • the configuration file is read and processed
  • A layout is created
  • if the source is a WordPress site and wp-cli is set to ‘yes‘, then it is tweaked in readiness for static capture
  • an initial static site is created through the first run of wget, stored in the mirror/ directory.
  • the site is optionally augmented by searching the output for further URLs that point to the source’s domain name. Then wget is re-run on these URLs.
  • the output is optionally further refined, making adjustments for newsfeeds and applying HTML Tidy
  • A copy is saved as a zip file (depending on the relevant option)
  • Further additions can be made, possibly including scripts that perform specific functions
  • The site is finalised and deployed.

Full details of the phases are listed separately as part of a section on workflow.

That’s basically it. You have now installed, configured and run MakeStaticSite, and should have a static site ready to view!

Runtime options

Of course, it might not appear quite as you’d expect first time round or you might want to know more about what’s going on. To make full use of the scripts, some familiarity is needed both with the configuration options defined in the source’s .cfg file and the runtime settings defined in the constants.sh file.

This page was published on 1 November 2022 and last updated on 4 July 2023.