Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace static CSS/script imports with Drupal placeholder tokens #717

Merged
merged 2 commits into from
Jan 31, 2024

Conversation

greg-does-weather
Copy link
Collaborator

What does this PR do? 🛠️

  • Defines libraries in our theme so we can import them via name
    • uswds-init is for the init script, so we can specify that it goes in the head
    • uswds-customized for our built styles.css and the USWDS scripts
    • location-search for powering the location search
    • localize-timestamps for powering localization of timestamps
  • Updates our theme to, by default, import the two USWDS-related libraries on every page
  • Updates our html.html.twig template to remove the static <link> and <script> tags
  • Manually attach the location-search and localize-timestamp libraries in the twig templates that need them, so they only get loaded on relevant pages

Going forward, if there are scripts that only need to appear in certain places, this may be a template for how we can do that.

closes #234

What does the reviewer need to know? 🤔

make cc may be enough, but the theme cache has to be cleared out in order for Drupal to re-read the libraries stuff.

Screenshots (if appropriate): 📸

n/a because nothing should have changed from the user's perspective

Copy link
Collaborator

@eric-gade eric-gade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a quick approval without checklist here -- this looks good to me. Good that location search is now only on the relevant pages.

@greg-does-weather greg-does-weather added this pull request to the merge queue Jan 31, 2024
Merged via the queue into main with commit 1dcca10 Jan 31, 2024
10 checks passed
@greg-does-weather greg-does-weather deleted the mgwalker/234-drupal-placeholders branch January 31, 2024 22:33
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace static css and js link tags with Drupal placeholder_token
2 participants