DrupalX Static

Exporting DrupalX to Static Files with the Tome Module

The Drupal Tome module enables the export of DrupalX sites to static files. Detailed instructions can be found on the Tome documentation site.

Example Usage

The DrupalX Demo leverages Tome to facilitate export to Netlify. Follow these steps to set it up:

  1. Add Tome to Composer

    Add the latest development version of Tome (compatible with Drush 12) to your project:

    composer require drupal/tome:1.x-dev
  2. Enable the Tome Static Module

    Enable the Tome static module using Drush:

    ddev drush en -y tome_static
  3. Export the Site Using Drush

    Export your site to static files:

    ddev drush tome:static --uri=https://yourproductionurl --path-count=1 --process-count=1
  4. Navigate to the HTML Directory

    Change to the /html directory:

    cd html
  5. Deploy to Netlify

    Deploy the static site to Netlify. For optimal results, set the process count and path count to 1. This avoids issues with the active menu link not appearing correctly:

    netlify deploy --site yoursitename --prod
  6. Configure URLs on Netlify

    Turn off pretty URLs in Netlify under the "Build & Deploy" configuration. This prevents Netlify from adding a trailing '/' character to URLs.

By following these steps, you can effectively export your DrupalX site to static files and deploy them to Netlify, ensuring a fast and reliable static site experience.

Last updated