Pablo López Escobés
PHP/Drupal Developer
@plopesc
Static site built with Jekyll.
Static site built with Hugo.
Static site built with Gatsby.
@brianperry
 
 
 
 
 
 
 
Tome creator/maintainer
Drupal Security Team member
d.o: samuel.mortenson
@DrupalSAM
#tome
 
$ drush tome:static
$ drush tome:static-export-path
$ drush tome:preview
$ drush tome:clean-files
$ drush tome:export
$ drush tome:export-content
$ drush tome:import
$ drush tome:import-content
$ drush tome:import-complete
$ drush tome:import-partial
$ drush tome-netlify:deploy
Search index stored in JS
Can be used in non-static sites as well
Really fast
https://www.drupal.org/project/lunr
 
 
$ composer require drupal-tome/tome_drush
$ drush tome:install
$ drush tome:init
https://github.com/drupal-tome/tome_drush
 
See: https://tome.fyi/docs/getting-started
$ composer create-project drupal-tome/tome-project my_site\
--stability dev --no-interaction --no-install
$ cd my_site
$ composer install
# Build a Drupal instance with SQLite and Tome enabled.
$ drush tome:init
$ drush runserver 127.0.0.1:8888
# Perform content changes and generate the static build.
$ drush tome:static
https://github.com/plopesc/lambda_form
 
See: https://tome.fyi/docs/technical/api
class TomePathSubscriber implements EventSubscriberInterface {
public function collectPaths(CollectPathsEvent $event) {
$event->addPath('/my-custom-path');
$event->deletePath('/unnecessary-path');
}
public static function getSubscribedEvents() {
$events[TomeStaticEvents::COLLECT_PATHS][] = ['collectPaths'];
return $events;
}
}
As much as you can imagine
$ git clone git@github.com:plopesc/netlify-template.git
$ composer install
$ drush tome:install
$ drush runserver
# Create/edit content at 127.0.0.1:8888
$ git add . && git commit -m "Code updated" && git push
netlify.toml
[build]
command = "composer install && ./vendor/bin/drush tome:install -y\
&& ./vendor/bin/drush tome:static -l $DEPLOY_PRIME_URL"
publish = "html"
[build.environment]
PHP_VERSION="7.2"
See: https://github.com/drupal-tome/drupal-tome.github.io
drush cron -l https://tome-demo.github.io
drush tome:static -l https://tome-demo.github.io
rm -rf gh-pages
git clone git@github.com:tome-demo/tome-demo.github.io.git gh-pages
cd gh-pages
git checkout master || git checkout -b master
cd ..
rm -rf gh-pages/*
cp -r html/* gh-pages/
cd gh-pages
git add .
git commit -m 'Updating gh-pages site'
git push -u origin master
Nodes | Terms | Build time UI | Build time Drush |
---|---|---|---|
20 | 3 | ~13.4s | ~7.5s |
100 | 20 | ~37.9s | ~15.9s |
5000 | 100 | ~35m | ~10m |
Basic Standard profile installation + Devel Generate
 
You cannot notice any difference between hosted & static version. Search is possible thanks to Lunr.
Tome site including other modules like Paragraphs, Geofield, Geocoder, Leaflet, Redirect, Quicklink...