Skip to content

Commit

Permalink
Merge pull request #139 from frees-au/feature/styling
Browse files Browse the repository at this point in the history
Feature/styling
  • Loading branch information
simesy authored Nov 21, 2024
2 parents e15fb22 + d6bf784 commit 6c8e719
Show file tree
Hide file tree
Showing 243 changed files with 4,913 additions and 3,007 deletions.
2 changes: 1 addition & 1 deletion .ddev/commands/host/frontend
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

ddev npm --prefix web/themes/custom/fstheme ci
ddev npm --prefix web/themes/custom/fstheme run build
ddev npm --prefix web/themes/custom/fstheme run build
5 changes: 5 additions & 0 deletions .ddev/commands/host/save
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

# Any site building changes should be captured.
ddev drush cex -y

# Trim unneeded table data.
echo "Removing cache data."
ddev drush sqlq " \
TRUNCATE cache_access_policy; \
Expand All @@ -17,6 +21,7 @@ ddev drush sqlq " \
TRUNCATE sessions; \
"

# Store the database on disc while it is small.
ddev export-db --file=_db_main.sql.gz

# So we can keep working.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 10 additions & 2 deletions .ddev/commands/web/generate-static-site
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#!/bin/bash

#drush search-api:clear article
#drush search-api:index article

rm -rf /var/www/html/static-site

GENERATE_STATIC_SITE=1 drush tome:static -vv --uri=https://frees.au
if [ "$1" == "--production" ]; then
GENERATE_STATIC_SITE=1 drush tome:static -vv --uri=https://frees.au
else
GENERATE_STATIC_SITE=1 drush tome:static -vv --uri=fs-web-static-site.ddev.site:8080
fi

# Need this one to make search api lunr works.
# Make sure Drupal site is fully index first.
cp -R "/var/www/html/web/sites/default/files/search-api-js" "/var/www/html/static-site/sites/default/files"
#cp -R "/var/www/html/web/sites/default/files/search-api-js" "/var/www/html/static-site/sites/default/files"
cp -R "/var/www/html/web/themes/custom/fstheme/stockart" "/var/www/html/static-site/themes/custom/fstheme"
88 changes: 88 additions & 0 deletions .ddev/nginx_full/fs-web-static-site.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Example configuration for a second docroot

#ddev-generated
# If you want to take over this file and customize it, rename it to <yourname>.conf,
# and remove the ddev-generated line above

server {
# Set the docroot to where it belongs in the codebase
root /var/www/html/static-site;
# Set the server_name so this config can be selected
# You'll need additional_hostnames["seconddocroot"] in config.yaml for this to work
server_name fs-web-static-site.ddev.site;

listen 80;
listen 443 ssl;

ssl_certificate /etc/ssl/certs/master.crt;
ssl_certificate_key /etc/ssl/certs/master.key;

include /etc/nginx/monitoring.conf;

index index.php index.htm index.html;

# Disable sendfile as per https://docs.vagrantup.com/v2/synced-folders/virtualbox.html
sendfile off;
error_log /dev/stdout info;
access_log /var/log/nginx/access.log;

location / {
absolute_redirect off;
try_files $uri $uri/ /index.php?$query_string;
}

location @rewrite {
# For D7 and above:
# Clean URLs are handled in drupal_environment_initialize().
rewrite ^ /index.php;
}

# pass the PHP scripts to FastCGI server listening on socket
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php-fpm.sock;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_intercept_errors off;
# fastcgi_read_timeout should match max_execution_time in php.ini
fastcgi_read_timeout 10m;
fastcgi_param SERVER_NAME $host;
fastcgi_param HTTPS $fcgi_https;
# Pass the X-Accel-* headers to facilitate testing.
fastcgi_pass_header "X-Accel-Buffering";
fastcgi_pass_header "X-Accel-Charset";
fastcgi_pass_header "X-Accel-Expires";
fastcgi_pass_header "X-Accel-Limit-Rate";
fastcgi_pass_header "X-Accel-Redirect";
}

# Expire rules for static content
# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|webp|htc)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}

# Prevent clients from accessing hidden files (starting with a dot)
# This is particularly important if you store .htpasswd files in the site hierarchy
# Access to `/.well-known/` is allowed.
# https://www.mnot.net/blog/2010/04/07/well-known
# https://tools.ietf.org/html/rfc5785
location ~* /\.(?!well-known\/) {
deny all;
}

# Prevent clients from accessing to backup/config/source files
location ~* (?:\.(?:bak|conf|dist|fla|in[ci]|log|psd|sh|sql|sw[op])|~)$ {
deny all;
}

include /etc/nginx/common.d/*.conf;
include /mnt/ddev_config/nginx/*.conf;
}
9 changes: 6 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
"version": "0.2.0",
"configurations": [
{
"name": "DDEV Xdebug",
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"hostname": "0.0.0.0",
"port": 9003,
"pathMappings": {
"/var/www/html": "${workspaceRoot}"
}
"/var/www/html": "${workspaceFolder}"
},
"preLaunchTask": "DDEV: Enable Xdebug",
"postDebugTask": "DDEV: Disable Xdebug"
},
{
"name": "Lando Xdebug",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ ddev frontend
Static tests run easily in the container.

```
ddev static # PHPStan and PHPCS.
ddev cypress # Currently hangs locally, working in Github Actions.
ddev test-static # PHPStan and PHPCS.
ddev test-cypress # Currently hangs locally, working in Github Actions.
```

Note that for Cypress E2E testing, the `ddev cypress` command works for us on
Expand Down
Binary file modified _db_main.sql.gz
Binary file not shown.
7 changes: 1 addition & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"require": {
"composer/installers": "^2.0",
"cweagans/composer-patches": "~2.0",
"drupal/admin_toolbar": "^3.4",
"drupal/better_exposed_filters": "^7.0",
"drupal/ckeditor5_template": "^1.0",
"drupal/config_ignore": "^3.2",
Expand All @@ -36,6 +35,7 @@
"drupal/redirect": "^1.9",
"drupal/search_api_lunr": "^3.0",
"drupal/simple_sitemap": "^4.1",
"drupal/twig_tweak": "^3.4",
"drupal/upgrade_status": "*",
"drush/drush": "^13",
"oomphinc/composer-installers-extender": "^2"
Expand Down Expand Up @@ -119,11 +119,6 @@
"composer-exit-on-patch-failure": true,
"patchLevel": {
"drupal/core": "-p2"
},
"patches": {
"drupal/webform": {
"[#3345590] Drush 12 moved the namespace": "./config/patches/webform_3345590_3.patch"
}
}
}
}
Loading

0 comments on commit 6c8e719

Please sign in to comment.