Skip to content

Commit 7d91764

Browse files
authored
Gennerate static site (#131)
1 parent 1833511 commit 7d91764

File tree

8 files changed

+221
-2
lines changed

8 files changed

+221
-2
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
rm -rf /var/www/html/static-site
4+
5+
GENERATE_STATIC_SITE=1 drush tome:static --uri=https://frees.au
6+
7+
# Need this one to make search api lunr works.
8+
# Make sure Drupal site is fully index first.
9+
cp -R "/var/www/html/web/sites/default/files/search-api-js" "/var/www/html/static-site/sites/default/files"

.ddev/config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ docroot: web
44
php_version: "8.3"
55
webserver_type: nginx-fpm
66
xdebug_enabled: false
7-
additional_hostnames: []
7+
additional_hostnames:
8+
- fs-web-static-site
89
additional_fqdns: []
910
database:
1011
type: mariadb

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"require-dev": {
5757
"drupal/coder": "^8.3",
5858
"drupal/core-dev": "^10.1",
59+
"drupal/tome": "^1.12",
5960
"mglaman/phpstan-drupal": "^1.2",
6061
"palantirnet/drupal-rector": "^0.20.1",
6162
"phpstan/extension-installer": "^1.3",

composer.lock

Lines changed: 182 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/sync/core.extension.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ module:
6363
taxonomy: 0
6464
text: 0
6565
token: 0
66+
tome_base: 0
67+
tome_static: 0
6668
toolbar: 0
6769
twig_remove_html_comments: 0
6870
update: 0

web/sites/default/settings.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,7 @@
4747
if (file_exists($app_root . '/' . $site_path . '/local.settings.php')) {
4848
include_once $app_root . '/' . $site_path . '/local.settings.php';
4949
}
50+
51+
if (getenv('GENERATE_STATIC_SITE')) {
52+
include_once $app_root . '/' . $site_path . '/tome.settings.php';
53+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
parameters:
2+
http.response.debug_cacheability_headers: false
3+
twig.config:
4+
debug: false
5+
auto_reload: false
6+
cache: true
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
/**
4+
* @file
5+
* Tome configuration.
6+
*/
7+
8+
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/default/tome.services.yml';
9+
10+
$config['system.performance']['css']['preprocess'] = TRUE;
11+
$config['system.performance']['js']['preprocess'] = TRUE;
12+
13+
$config['system.logging']['error_level'] = 'hide';
14+
15+
$settings['tome_static_directory'] = '../static-site';

0 commit comments

Comments
 (0)