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

Component: Refactor kicker deck and title #7747

Closed
wants to merge 10 commits into from

Conversation

lcummings12
Copy link
Contributor

@lcummings12 lcummings12 commented Jun 28, 2024

Summary

To enhance clarity, a new partial called universal-header.html was created which is designed to handle the display logic for page headers.

Preview

New Component Production
Events page Events page
Guides Guides
Resources Resources

Solution

A new partial, guide-details.html, was created to separate the logic for guide headers from the main template. This partial is integrated into the existing guide-header.html.

How To Test

A correct implementation should have no visual differentiation from the production site. Attached are two images showing this.

  1. Run npm start
  2. visit any page in the guides/resources section on local server
  3. open the same page on the production site and compare the header

Dev Checklist

  • PR has correct labels
  • A11y testing (voice over testing, meets WCAG, run axe tools)
  • Code is formatted properly

@lcummings12 lcummings12 added the Dev: frontend ideas and issues related to the presentation layer of the site label Jun 28, 2024
@lcummings12 lcummings12 requested a review from nick-mon1 June 28, 2024 16:54
Copy link

🔍 Preview in Federalist

@nick-mon1 nick-mon1 requested review from klin2020 and ch-tyson July 1, 2024 15:26
Copy link
Contributor

@nick-mon1 nick-mon1 left a comment

Choose a reason for hiding this comment

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

@lcummings12 This is a good start. We should expand the scope of this card to cover all templates that use the kicker, title and summary fields.
Insted of just the guides page, each of the content/**/single.html templates use these fields.
It would be ideal to extract this into a page-header component that can be used for all templates pages and not just the guides.

I've updated the trello card description to expand the scope and provide some directions.

Note

We do not link trello cards in PR's to prevent access to our trello board. I've removed the link in the description.

The new page-header component should not include grid styles, we will set those in the template (single.html, list.html) that includes the component partial.

Sample Code

    {{- if .Params.kicker -}}
    <p class="kicker">{{- .Params.kicker -}}</p>
    {{- end -}}
    {{/* Page Title */}}
    <h1>{{- .Title | markdownify -}}</h1>

    {{/* Deck */}}
    {{- if .Params.deck -}}
    <div class="deck">{{- .Params.deck | markdownify -}}</div>
    {{- end -}}

Copy link
Contributor

@ch-tyson ch-tyson left a comment

Choose a reason for hiding this comment

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

Hi @lcummings12! Overall I think this is moving in the right direction. some suggestions below:

  • Consider renaming to something more generic, e.g. 'page-header.html' or 'page-details.html' to use in all single.html and list.html markup templates.
  • Add comments explaining usage and required parameters

@lcummings12 lcummings12 requested a review from nick-mon1 July 17, 2024 16:59
@brunerae brunerae changed the title Refactor kicker deck/title Component: Refactor kicker deck and title Jul 18, 2024
@nick-mon1
Copy link
Contributor

Closing, replaced by #7803

@nick-mon1 nick-mon1 closed this Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dev: frontend ideas and issues related to the presentation layer of the site
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants