Rheostatic image

The Rheostatic module is a user-friendly static site generator designed specifically for Scriptor CMS. It empowers you to effortlessly generate dynamic pages using Scriptor, and then seamlessly convert them into static pages for deployment on your server. By harnessing the power of a static website, you gain significant advantages in terms of speed and security. Experience the simplicity and efficiency of Rheostatic Modul as you unlock the potential of your Scriptor-powered website.

Module Description

The Rheostatic module is a powerful addition to Scriptor CMS, designed to enhance the functionality of your website. It enables you to effortlessly transform dynamic pages into static webpages, providing numerous benefits in terms of performance and security.

Traditionally, creating static websites involved manual HTML coding and meticulous attention to detail. However, with the rise of Content Management Systems (CMS), website creation became more efficient. Scriptor CMS emerged as a reliable CMS that combines templates and content dynamically, generating webpages on demand.

In recent times, static websites have gained popularity due to their speed and security advantages. To further optimize Scriptor and tap into the benefits of static websites, the Rheostatic module was developed. It seamlessly converts your dynamic Scriptor pages into static HTML files, which can be hosted on any web server.

By utilizing the Rheostatic module, you can enjoy the advantages of a static website, including faster page loading times and enhanced security measures. Experience the simplicity and efficiency of Rheostatic as it empowers your Scriptor-powered website to reach new heights.

Instructions for Installing the Rheostatic Module

Follow these steps to install the Rheostatic module:

  1. Download the zip file and extract its contents.
  2. Upload the entire "Rheostatic" folder to your server in the directory site/modules/.
  3. Log in to the Scriptor editor area.
  4. Click on "Modules" in the menu.
  5. Find the Rheostatic module in the list and click on the "Install" button.
  6. If the installation is successful, you should now see an additional item called "Rheostatic" in the navigation menu.

Please ensure careful consideration of SSL certificate verification behavior for each request. The behavior can be regulated by adjusting the verify parameter located in the custom.scriptor-config.php file:

...
'Rheostatic' => [
    ...
    'client' => [
        // SSL
        'verify' => true,
        // You can create a client with a differ base URI than the current website
        'base_uri' => '',
        // Enter GET parameters here if needed
        'request' => [
            'query' => []
        ]
    ],
    // Strings you want to replace in the content
    'replacement' => []
]
...

For more information, visit the official Guzzle documentation page.

Recommended: If you want your static pages to be automatically removed from the index when a corresponding original page is deleted in the Scriptor editor, add the following settings to your custom.scriptor-config.php file in the hooks section:

...
'Editor::afterExecute' => [
    [
        'module' => 'rheostatic', 
        'method' => 'loadResources'
    ]
],
'Pages::beforeRemovePage' => [
    [
        'module' => 'rheostatic', 
        'method' => 'clonePage'
    ]
],
'Pages::afterRemovePage' => [
    [
        'module' => 'rheostatic', 
        'method' => 'removePageFromIndex'
    ]
]
...

After generating the static pages, Rheostatic automatically creates a static folder within Scriptor's root directory to store these pages. The content of this folder can be easily pushed to your server using various methods such as Git, SFTP, or any preferred deployment tool. The choice of deployment method is entirely up to you, as it depends on your specific requirements and preferences.

Tips (optional)

If your static pages are hosted on the same server where Scriptor is running, you have the option to use .htaccess to redirect your website visitors to the static folder. Here's an example configuration:

RewriteEngine On
AddDefaultCharset UTF-8

Options -Indexes
Options +SymLinksIfOwnerMatch

#RewriteBase /

RewriteCond %{ENV:REDIRECT_STATUS} . [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
RewriteCond %{QUERY_STRING} !rheostatic [NC]
RewriteCond %{REQUEST_URI} !(^/static|/editor)
RewriteRule ^(.*)$ static/$1

Please note that this example .htaccess configuration demonstrates one way to achieve the desired redirection. It is important to adapt and test the configuration according to your specific server environment and requirements.

it's important to note the presence of the following condition in the provided code: RewriteCond %{QUERY_STRING} !rheostatic [NC]. This condition ensures that website requests containing the rheostatic parameter in the URL are redirected to the dynamic output generated by Scriptor during page scanning. Please be aware that when creating static pages, you must include the rheostatic parameter. To accommodate this requirement, please adjust the configuration of your Rheostatic module in the custom.scriptor-config.php file as shown below:

...
        // Enter GET parameters here if needed
        'request' => [
            'query' => ['rheostatic' => 1]
        ]
...

By making this adjustment, the Rheostatic module will correctly handle the rheostatic parameter during the static page generation process.

Minimum requirements

cURL >= 7.19.4 compiled with OpenSSL and zlib
Compatible with Scriptor: 1.11.3 +
Author: Bigin
Last Updated: 2023-06-21
Rheostatic: 1.5.1