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
Follow these steps to set it up DrupalX with Tome:
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
Enable the Tome Static Module
Enable the Tome static module using Drush:
ddev drush en -y tome_static
Export the Site Using Drush
Export your site to static files:
ddev drush tome:static --uri=https://yourproductionurl --path-count=1 --process-count=1
Navigate to the HTML Directory
Change to the
/html
directory:cd html
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
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