This document provides instructions on how to interact with this development repository.
Please refer to the primary README.md for detailed information on setting up your local development environment.
Before starting, ensure you have reviewed the documentation for UI kit and Drupal theme.
- Make sure that you have latest versions of all required software installed:
- Make sure that all local web development services are shut down (Apache/Nginx, Mysql, MAMP etc).
- Checkout project repository (in one of the supported Docker directories).
pygmy upahoy build
Copy docker-compose.override.default.yml to docker-compose.override.yml.
The following steps outline the build process:
- Construct a fresh Drupal 10 site from the GovCMS Drupal profile. Utilize
ahoy provisionfor a rebuild. - Activate additional modules needed for development by installing the
civictheme_devmodule. - Enable the
civicthemetheme and import its configuration. - Generate a
civictheme_demosub-theme using the provided scaffolding script and set it as the default theme. - Activate the
civictheme_adminmodule for enhancements in the admin UI. - Activate the
civictheme_govcmsmodule to discard pre-configured GovCMS content types. - Enable the
civictheme_contentmodule to incorporate default content into the installation.
Scripts located in scripts/custom execute after the site installation from
the profile, following the order of their numbering.
By default, the site:
- Installs Drupal 10.
- Installs the
govcmsprofile. - Installs the CivicTheme Drupal theme.
- Creates and installs the CivicTheme Demo sub-theme.
- Provides demo content.
Override the default behavior using these environment variables:
DRUPAL_PROFILE=minimal- Uses theminimalprofile for installation. For Drupal 10, this becomes the enforced default.CIVICTHEME_SUBTHEME_ACTIVATION_SKIP=1- Omits activation of the demo sub-theme.CIVICTHEME_GENERATED_CONTENT_CREATE_SKIP=1- Skips the creation of demo content.
These variables can be set prior to the ahoy provision command or added
to .env.local file to preserve this behavior (run ahoy up to apply
without full rebuild).
Example:
# Install Drupal site using `minimal` profile with CivicTheme.
# Do not create a sub-theme and do not provision demo content.
CIVICTHEME_SUBTHEME_ACTIVATION_SKIP=1 CIVICTHEME_GENERATED_CONTENT_CREATE_SKIP=1 ahoy provisionTo compile all assets in all themes: ahoy fe
# UI kit
cd web/themes/contrib/civictheme/lib/uikit
npm run build
# CivicTheme Drupal theme
cd web/themes/contrib/civictheme
npm run build
# CivicTheme Drupal Demo theme
cd web/themes/custom/civictheme_demo
npm run buildConfiguration is captured using Config Devel module for:
- CivicTheme theme into
config/installandconfig/optionaldirectories. - Development
civictheme_devmodule'sconfig/installandconfig/optionaldirectories.
ahoy export-configTo add new configuration to the export, add configuration name to civictheme.info.yml.
Tip: You can get the configuration name by exporting configuration with drush cex -y
to config/default and using file names without .yml extension. Do not forget
to remove all exported configuration files from config/default or the next site
install will fail. But this all is already handled in ahoy export-config.
Note: Configuration for blocks in civictheme will be copied to civictheme_demo on
installation of civictheme_demo. We do not capture configuration for civictheme_demo.
Exclude certain configuration from automatically be added to civictheme.info.yml
by adding records to theme_excluded_configs.txt.
Note that wildcards are supported.
Configuration validation allows to ensure that all configuration is captured correctly and that there is no conflicting or duplicating configuration was added to the codebase.
ahoy lint-configContent profiles are used to capture content for the industry-specific demo
sites. Each content profile is a separate submodule of civictheme_content
module that contains content and configuration required to build a demo site.
See main README.md for a list of demo site URLs.
The workflow to update the content within a content profile consists of 3 steps:
- Install a site with the desired content profile.
- Making changes
- Exporting content and configuration.
These steps are captured below:
# Step 1: Install a site with the desired content profile.
export CIVICTHEME_CONTENT_PROFILE=default
DRUPAL_PROFILE=minimal CIVICTHEME_SUBTHEME_ACTIVATION_SKIP=1 CIVICTHEME_GENERATED_CONTENT_CREATE_SKIP=1 ahoy provision
# Step 2: Make changes.
# ...
# Step 3: Export content and configuration.
ahoy export-content