Tome is a suite of Drupal modules that can make your site into secure, fast, static HTML. 

Long story short, you can use Drupal in the same way you would use other static site generators like Jekyll or Hugo - everything lives in one repository, and Drupal only runs on your local machine.

The creator, Sam Mortenson tells us everything we need to know.

This Episode's Guest

Sam Mortenson

Portrait of Sam Mortenson

Sam Mortenson is a prolific Drupal contributor and Security Team member. He says, "I work on too many modules" including File Entity Browser, Content Browser, Entity Browser Block, and of course Tome. Sam is currently a Security Engineer at Squarespace.

Transcript

Transcript

Matt Kleve:
For February 6th, 2020, it's the Lullabot podcast.
Matt Kleve:
Hey everybody, it's the Lullabot podcast, episode 245. I'm Matt Kleve, the senior developer of Lullabot, with me as always cohost of the show, senior front end dev, Mike Herchel. Hey Mike?
Mike Herchel:
Hey Matt Kleve, how are you doing?
Matt Kleve:
Pretty darn good. I think we're on top of things or something or have a really good new year's resolution working because we seem to be getting these out more often than we did at the end of last year, huh?
Mike Herchel:
Yeah. And we're going to keep it up.
Matt Kleve:
That goal is every other week. Right?
Mike Herchel:
That's kind of ambitious, but yeah. I can do that and I think we're going to start off the year pretty well.
Matt Kleve:
We started off strong, right?
Mike Herchel:
Mm-hmm (affirmative), yep.
Matt Kleve:
And we were continuing, we kind of have an interesting topic today. A lot of times we pile the podcast with a bunch of guests and it's sometimes hard to like keep track of who's talking and what they have to say and they're all saying such great things. But today we're two on one.
Mike Herchel:
With us today we have a maintainer of many of your favorite Drupal modules such as file entity browser, content browser, entity browser block, and a bunch of others, including what we're talking about today. He also works to keep triple core and contributed module secure with Israel and its Drupal security team from Portland, Oregon. Welcome Sam Mortenson. How are you doing?
Sam Mortenson:
Good, thanks for having me.
Matt Kleve:
Sam, glad you're here. And we haven't really even mentioned what we're talking about today. We've been really mysterious, Mike.
Mike Herchel:
Yes.
Matt Kleve:
I think it was because neither of us wanted to mispronounce it. I learned how to pronounce it like five minutes ago when Sam told me.
Mike Herchel:
Is it Tome I like Marissa Tome.
Matt Kleve:
No.
Mike Herchel:
Is it Tomi?
Matt Kleve:
Neither? No, it's Tome.
Mike Herchel:
Tome.
Matt Kleve:
Tome. That's right. And you know, I plugged it into Google real quick and Google was smarter than me and it told me that it was a word that meant a book, a large heavy scholarly book.
Mike Herchel:
Is that the origin of the name that you chose, Sam?
Sam Mortenson:
Yeah. Yeah. I was thinking of like, it's a static site generator and so it generates a lot of pages, like a big book. And there's also like a kind of offhand Japanese word route called Tome, which means like to stop. So it's kind of stopping your site or making your site static.
Matt Kleve:
Oh wait, hang on. That's Tome though.
Sam Mortenson:
I know. But you should call it Tome, I think, because my Japanese isn't great and I wouldn't want to advertise something that's dump.
Matt Kleve:
So this is something that you built Sam? Tome?
Sam Mortenson:
Yeah. I built it all myself, all in my free time.
Matt Kleve:
Awesome.
Matt Kleve:
So tell me, so it's a static site generator, we've kind of given that away, which means we have a Drupal site and it's up and running and it's awesome. But I just want to make HTML pages for it, so I go get the Tome module. Is that how this works?
Sam Mortenson:
Yeah. Like everything in Drupal, it's never that simple. So Tome kind of does two things. One is it generates static HTML, so there's a sub-module called Tome static and that's all it does. It can take any Drupal eight site hypothetically and generate a copy of it as static HTML.
Sam Mortenson:
The other part of it, which is Tome sync, lets you store all of your content and config and files in your gift repository just like you would if you were using Jekyll or Gatsby. That's like the most new thing. And basically what that means is that you can run Drupal temporarily on your local machine or maybe on a temporary container on some Cloud. You can make your edits and then you can shut down Drupal and just commit your changes. So it basically means your production site is static HTML and even your editing site is this temporary thing that you don't have to care about paying maintenance costs for, doing security updates for.
Matt Kleve:
And security is kind of the real bonus with Tome and having a static site compared to Drupal. Because with Drupal, you have a large attack service. You're running PHP, you're running a database and those things might have problems as well as the code that's there. And if you just are serving HTML, that's something that's fairly tried and true and less of an attack factor. Would you agree?
Sam Mortenson:
Yeah. And if you think about simple sites you may have worked on, a lot of times they're micro sites or marketing sites. Sometimes even EDU sites can be pretty static and you're basically paying for Drupal hosting for just serving cash content. Like there is no authenticated user experience besides the content editing. There's nothing really that complicated the site does. So you're leaving yourself open to attacks and you're paying money monthly for a site that is essentially static to the end user.
Mike Herchel:
Well, that makes a lot of sense. How long does it take to read, to say, generate the static assets for us, say if I have a site that maybe has, I don't know, I think if I were to guess Lullabot has maybe like 3000 ish nodes, maybe 5,000 nodes. Well, what would you guess on that?
Sam Mortenson:
Yeah, I would guess about five minutes. And that's based on this project I have called Big Tome, which is me and testing out the performance limits of the project. And to me it becomes like very unergonomic when you have more than 10,000 nodes. 10,000 nodes takes about 10 minutes on a really beefy computer doing a lot of parallel tasks. So I would say 5,000 should be about five minutes.
Matt Kleve:
Okay. So we started talking about things in terms of nodes, which I think is problematic within Drupal because not every URL that a user is going to visit is actually the display of a node. There's a billion things out there that give the user something to look at. So how does Tome find everything?
Sam Mortenson:
Yeah. When I initially built it, how it worked, and this is how the initial build works still, is that it basically finds every entity on your site. It doesn't load them for performance reasons. Like you can't entity load multiple 10,000 nodes, your site will crash if you've ever done that. And so what it does is it gets every entity ID and it gets these placeholder paths to say, I want to generate whatever is on node one's alias, even though I don't know where that is yet. And so it gets a list of every entity that is accessible to anonymous users because it's Drupal eight and also gets every route that's available to it. Routes are things like, view URL are actually routes, they're not entity paths. And it basically-
Matt Kleve:
Because you view as an entity, so it's getting indexed as well as a part of this process?
Sam Mortenson:
Yeah. Yeah. So basically it tries to assume without even loading the site, what are all the paths that are probably on your site. And then it goes through and batches those in parallel. But what I realized is that people's sites are complicated and Tome will miss some paths on that first process. So then it actually does do traditional crawling from that point forward. So if you have some path to a PDF that's like just a Lincoln, an icon have tag, Tome would never be aware that you wanted that generated. It's just a random file on your site. Now it'll actually crawl that and spider it just like a traditional spider. I didn't want to do spidering but it does both now.
Matt Kleve:
So if we're going to end up spidering anyway, why don't we just run our sync and call it good?
Sam Mortenson:
Yeah, great question. Someone actually asked this in the official Tome repository and I had to think for a bit about it-
Matt Kleve:
Or Wget or something like that.
Sam Mortenson:
Yeah. Wget recursive is great and would probably work for this too. I think the main differences that Wget recursive is only a spider, so it has to start on your front page. And then if you imagine this amazing tree that pops out of your front page for all your paths. If you run something in parallel like a spider, it has to know what paths to run in parallel if that makes sense. So if the homepage only has 20 links, it can only do 20 tests in parallel for the next tree of the spider. For Tome, it knows all 5,000 nodes right away, so it can actually spawn concurrent tasks to process every node at once if your computer is insanely fast. So that's the first reason; it's faster.
Sam Mortenson:
Another reason is that it's cached. And so Tome static uses Drupal caching like traditional cash tags and it knows when paths are invalidated. So if you run the same build twice, the second build should have a lot less paths, almost none, because it already knows that nothing has changed since that first build you're in. So it's faster than Wget, it's cashed, and it also runs in Drupal. And so the cool thing it does, which sometimes leads some bugs is that in one Drupal bootstrap, so in one like PHP process, it'll process multiple paths. This is not possible in a spider, because the spider is just hitting a web server or some CDN and then whatever's determining it. But this actually will spin up triple once, process like five or 10 paths and then spin it down. So that's like a big performance increase as well.
Matt Kleve:
Talk a little bit about where this is running. If we're deploying HTML, if that's the end game. Are we running Tome locally? Are we running it on the server? I'm not exactly sure what the main path to use it would be.
Sam Mortenson:
Yeah. So like I mentioned earlier, it's kind of a complicated project because it has these two halves that make up this whole Tome experience. So if you are using both parts, which means your get repository has every node committed as JSON, all your configures Yammer, all your uploaded files. What you can do is have a CI process run that will check out your get repository. It'll actually install Drupal from scratch with Tome, get all your content imported basically, and then it'll run the static build on the CI. So it's kind of a stateless build without a persistent Drupal site.
Sam Mortenson:
That's the full one. And then if you just want to use Tome static, which would be, let's say you already have a Pantheon subscription and you like it and you don't know what I'm talking about with storing stuff and get, that's fine. Your Pantheon subscription can just have Tome static running persistently, and it would actually run on that server either via address command or Cron, or through the UI.
Matt Kleve:
Is there any benefit to doing that? Like for hosts like Pantheon. If Pantheon is going to cash your front end HTML under CDN and probably and furnish or something like that. Would there be any benefit of running Tome HCML on something like Pantheon or Acquia?
Sam Mortenson:
Yeah, it's kind of that same performance security trade-off we were talking about earlier, where with Tome you could have the cheapest subscription you could possibly buy. It only has to scale to how many content editors you have and how big your Tome static build is, if that makes sense. You're no longer scaling for traffic unlike the Drupal subscription, you're scaling for authenticated editors and what Tome static does, so that's cheaper. And then even though Pantheon and Acquia make it easy to update, you're still leaving your site vulnerable and you still have to deal with automating updates across what can be thousands of micro sites.
Sam Mortenson:
And so Tome can let you do things like lock down your production environment to all the authenticated users or authenticate the URL so much that no one can find it. And end users, the public are only accessing your static site. So it still has that security benefit.
Matt Kleve:
And as it turns out, something like Apache conserve HTML files really fast.
Sam Mortenson:
Yeah. Again, with rewrite rules, it's really easy to say something like if the path isn't admin or node/edit serve it from this HTML folder as well.
Matt Kleve:
Oh yeah. I could see that could be a really slick setup.
Mike Herchel:
So how does Tome work with, I don't know, like AJAX operations, like views AJAX, AJAX Pager and views or something like that?
Sam Mortenson:
Yeah, it basically doesn't. And the reason for that is that when you're running a static site, there is no backend. And especially with Tome, there is no publicly accessible triple backend. Of course, you could engineer your own solution where maybe you expose part of a Drupal backend to serve these kind of dynamic experiences. But what I would recommend for performance and cost reasons is just using JavaScript and using something else for your dynamic bits. And so that could be a third party service. Like let's say a service that lets you spend contact forms or it could be a third party JavaScript based search service. There's a lot of those and Tome actually has a built in integration with Lunr, which is a JavaScript based search index. Um, so you can have a full text search with Tome. It's just all done a JavaScript on the client side.
Matt Kleve:
Wait, this JavaScript search index is called Lunr. Is that a node to Solr?
Sam Mortenson:
Yeah, I think their slogan is like Solr but not as bright.
Matt Kleve:
That's pretty funny. So a lot of the same problems that are hard when it comes to decoupling would also be hard on this front, like Mike mentioned interesting AJAX things which you would then do on your front end. But things like forms as well, you'd have to figure out a different way to handle?
Sam Mortenson:
Yeah. I realized as soon as I started building this that these are going to be blockers. On the Tome website there's some documentation for this. So obviously I've created the Lunr module which lets you make a search page with no custom code. It's just like building a normal search index with search API. And the other thing with forms, this is the only integration built in, is if you're hosting your site on Netlify, they have a free forms integration that's really slick. If you just add this attribute to your form tag in HTML called Netlify, it somehow automatically knows that when that gets submit, I'm actually just going to send all the contents of that form to a random table in the Netlify interface.
Sam Mortenson:
So it has like the dumbest, easiest form integration. There's also a module for that and literally all the module does is add an attribute to your form tags that submits it to Netlify.
Matt Kleve:
It's pretty slick.
Sam Mortenson:
Yeah, it was cool. I'm like, wow, I don't have to do any work at all.
Matt Kleve:
I just pulled up the project page. It says that you last committed 18 hours ago and the first commit was a year ago. So this is something that's been going for a little while now?
Sam Mortenson:
Yeah, yeah. And it's great. I think Tome has something like 200 users, which is not a lot. My biggest project is something like 15,000 and I barely maintain it. But it means that all 200 of those users are running a website with Tome, like Tome is integral to how they run their website. It's not a tertiary module or like an enhancement, which is cool to me.
Matt Kleve:
You maintain enough modules, you might know the answer. How accurate are those numbers? Do we believe 219 because not everybody has to report back, right?
Sam Mortenson:
Yep. It's hard to say if they're low or high. I would say they're always low because you have to have the update module enabled and it has to be reporting into drupal.org. To me that means it's low. The reason some people say it's high is that if you have a CI process that does that, or you have a lot of dev or stage environments, those are all reporting into as if they were production users. So they're kind of messed up. It's just a ballpark.
Mike Herchel:
I can tell you that the downloads that's directly under that number, at least for my module, the Quicklinks module has just been static. It hasn't changed in something like six months. And since then there's been like a release, and I know that's hard to change.
Matt Kleve:
Mike, I'm going to go download it right now.
Mike Herchel:
Yeah, thank you. So like the downloads is, I don't know if that's broken or not. Maybe I should have opened in this year, but that's a little bit outside the scope of this.
Matt Kleve:
I was just curious. It just seems like it's a project that could be useful to a lot of people and then I hear 200 and I think, huh?
Sam Mortenson:
I bet you also think that all right that 219 but the actual Drupal part of that does not need to be active. They might be using Drupal maybe once a month on their local to upload static HTML so it doesn't have the chance to report back.
Matt Kleve:
Okay. Mike, you have 9,614 downloads. I'm downloading it right now.
Sam Mortenson:
It's been like that for six ish months. Because I was looking, I was trying to eclipse that 10,000 download barrier and it's just been-
Matt Kleve:
[crosstalk 00:
7:
4] send you a golden drop?
Sam Mortenson:
That's how it works. Yeah.
Matt Kleve:
If you get 10,000 downloads or something?
Sam Mortenson:
Maybe, I don't know.
Matt Kleve:
We're talking Tome, a Drupal static site generator that seems to be pretty cool. We're talking with the maintainer, the creator of the module, Sam Mortenson on the Lullabot podcast coming up right after this. We'll hear what else he has to tell us about it.
Matt Kleve:
That was really awkward.
Mike Herchel:
That was weird. And you're like, it seems to be pretty cool.
Matt Kleve:
That's because I didn't know anything about it.
Mike Herchel:
Well, now you know something about it.
Mike Herchel:
Hey, it's Avi from MidCamp. How are you doing, Avi?
Avi:
I'm doing great. How are you guys?
Mike Herchel:
Pretty good. Hey, I hear you have a conference coming up?
Avi:
We do. It's MidCamp in Chicago, March 18th through the 21st.
Matt Kleve:
I remember some, I don't know, almost 10 years ago when we were in Chicago in March and they dyed the river green.
Avi:
They do, it's super amazing. The Saturday before our camp, they dye the river green on St. Patrick's day in Chicago. It's a huge festival. There's going to be parades, there's going to be the river dying. We're going to work on organizing some trips to get people out for that if they come in early.
Matt Kleve:
Nice.
Avi:
Our tagline this year is, "Come for the river dying and stay for the community."
Matt Kleve:
That'll be fun. So what are you expecting at the camp?
Avi:
Wednesday the 18th, we've got paid trainings and a couple of summits. Thursday, Friday, we've got a lot of great sessions that are all picked and accepted and up on the website. And then Saturday is their contribution day. We've got some socials going on too. We've got a game night on Thursday that's always super fun, so it should be a great time.
Mike Herchel:
Cool. Well thanks for coming on and telling us about it.
Matt Kleve:
What's your website again?
Avi:
The website is midcamp.org. We've got ticket info up there, sponsor information, and all of the sessions and details. So come on down.
Mike Herchel:
Welcome back. We are talking Tome static site generators with Sam Mortenson.
Matt Kleve:
Hey Sam. One thing you mentioned was this is something that you've been doing in your spare time. Why is Tome something that you cared about and wanted to make happen?
Sam Mortenson:
I'm on the security team, which you mentioned earlier, and I've been on it for a while, maybe like four years. And through that, I've learned that Drupal has a lot of security problems. I wouldn't say that it's inherently insecure, but obviously doing security updates is a part of every Drupal administrator's life. And the part of that that's hard is that platforms will have all this automation to help out. I actually worked on the automation for updates on Acquia, so I know it can go really well. But if you're running these small, simple sites and you have a lot of them, like let's say hundreds or thousands, the argument for using Drupal kind of falls apart when you have to sit around and do updates every month for thousands of sites that are basically static anyway.
Sam Mortenson:
I saw this need from a security perspective, and then from a personal perspective, I had Drupal sites that I wanted to make, that I didn't want to pay for, because for most of my projects I'm very cheap and I do like using Drupal and there's no real option up there that's free Drupal hosting for life with no security updates. It just doesn't exist. I was excited about those things and I'd also use static site generators for myself. Like my blog is run using Jekyll. I've used Gatsby quite a bit. And so I'm like, why can't Drupal do this? Why are we left out of the static site?
Mike Herchel:
What's to stop someone from firing up a free tugboat instance, which is available on tugboat.qa, installing Drupal, uploading a database, inputting their config and using Tome and having it go to Netlify. Is there anything-
Matt Kleve:
What was that last part, Mike? I'm not familiar with the word you just said.
Mike Herchel:
Netlify? You know what Netlify is?
Matt Kleve:
No, I don't.
Mike Herchel:
Netlify is a host, like an application host, you can host static and dynamic websites. And when I say dynamic, mostly maybe like node based stuff, but static, you can just throw up HTML, I think you can use your own domain free.
Matt Kleve:
Netlify?
Mike Herchel:
Yeah. And it's pretty cheap and it has like super good integration with things like GitHub and Bitbucket and things like that.
Matt Kleve:
And they're now sending you a paycheck? We're not that cool.
Mike Herchel:
I wish. I wish.
Matt Kleve:
It sounds like what you're saying Mike, is that you're going to build Drupal somewhere, use Tome and then deploy it somewhere else.
Mike Herchel:
Yeah. Is that a recipe for success?
Sam Mortenson:
Yeah, I would say. I mean, I've tested that on a lot of hosts and it works fine. And actually that Tome net low-fi module we were talking about earlier, that handles form submissions also handles deploying directly from your Drupal instance to Netlify, which is something that was built just for people that are hosting Drupal and not using Tome just on their local machines. And so all of the software is already set up for you to do that, so go for it.
Matt Kleve:
And to be clear, I heard you say Netlify before, but I was not smart enough to ask the question then. I'm glad we got that taken care of. So who is using this? Have you heard from any of those folks that have reached out and said, "This is how we're doing it and it's awesome"?
Sam Mortenson:
Yeah. I will say because it's the Drupal community, most people reach out to me with questions like, "Can I use Tome as a better furnish on my existing site?" Or, "Can I use Tome for running tests?" People that use Drupal have such big brains. It's kind of hard for them to [crosstalk 00:
3:
2]
Matt Kleve:
That's somehow similar to the way Boost used to work, right?
Sam Mortenson:
Yes, that's exactly how Boost-
Mike Herchel:
I remember Boost. I used to see it-
Matt Kleve:
It might still exist, I don't know.
Sam Mortenson:
Not in Drupal eight, but it does exist. And just for context, that was a module in Drupal seven that basically generated static. It's demo for your site and if it could serve a cached page from your static HTML directory, it would. It was kind of like free furnish, maybe it's the best way to describe it.
Sam Mortenson:
In terms of users, I use it, so the Tome website, tome.fyi uses it. It's a site that I built basically from scratch. It mostly uses Drupal core. It has a landing page, it has documentation for the module. That was cool. Another site that uses it is one I maintain called pooppdx.com. And this is a bathroom review site for Portland, Oregon bathrooms. And this one is fun to look at. Maybe not [crosstalk 00:
4:
0], but for the search. It actually has that Lunr search module integration so you can use it for text search.
Mike Herchel:
We're going to be linking to that from the show notes for everyone that's interested here. I'm on it right now. And it's like basically a blog site and then you have pictures of various commodes and toilets with dates and-
Matt Kleve:
If this is static, how can I add my review?
Sam Mortenson:
Yeah, that's a good question. I think I did have that ambition of being like, "Oh, I'm going to make a mobile app and it's going to let anyone review." But I just thought of the headache and the fact that this has no profit model. And so right now it's just me and my friends.
Mike Herchel:
The logo is a Brown Rose.
Sam Mortenson:
Yeah.
Matt Kleve:
And you're scoring these bathrooms based on the fart system where they're-
Sam Mortenson:
Oh yeah
Matt Kleve:
Their facilities' accessibility, their rankness and their toilet paper. I think all important things.
Sam Mortenson:
I'm very proud of this, of the site.
Mike Herchel:
The site seems to work fairly well. Does it download the full search index into like with a JSON file and then that's performed locally or is it done on like JavaScript main thread or like... Basically, what I'm asking is, well the search work if it's looking through thousands of items?
Sam Mortenson:
Yeah. So for how it works, basically what it does is it uses this Lunr project to pre compile the search index, so your client isn't building a search index, it does just download it, and then it runs it in your client, in a web worker. So it shouldn't block the main thread. But that doesn't mean it won't be slow to load. And then once it's loaded, if you do a search, if you use via network inspector later, you can kind of see it happen. But when you find search results, it'll do more AJAX requests to get the actual content, like your little preview for the search route.
Sam Mortenson:
So yeah, it does all sorts of stuff for performance. But I will say that there's an upper limit and once you reach, I don't know, even a few thousand, you don't want to keep your users waiting more than a few seconds to search. So it's up to you, but it does function even for that Big Tome 10,000 node site. I wouldn't recommend it, but it does work.
Mike Herchel:
Also the background is like subway tiles.
Sam Mortenson:
Yup.
Matt Kleve:
I remember when you mentioned that 10,000 number, that was just kind of a timing thing though. Wasn't it? Like you could continue to add more paths and it would be fine, right? Or am I wrong?
Sam Mortenson:
Yeah, totally. I mean, I've built it. I mean, I shouldn't be so confident in my code, but I did build it to scale up as long as you have memory to do it. And every process that Tome runs with Drush is using concurrency. It's using something like batching, but a little faster to run. And so it can scale up however much you want. It's just you probably don't want to sit around waiting for like a 10 minute build if you change like the title of one node for instance. It would be hard to find a workflow that would feel good for your content editors and for everyone involved.
Matt Kleve:
I don't know when I run composer update and import on my config and do all that stuff. I end up going to get a cup of coffee anyway.
Mike Herchel:
Your editors aren't running composer update.
Matt Kleve:
No, you're right. I'm just changing branches.
Mike Herchel:
Hopefully they're not. Is there something within the tow module that when I hit that submit button it triggers something which then triggers the static build?
Sam Mortenson:
Yeah. Yeah. So you're asking if there's a user interface?
Mike Herchel:
Well yeah. Well, not so much for the user interface, but like some automatic triggering. So if I update a node or create a new node, it's going to regenerate everything.
Sam Mortenson:
Oh, I see. So what I would recommend for that is using Cron. So there's a sub module called Tome static Cron, continually run builds. The tricky part about saying when I click Save, generate the static page, is that Drupal is complicated. So you may think that you only edited node one, but node one actually appears on a lot of paths. It appears on node/one, it's alias. Other URL aliases, maybe the homepage has a view, maybe search indexes need rebuilt. So it's never as simple and Drupal as saying just regenerate/blog one or something like that. That's why Tome doesn't do that, where you click Save and it just automatically does it for you.
Mike Herchel:
So here's a question for you. So there's a bunch of aliases for every single node, but is there a way to say Disable, say, I don't want to generate aliases on node/*?
Sam Mortenson:
Yeah. Just to save you some time maybe.
Mike Herchel:
Yeah. Something like that where you could maybe configure it to say, I don't want to worry about these aliases and I'll handle this by doing the patchy rewrites or, I don't know, or something like that. I don't know.
Sam Mortenson:
Yeah. One thing is that if Tome finds a redirect, it will just write out that little redirect meta tag. The other thing is you can't exclude paths arbitrarily with a sudden stop PHP setting, which is documented on the Tome site. And then if you want to get more complicated, like you have some more dynamic logic to exclude paths in a custom module, there's an event subscriber you can use to exclude paths as to generate it. So there's a lot of options.
Mike Herchel:
Okay. You mentioned a little bit about Netlify and the form integration, but are there any other type of deployment options that are integrated or anything else?
Sam Mortenson:
Yeah, there's nothing that I've written for you, but people have written logs about to point to S3, which seems like a really easy target because a lot of people already use that for static sites. I can add links later. But yeah, someone has blogged about their experience using Tome to rewrite their blog and they even did their own search, their own form integration, all of this stuff they wanted to do from scratch on AWS, which I am way too lazy to do. So their blog is a great reference for that. I think it's called [Bad Zillow 00:
0:
5], is the blog.
Matt Kleve:
Let's talk a little bit about a Tome sync, which we mentioned earlier, but it kind of flips the script and runs things a little bit differently. So we're syncing a Drupal install essentially? Explain what's going on there.
Sam Mortenson:
Yeah. One big difference between Drupal being a static site just generating static HTML and all these other static generators is that if you use Jekyll or you use Gatsby, you might know that you actually commit your content into your repo too. So usually this is like a markdown file that has some fields for your blog and then your actual markdown content.
Sam Mortenson:
I wanted the same experience for Drupal where when you use Drupal, especially from a personal site, you spend it up locally, you do your edits and maybe generate static HTML and then you spin it down and you don't have to worry about where it lands or about a persistent database or anything like that. This is what Tome sync does for you, and how it works is every time you edit content or delete content or whatever, it'll output those changes to a JSON file that lives in your site. And that JSON file, if you've ever used REST API or JSON API, it looks a lot like that. It's the normalized version of your node or entity and it contains all your fields. It's like really normal. It's not very human readable, it's more like machine filled, but that's fine because you're using Drupal to edit it anyway.
Sam Mortenson:
So it gets output there. When you edit config it gets output to your config Yammer, which you're probably used to. And when you upload a file, it places that original file in a different file's directory that you can commit also. What that lets you do, especially for sites I maintain, I do this and other people that have used it for personal blogs do this, is that, when I want to write a blog post, I check on my repo, I install Drupal from scratch. The site looks just like it should. I make an edit, I commit that change and then the CI build will actually generate the static HTML. So I don't have to worry about any of the questions we've had about static HTML generation. It's all done somewhere else. And all I'm doing is using Drupal locally.
Matt Kleve:
So Sam, if I wanted to get started with Tome, how would I do that? Like where do I go first?
Sam Mortenson:
As I mentioned earlier, there's a Tome site running that is the site for Tome. If you can wrap your mind around that, it's tome.fyi. It's mostly documentation, and if you go there, the first documentation you can read is Getting Started and this will take you through making a site from scratch using a Drupal project build that is specific to Tome. And this will take you from setting up a get repo to editing your first piece of content to committing that content change.
Sam Mortenson:
It also functions as a really nice demo for all of Tome's features. So I usually say that people should use that. If you have an existing Drupal site and you want to try out Tome, it's a bit easier. All you have to do is download Tome to your site so you can compose or acquire it. Just enable Tome static, so that's the part that just a static site generation. And then you just run drush tome:
tatic and a static site will be output somewhere. There's more documentation on maybe some settings you want to configure so you can know you're writing to the right directory and generating the site for the right base URL. But that's a really quick way to try it out. And it's fun because on complicated sites, Tome usually runs into some issues. It's not a perfect project and I would love to see your bug submitted.
Sam Mortenson:
This is Sam Mortenson and I'm here to talk about Tome-
Matt Kleve:
There you are.
Sam Mortenson:
-a static site generator. Hello?
Matt Kleve:
I went to the tome.fyi and there's a screen cast and all kinds of cool stuff here. I was also a little blown away that FYI was a top level domain. I hadn't realized that one.
Sam Mortenson:
Yeah. I got bug reports from India for the first few months because they're like, "That TLD doesn't work here." And I'm like, "Oh my God, I'm so sorry." You can't can view my site.
Matt Kleve:
Is that just their DNS, the DNS they were using, the FYI changes?
Sam Mortenson:
Yeah. I guess so.
Matt Kleve:
The FYI changes?
Sam Mortenson:
Yeah.
Matt Kleve:
Okay.
Mike Herchel:
It's kind of messed up. You'd think that the internet should have very similar DNS around the world.
Matt Kleve:
You see Mike, it's a series of tubes.
Mike Herchel:
Tubes aren't going to the FYI.
Matt Kleve:
Correct.
Mike Herchel:
So if someone is looking to help out or must have made changes or something like that, how can they help you out?
Sam Mortenson:
With Tome, I feel like the thing I want the most is production users. You can guess that the 200 users out there aren't all using it for their site. But I only know of something like 20 sites that use Tome. And the more sites that use it, the more bugs we find, the more we can improve performance and get more documentation for more bespoke creative hosting options. So that's what I would like; build your blog or build a fun small triple site at no cost and no risk with Tome.
Sam Mortenson:
The other thing that would be great is there are a few open Tome issues. So if you go to drupal.org/project/tome it will be there. And the next thing is that that Tome website, tome.fyi is open source, and you can check it out right now, install Drupal locally and make edits and commit them and do a pull request just like you would with any other repo except you're doing a pull request for content changes, not for code. So that would be great if you want to edit documentation or translate documentation or add documentation, feel free.
Mike Herchel:
Interesting. And so you were saying earlier, you host, you don't host, but you maintain many other modules and during the break you were saying that you were looking for co-maintainers. Do you want to talk a little bit about that?
Sam Mortenson:
Yeah. At some point after realizing I maintained something like 10 or 15 modules, I realized that I have neither the passion nor time to really give my best full attention to each one. And so I marked almost every project to seeking co-maintainers. And what that means is that anyone can reach out to me and ask to co-maintain a project and I'll talk to you about what it takes to do that. Normally all you have to do is show me that you can do the work. So go to an issue queue, submit a patch, review a patch, marker patches are TBC so I can commit it. And after we have a rapport, even over a short amount of time, I'd be happy to add anyone.
Sam Mortenson:
So this is cool. Not just for your experience, but also your organization on drupal.org will get that project listed as they help fund or contribute to this project. And so it's good for everyone involved.
Mike Herchel:
I would like to volunteer Matt Kleve.
Sam Mortenson:
Great.
Matt Kleve:
All right. What am I volunteering to? I don't know. I was looking for some of these modules here, so I don't know if I picked out the most popular one, but file entity browser here has 245,000 downloads Mike, so they get the palladium Dropbox. I mean, there's a lot of popular stuff that gets used by the community fairly often without seeking co-maintainers. It sounds like Sam's a nice person. You should reach out and see what you can do, especially if you use the module.
Sam Mortenson:
One thing I just thought of is Mike, you maintain something called Quicklinks, right?
Mike Herchel:
I do. Yeah.
Sam Mortenson:
So as I was trying to build Tome sites that were really high-performing, I tried that out and it totally works with Tome, so there's a plug for one of your modules too, if you want a little fun performance boost.
Mike Herchel:
Yeah. Yeah. So for those that don't know, what Quicklinks does is it loads a JavaScript library and the JavaScript library will look through all the hyperlinks that's into view port of your monitor and it will tell the browser to download the HTML from all those modules. Basically-
Matt Kleve:
All those links.
Mike Herchel:
Yeah. Links. Thank you. And store it in the [inaudible 00:
9:
6] cash and it happens in the background and awaits to, I think, request idle call back or something like that, and it works really well. So yeah, I would guess that would work with Tome fairly well because it's mostly class side. That's awesome.
Matt Kleve:
And it wouldn't be bootstrapping Drupal, so your server wouldn't cry when it loaded 17 Drupal pages at once.
Mike Herchel:
Well, yeah. The way that the module works, if you do have Drupal installed, is it make sure that caching is enabled and it also disables itself if you're authenticated and it doesn't-
Matt Kleve:
Oh, good. So no crying. Awesome.
Mike Herchel:
Yeah, exactly. And also it explicitly denies itself from admin paths and everything like that.
Matt Kleve:
Very good.
Mike Herchel:
Cool. Well thanks for plugging my module. Maybe I'll get that one other download to knock it up one level.
Matt Kleve:
Is there anything else we should be talking about, about Tome there, Sam, or as we point toward wrapping this up. Anything else you want to add?
Sam Mortenson:
No. I mean really just trying the module out and seeing what it's like to commit content to code, because I guarantee that's new to every Drupal er out there. All that stuff. I think the main thing is a lot of people aren't interested in it, but just taking that step to take 15, 20 minutes out of your day and try it is hard. But if you can do it, that would be great.
Mike Herchel:
Well, thanks for coming on the podcast and talking about it. And I'd also like to thank you for all of your free open source software contributions because it's people like you that make Drupal such a powerful ecosystem in the community.
Mike Herchel:
Thank you.

If you enjoyed this Episode, you may also enjoy...

About host Matt Kleve

Portrait of Matt Kleve
Matt Kleve has been a Drupal developer since 2007. His previous work in the media sparks a desire to create lean, easy to use workflow processes.

About host Mike Herchel

Thumbnail
A senior front-end developer, Mike is also a lead of the Drupal 9 core "Olivero" theme initiative, organizer for Florida DrupalCamp, maintainer for the Drupal Quicklink module, and an expert hammocker