GSA / digitalgov.gov

Digital.gov: Better websites. Better government.
https://digital.gov
Other
218 stars 299 forks source link

Header refactoring #7803

Closed lcummings12 closed 1 month ago

lcummings12 commented 1 month ago

Summary

Modularize header files in a way similar to the current configuration of guide-header.html, implement a header-stack.html component, which consists of the title/deck/kicker.

Preview

Link to Preview

Solution

The solution implements the header-stack.html partial, which handle two new parameters append_community and hide_kicker. The append_community parameter appends "Community" to the title, and the hide_kicker parameter conditionally hides the kicker text. The community page template was updated to utilize these parameters. These parameters are needed to assure the community template can maintain the unique aspects of its appearance while still adhering to the modular setup of the components.

header-stack renders the common elements of the headers, the title, kicker, and deck. Parameters for hiding specific aspects of the component are included to allow for a flexible setup.

The resources-header and communities-header are modeled after the guides-header setup which separates the header from the single.html file. Changes consist solely of refactoring and have no change in appearance.

How To Test

Description Original URL Updated URL
Communities Original Communities Updated Communities
Event Original Event Updated Event
Resources Original Resources Updated Resources
News Original News Updated News
Guides Original Guides Updated Guides

Before opening this PR, make sure you’ve done whichever of these applies to you:

github-actions[bot] commented 1 month ago

:mag: Preview in Federalist

lcummings12 commented 1 month ago

@nick-mon1 I integrated page-header into the _default, communities, events, news, guides, and resources templates.

As we discussed last week, removed the redundant *-header components that were needless since they aren't reused, and added the logic directly back into the templates. I kept the guide-header partial as its used in multiple templates and was originally there.

I updated table with the most recent version of the pages. Thanks!