Creating a Static Drupal Site with Tome

Objective

To start with a lando instance and use tome to transition it to a static html site.
To accomplish it we will create a separate lando instance so as not to interfere with the live site/development.
Afterwards will create a gitlab repository and host the site on gitlab since it will be pure html at this point.
 

Recipe Type
Status
Proposed
Drupal Version
Recipe Tags
Notes
Related Documentation
Description

Preliminary research from a project example.

Steps to Build

Build New Local:

- clone the site
- edit configuration file according to your local environment and edit name to make it unique for your hosting platform.
- test to make sure you can access your local site (use the following commands as needed for your local development environment)
- Install the Tome module
     'composer require drupal/tome'
- Enable the Tome module
     Use the UI or with drush 'drush en tome_static -y'
- create directories for Tome to generate content in the web root directory.
     (I suggest putting them in their own directory) ex.
     tome/files
     tome/content
     tome/html
     tome/repo
- edit settings.php and add these settings
     $settings['tome_files_directory'] = 'tome/files';
     $settings['tome_content_directory'] = 'tome/content';
     $settings['tome_static_directory'] = 'tome/html';
- Setup is complete.  

Generate the static site:

     using drush:
        drush tome:static --uri=http://mysite.com
           (Where "mysite.com" is the domain of your production site)
     using the user interface:     
        login as a user with the "use tome static" permission
        submit the form at "/admin/config/tome/static/generate"

The end result is your site has now been exported as static files for use in your local directory or your published site.

Updating the site:

In order to publish modified or new site content you will need to refresh the generated static files.

From the root of the 'tome' folder, where your files are exported, run the shell script to copy the regenerated static code.

The bash script file consists of:
    #!/bin/bash
    \cp -Rf html/* gitlab/
 

Supporting Organizations
Participants