There are three different ways of generating a static export in Simply Static. You should always start with a full static export to make sure all of your assets (CSS/JS) and images are getting exported.
Once you did that, you may want to update specific parts of your website. The most common method to quickly update pages, post or any other custom post type are “Single Exports”.
Table of Contents
Start by editing a page/post. You will find a meta box called “Simply Static” which contains a couple of actions. The most obvious one is “Generate Static” which starts a static export of the current page.
Single Exports does not just update the single page/post you are exporting, instead, it will also update:
- assigned category and tag pages
- the blog page
- the homepage
- extract and export all images from that page
This should cover most of the places to update (overviews, latest article widgets, and so on).
Need more control? Or do you want to add additional pages and files? Well, we got you covered. Let’s talk about the second method of updating your static website implemented in Simply Static called “Builds”.
You can quickly create a new “Build” in Simply Static -> Builds. Builds allow you to add a list of URLs and file paths and export all of them with a single click of a button.
You can also assign Builds to posts, pages, or any other custom post type to include them in the export. This can be a good solution if you have custom overview pages that aren’t recognized by a Single Export or if you have to update specific files on each static export.
Generate static export on publishing a post
Sometimes you want to automate static exports even further and instead of clicking the “Generate Static” button within a post or page, you want to automatically export them once you publish a post. That’s why I created the following code snippet.
Add it to your functions.php or use the Code Snippets plugin to add it to your website and Simply Static will automatically trigger a single export once you publish a post/page.
Schedule static exports for updating your website
You may have a large website or a content team that publishes a lot of articles and adjustments in a week and you want to make sure your static website gets updated on a fixed schedule. Simply Static uses background processing and is entirely optimized to work with WP-Cron.
With the following code snippet, you can schedule a static export (full export, builds export, single export):
That’s it. Now you should be familiar with all the ways of updating your static website with Simply Static.