A Glance at Tome - Drupal static content generator

17 Mar 2023

Creating a completely static HTML website is quite a challenging process unless you use a static content generator. Tome is developed to make it as easy as possible with any site on Drupal.
Like any CMS, it provides a set of templates and automatically helps to create pages, avoiding a long and complicated manual setup. You don't even need to know Java to use it. Just a perfect match if you're creating content based on raw data and a website template set.
Static sites are perfect for SEO and SEA. Using a static content generator gives some severe benefits to your site, including better performance, a lighter backend, and multiple options for customization. Moreover, static sites are more flexible, secure, and scalable than dynamic types. Let's learn more about static website generators and Tome with our Drupal development team.

How to choose a static content generator?

Selecting a static website generator to work with, it’s crucial to consider its technical characteristics and demands, usability, speed, the places it grabs content from, amount of themes, templates, and programming languages it uses.
Basically, there are dozens of various static content generators, such as Hugo, Pelican, Eleventy, etc. Each of them will help you generate new pages and content within seconds. Each of them has its pros and cons.

The Top 3 Static Site Generators

Let’s pay more attention to the three content generators mentioned above.

Hugo

To date, it is one of the most popular content generators. For just 1 ms, it can generate a website page. Many developers adore Hugo due to its user-friendly interface, over 300 themes, and numerous tools. However, it requires knowledge of the Go programming language, which significantly reduces the number of developers that might use it.

Pelican

This content generator operates Python, one of the most popular programming languages. Pelican is fast, efficient, and multilingual, able to integrate with and import content from external services. Its requirements are more likely to be met by an average user: to use Pelican, you need Python installed. Also, to work with themes and templates, you’ll need Jinja. Well, that’s all.

Eleventy

Though lacking in-depth, Eleventy is excellent for beginners because it is simple and free to use. Over ten programming languages are available, and you can mix them just the way you need. An active Discord community will support you whenever you need it.

Which static content generator works best with Drupal?

Whether you need to rebuild your website from scratch or keep your content and configurations, the Tome static content generator is a great choice. It is Drupal-based and almost doesn’t require knowledge of JavaScript to generate a website.
An instant synchronization to the local file system brings even more convenience into developing a static version of your Drupal website. As for languages, Tome is multilingual. Thus, you may choose from dozens of them.

What do I need to use, Tome?

To use Tome on your local machine, you must ensure you’ve got PHP 7+, Composer, and SQLite 3.26+ installed. Choose either Bookish or Drush based on your needs. 

Benefits of Tome static content generator

In addition to being constantly developed, Tome offers many advantages:

  • Simplicity of use
  • No JavaScript knowledge required
  • Multilingual Drupal setups
  • Quick demo release
  • Two independent sub-modules to store data and generate websites
  • Great for Drupal sites
  • Intuitive design
  • Suits for beginners
  • Automatically traces changes and saves them

Basic Tome capabilities review

The Tome includes numerous tools and five key options to manage your Drupal site.

Maintenance of the site while the production stage
From time to time, any Drupal website needs attention and proper care. It is important for various production deploys not to affect its work. Tome makes it simple and convenient for Drupal users. Create a static website and improve it, avoiding performance or security issues.

Creating Drupal demos
This option helps to create Drupal demos much quicker—no more need to spend time creating, customizing, and configuring your website by hand. With Tome, creating demos is a satisfying, convenient, and fast process, even for Drupal-new users.

Website archivation
A perfect tool for Drupal 8 site owners. If your version doesn't receive updates, you can migrate to Tome by installing it on your site and managing your production site without disruptions.

Migration to a new Drupal site
This option also may be a valuable tool to simplify a move to a new CMS. Tome helps to effortlessly download your Drupal website content, distribute it between two sites or relocate it to a new one. 

Storage for your content
Last but not least, Tome's option brings multiple benefits. Storing data in version control allows users to create temporary Drupal sites. Also, using Drupal in the cloud, one can update their site any time they need it and save money on fees. All the previous versions are protected, too. Thus you can view or modify it and trace the workflow.

Tome Submodules

Depending on your case of use, you can either use both Tome’s submodules or shoes the one you need. Here is their short description:

Submodule 1: Tome Static

A perfect tool for generating a static Drupal site and running it on production. Using Tome Static for the first time, deciding when the generation process will be started is required. To secure your data and get Tome’s essential safety benefits, enabling authentication or adding VPN requirements is recommended.

Submodule 2: Tome Sync

This submodule makes importing and exporting your content much more convenient and allows you to manage it as JSON. A great and powerful tool in case you need to archive, relocate or retire a late version of your site.

Step-by-step instructions for installing and running Tome

Due to an opportunity to choose between Drupal UI and Drush, Tome will be convenient for dev-ops and site builders. Here is how to use it:

1. Installation
Using the command line, download (composer require drupal/tome drupal-tome/tome_drush)Tome Drupal module and enable (Drush en tome -y) it.
This process can also be performed by navigating to Extend and selecting the Tome module.

2. Enable CSS files aggregation
In the Configuration tab, click on Development, then choose Performance and switch on the "Aggregate JavaScript files" and "Aggregate CSS files" options. Save the changes.

3. Static website generation
In the Configuration tab, click on Tome Static, then Generate static site. Paste a Base URL in the window, and expect your site to be generated.

You can also find a preview or download your static site options in the Tome Static tab.

To generate a site using Drush, run the following commands:

Drush tome: static --uri=http://localhost:8000

To successfully run a generation process, URI should be set to your static site's URL. After it, you can find the generated files in the HTML folder.

4. Static website testing
Open the HTML folder and run the PHP -S localhost:8000 command to test the static site in your browser.

Using Tome, you can increase your website's SEO efficiency and loading speed. Also, Tome is much more safe compared to most static content generators. Install Tome to manage and update your Drupal site fast, efficiently, and conveniently. It is multilingual and thus easy to use regardless of your preferred programming language. You can create demos, store data, and share content between two or more sites.

Wrapping up

Tome is one of the preferable static content generators to use if you create, relocate, archive, or restore your Drupal site. An intuitive design and big communities where you can get help make it easier for beginner devs to use it. The two independent submodules deliver a bunch of opportunities for numerous use cases. The set of templates and code-free options (just like in the case of CMS bring extra opportunities and significantly extend the usability of this static content generator.