unocha / starterkit
Starterkit
Requires
- php: >=8.2
- composer/installers: ^2
- cweagans/composer-patches: ^1.7
- drupal/admin_denied: ^2.0
- drupal/allowed_formats: ^3.0
- drupal/amazon_ses: ^3.0
- drupal/components: ^3.0@beta
- drupal/config_filter: ^2.4
- drupal/config_split: ^2.0@rc
- drupal/core-composer-scaffold: ^10
- drupal/core-dev: ^10
- drupal/core-recommended: ^10
- drupal/dynamic_entity_reference: ^3.1
- drupal/environment_indicator: ^4.0
- drupal/imageapi_optimize_binaries: ^1.0@beta
- drupal/imageapi_optimize_webp: ^2.0
- drupal/imagemagick: ^4
- drupal/layout_paragraphs: ^2.0
- drupal/mailsystem: ^4.4
- drupal/maintenance200: ^2
- drupal/memcache: ^2.5
- drupal/metatag: ^2.0
- drupal/paragraphs: ^1.16
- drupal/pathauto: ^1.8
- drupal/redirect: ^1.8
- drupal/seckit: ^2.0
- drupal/social_auth_hid: ^4
- drupal/stable: ^2.0
- drupal/stage_file_proxy: ^3
- drupal/user_display_name: ^1.1
- drupal/user_expire: ^2
- drupal/username_enumeration_prevention: ^1.3
- drupal/xmlsitemap: ^1.4
- drush/drush: ^12
- oomphinc/composer-installers-extender: ^2.0
- orakili/composer-drupal-info-file-patch-helper: ^1
- unocha/common_design: ^9
- unocha/gtm_barebones: ^1.1
- unocha/ocha_monitoring: ^1.0
Requires (Dev)
- davidrjonas/composer-lock-diff: *
- drupal/coder: ^8.3
- drupal/config_inspector: ^2.1
- drupal/devel: ^5.0
- drupal/devel_php: ^1.3
- kint-php/kint: ^5
- marcocesarato/php-conventional-changelog: *
- mglaman/drupal-check: ^1.4
- palantirnet/drupal-rector: ^0.20
- phpcompatibility/php-compatibility: ^9.3
- phpmd/phpmd: ^2.9
- phpspec/prophecy-phpunit: ^2
- phpunit/php-code-coverage: ^9.2
- phpunit/phpunit: ^9.5
- weitzman/drupal-test-traits: ^2
Conflicts
- dev-develop
- dev-update/patch-26bd3bc
- dev-main
- dev-deploy-20240917
- dev-OPS-10867-tools
- dev-cafuego/ops-10706-php-errorgrep
- dev-update/patch-8043303
- dev-OPS-10254-revert-action-branch
- dev-update/patch-4d251cf
- dev-OPS-9749-bump-mysql-image-in-tests
- dev-update/patch-3cb403f
- dev-update/patch-845d211
- dev-cafuego/feat-composer-branch
- dev-update/patch-6fc35da
- dev-cafuego/ops-9523-amazon-ses
- dev-remove-pathauto-patch-file
- dev-update/patch-9700e0b
- dev-update/patch-ca7bf09
- dev-update/patch-8dfceb2
- dev-update/patch-a584ce8
- dev-OPS-9227-update-local-stack
- dev-cafuego/ops-9377-security-annoy
- dev-D9
- dev-composer-updates
This package is auto-updated.
Last update: 2024-12-26 08:09:09 UTC
README
TL;DR
When starting, make sure you bootstrap your site with the "minimal" install profile and the default config that ships with this repository:
drush si minimal --existing-config
Ok, but tell me more.
Drupal 10 version
This is a sample Drupal site repository. It contains all the basics to get you started with a brand new Drupal 10 site that uses the UN-OCHA Common Design theme.
See https://humanitarian.atlassian.net/browse/OPS-7611
Use composer create-project
to install after cloning or composer create-project unocha/starterkit
Then run scripts/setup.sh
(see What to change? below).
The Drupal 9 version is in the D9 branch.
What to change?
Several files need to be changed to replace starterkit
with your project name etc.
You can run the scripts/setup.sh
script to do that for you.
./scripts/setup.sh "site.prod.url" "Site Name" "project-name"
For example, for Common Design site:
./scripts/setup.sh "web.brand.unocha.org" "Common Design" "common-design-site"
The setup script will also copy a github action to build docker images on develop
, feature
and main
branches.
README
Well, obviously, this README file needs to be updated with information relevant to your project.
Github workflows
Edit the following files, replacing starterkit
with your project name (ex: my-website
):
Docker
Edit the following files:
- docker/Dockerfile --> change
starterkit.prod
to your production site URL. - Makefile --> change
starterkit
to your project name (ex:my-website
).
Composer
Edit the composer.json
file with your project name, authors etc.
Use composer require package
and composer remove package
to add/remove packages (ex: drupal/group
).
Tests
Edit the following files, replacing starterkit
with your project name (ex: my-website
):
Site configuration
Edit the Drupal site configuration to set up the site name (can be done via the Drupal UI as well).
Local stack
See the Running the site section below.
Recommended modules
Here's a list of commonly used modules among the UN-OCHA websites.
Components
Used with the Common Design theme.
Social auth humanitarian id
For logging in through HID
Admin Denied
Prevent login as user 1
Imagemagick
Faster and more memory efficient image handling
Pathauto
For better urls
GTM Barebones
User expire
Automatically “block” inactive users
Username Enumeration Prevention
Paragraphs
Many UN-OCHA websites use the paragraphs
module and related ones to structure the content of the site.
This is enabled by default as of 2023-01-19.
Layout Paragraphs provide better editor UX for Paragraphs.
Use these Form Display settings for each Paragraphs field you add to the site:
- Preview view mode: Preview
- Maximum nesting depth: 0
- Require paragraphs to be added inside a layout: FALSE (unchecked)
- Placeholder message when field is empty: [blank string]
XML Sitemap
To help search engines index your website, the xmlsitemap
can help generate and submit a site map of your content.
This is enabled by default as of 2023-01-19 but no sitemap is configured.
Note: you may want to edit the assets/robots.txt.append file to indicate the URL of your sitemap:
# Sitemap
Sitemap: https://my-website-domain/sitemap.xml
Groups
The group
and related modules help create collections of content and users with specific access control permissions.
Theme switcher
The theme_switcher
module helps control which theme to use on which pages.
Field groups
The field_group
module helps organizing fields in a form.
Patches
See the patches/notes.md about Drupal 10 compatibility patches etc.
Running the site
You should create a proper standard environment stack to run your site.
But in the meantime the local directory contains what is necessary to quickly create a set of containers to run your site locally.
Run ./local/install.sh -h
to see the script options.
Updating this repository
- Update dependendices etc. in the composer.json file
- Create a local instance by running
./local/install.sh -m -i -c
- Log in this new instance and enable/disable/configure the modules and site
- Export the configuration (ex:
docker exec -it starterkit-local-site drush cex
) - Create a Pull Request with the changes
- Stop and remove the containers with
./local/install.sh -x -v
Note: do not forget to set up your local proxy to manage the starterkit-local.test
domain.