According to BuiltWith, there are more than 300,000 Drupal 7 sites! These Drupal 7 sites are likely mostly hosted on traditional Drupal hosting. Static hosting has the advantage that it's often cheaper than traditional hosting.
These are some of the reasons Quant has created a Drupal module for converting your Drupal 7 site to a static website decoupled from your CMS. Let's take a look at how to do this.
Install Quant Drupal Module
2. After adding the module, enable both the main Quant (
quant) module and the Quant API (
quant_api) submodule using
drush or the UI.
3. Adjust the permissions as needed.
Connect Drupal to Quant
4. Go to the Quant API page (
5. In another browser tab or window, go to the Quant Dashboard projects list.
6. Click the
clipboard icon for the project you want to use and paste it into the
API Token field.
7. Then copy the account name into the
API Customer field, and the project name into the
API Project field.
8. Click the
Save configuration button. You should see a confirmation message showing you have successfully connected to Quant.
Finish Module Configuration
9. Go to the Config tab (
10. Choose the options that you want. We recommend enabling
Track content changes so content will automatically be sent to Quant when changes are made. Checking the
Enable relative paths option will keep all the URLs as relative instead of absolute. If you don't have a
Hostname to use yet, this is particularly helpful, so the site shows up properly and the links work. You may also want to not send draft content to Quant.
11. Click the
Save configuration button.
Send Drupal Content to Quant
12. Now we just need to send content to Quant. Before this is done, if you click the
View preview URL in the Quant Dashboard for the project, you will see a
404 not found message.
13. Go to the Seed tab (
14. If you haven’t configured CSS and JS aggregation, you will see a warning to configure that for performance reasons, which is recommended. After you add aggregation, the warning message will go away.
15. Now choose the content you want to send to Quant. If you don’t have much content, you can try sending over all the content in one go by checking
Trigger the batch.
16. If you choose
Trigger the batch and then click the
Save configuration button, you will see a progress bar as it's sending content to Quant.
17. If that is not successful or you have a lot of content to send, you can uncheck that
Trigger the batch checkbox and click the
Save configuration button. Then, send the content over with
drush quant-seed and it will display the progress as it’s going.
18. Once all the content has been sent, your static site in Quant should look the same as what’s in Drupal. The only caveats are if you have any dynamic features that aren’t yet supported. Contact us, if so, since we might add the extra features to the module!
1. If you go to your preview site in Quant and get a
404, that usually means you have not pushed your content to Quant yet. It can also mean the home page was not pushed over. You can check the Content list in the Dashboard to see what content has been synced.
2. If after "seeding" the site, the content is there but not themed, you likely have the
Hostname set incorrectly on the Drupal
Config tab or you are not using the
Enable relative paths option.
3. If after "seeding" the site, the content is there but some images do not show up, this might be because you are using image styles but not all the Drupal site pages have been viewed yet. Image styles are only created when the page is viewed (or by manually getting them to generate with other tools). A simple fix is to use
wget to recursively crawl your Drupal site so that all the image styles are generated before you push the content to Quant.
Hope you found this tutorial helpful for configuring Quant in Drupal 7. There is more Quant documentation on our docs site including our Drupal docs section. If you have questions, want to request features, or have any problems, you can create issues in the QuantCDN Drupal.org project or in the QuantCDN Drupal GitHub repo. You are also welcome to contact us through this site, use the chat feature below, or create a ticket in the support desk.