2.3 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What this is
A Drupal 10+ custom theme named "Olivesnews" — a fork of Drupal's Olivero theme, customized for the Island Newspapers project (newspapers2.islandarchives.ca). It includes extensive PHP hook implementations and Twig template overrides. CSS and JS are written as vanilla files with no build step.
Commands
Deployment is via deploy.sh — it pushes to Git remote, then SSHes into the server to pull and run drush cr.
Architecture
Drupal integration layer
olivesnews.theme— all PHP hook implementations:hook_preprocess_*,hook_theme_suggestions_*,hook_form_alter, etc. This is the primary PHP entry point.theme-settings.php— admin UI form for theme settings (color schemes, header utilities).src/OlivesnewsPreRender.php— trusted prerender callbacks (must be a class method in Drupal to be trusted).olivesnews.libraries.yml— defines ~25 named asset libraries; controls which CSS/JS files load and their dependencies. Edit this when adding new assets.olivesnews.info.yml— theme metadata, region definitions, and library overrides (replaces core Drupal CSS/JS with theme versions).olivesnews.breakpoints.yml— responsive breakpoints used by Drupal's responsive image module.config/— exported Drupal configuration;install/runs on theme enable,optional/is applied conditionally.
Frontend assets
css/— vanilla CSS, organized asbase/(variables, fonts, reset),components/(buttons, nav, forms, etc.),layout/, andtheme/.js/— vanilla JS, one file per behavior. Key files:navigation.js,second-level-navigation.js,nav-resize.js,search.js.- Files are edited and committed directly — no build step required.
Templates
templates/ mirrors Drupal's template suggestion hierarchy. Subdirectories map to entity/element types: block/, content/, field/, layout/, navigation/, views/, etc.
Mirador integration
The theme includes custom config and JS (js/mirador-mods.js, config/mirador_config/) for the Islandora Mirador IIIF image viewer.
Key conventions
- After any PHP or template change in Drupal, a cache clear (
drush cr) is required before changes are visible.