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

USWDS-Site: Enhance what's new page layout #3115

Open
wants to merge 26 commits into
base: al-whats-new-directory-change
Choose a base branch
from

Conversation

amyleadem
Copy link
Contributor

@amyleadem amyleadem commented Feb 18, 2025

Summary

Enhanced the layout and content on the What's new page to improve organization.

Note

This is a follow up to the prototype work in PR #3094. This PR:

  1. Refines the code from the prototype to meet standards.
  2. Isolates the changes into separate steps to reduce review burden. This PR includes only the layout updates.

Additionally, this PR builds on the updates found in PR #3064. Because of this, I propose the following merge order:

  1. USWDS-Site - What's new: Create posts_short directory and add new items #3064
    1. Adds short post content type and creates new posts
  2. USWDS-Site: Enhance what's new page layout #3115 (This PR)
    1. Updates the layout of the what's new and all news pages
  3. Add a consolidated What's New changelog view #3091
    1. Adds consolidated changelog and updates existing changelog data

Related issue

Closes #3113

Preview link

Major changes

  • Re-organized the layout for the what's new page and added new card content
  • Added variables in config.yml to set the current version of USWDS Compile and the USWDS design kit
  • Added a jump-links.html include
  • Added new include options for site cards and post previews

Testing and review

General

  1. Confirm the layout matches the approved prototype
  2. Confirm the layout looks good in different browsers and screen widths
  3. Confirm copy is free from error and matches the USWDS voice
  4. Confirm product version numbers are up-to-date
  5. Confirm all links work as expected
  6. Confirm news feed shows posts in the expected order (newest first)
  7. Confirm no regressions in post styles
  8. Confirm the header structure on both pages matches expectations

Devs

  1. Confirm code meets standards for reusability and readability
  2. Confirm no regressions in other implementations of the site-card include

Comment on lines -7 to -13
columns:
- title: New users
source: New Users
- title: Total users
source: Users
- title: Page views
source: Pageviews
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note

I removed this because I could not find it being used anywhere.

Comment on lines -26 to -27
changelog:
key: about-whats-new
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note

Removed the page's changelog to make room for the consolidated changelog.

Comment on lines 65 to 102
<div class="bg-gray-5 padding-3 margin-top-4">
<h2 class="whats-new__heading margin-top-0" id="latest-releases">Latest releases</h2>
<ul class="usa-card-group whats-new-card-group">
<li class="{{ product_grid_list_classes }}">
{% include site-card.html
subheading="Design system"
heading="USWDS"
body="The official U.S. design system, enabling the government to build fast, accessible, mobile-friendly websites."
linkText=uswds_link_text
linkUrl="https://github.com/uswds/uswds/releases"
subheadingElement="span"
linkClasses="padding-x-105"
%}
</li>
<li class="{{ product_grid_list_classes }}">
{% include site-card.html
subheading="Compilation tool"
heading="USWDS Compile"
body="A tool that makes it easy to customize and compile USWDS Sass into browser-readable CSS."
linkText=uswds_compile_link_text
linkUrl="https://github.com/uswds/uswds-compile/releases"
subheadingElement="span"
linkClasses="padding-x-105"
%}
</li>
<li class="{{ product_grid_list_classes }}">
{% include site-card.html
subheading="Design assets"
heading="USWDS for designers"
body="The official USWDS design kits in Sketch and Figma."
linkText=uswds_design_kit_link_text
linkUrl="https://www.design_kit.com/community/file/1440921849343185329"
subheadingElement="span"
linkClasses="padding-x-105"
%}
</li>
</ul>
</div>
Copy link
Contributor Author

@amyleadem amyleadem Feb 18, 2025

Choose a reason for hiding this comment

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

Note

I could not use site-card-list.html here because I needed to pull site data for this card content. I could not do this in the front matter. If you see a better way, let me know!

Copy link
Contributor

Choose a reason for hiding this comment

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

Confirming it's not possible to pass data into front matter in Jekyl without plugins or potentially hacky work arounds. This is something I've struggled with in the past.

Copy link
Contributor

Choose a reason for hiding this comment

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

Comment on lines +19 to +23
{% if include.category %}
<p class="post-category site-subheading">
{{ post.tags[0] }}
</p>
{% endif %}
Copy link
Contributor Author

@amyleadem amyleadem Feb 18, 2025

Choose a reason for hiding this comment

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

Note

On the main what's new page, I removed the tag eyebrow to conserve vertical real estate. I added it back in on the "All news and updates" page. Flag if you would like this changed.

Comment on lines +35 to +37
{% if include.date %}
{% include post-meta.html %}
{% endif %}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note

On the main what's new page, I removed the date to conserve vertical real estate. I added it back in on the "All news and updates" page. Flag if you would like this changed.

@amyleadem amyleadem marked this pull request as ready for review February 18, 2025 22:54
@amyleadem
Copy link
Contributor Author

@mejiaj @mahoneycm Tagging you both first for review to review the merge strategy outlined in the PR description and confirm that the approach makes sense. Additionally, I am interested in getting initial review of the code approach to identify if there is any major rework needed. I expect that there might be some content and design tweaks, but hoping the layout is nice and solid. Let me know if you have any questions!

Copy link
Contributor

@mahoneycm mahoneycm left a comment

Choose a reason for hiding this comment

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

A couple questions and an update to a link!

Overall, looking and working great 👍

Comment on lines 65 to 102
<div class="bg-gray-5 padding-3 margin-top-4">
<h2 class="whats-new__heading margin-top-0" id="latest-releases">Latest releases</h2>
<ul class="usa-card-group whats-new-card-group">
<li class="{{ product_grid_list_classes }}">
{% include site-card.html
subheading="Design system"
heading="USWDS"
body="The official U.S. design system, enabling the government to build fast, accessible, mobile-friendly websites."
linkText=uswds_link_text
linkUrl="https://github.com/uswds/uswds/releases"
subheadingElement="span"
linkClasses="padding-x-105"
%}
</li>
<li class="{{ product_grid_list_classes }}">
{% include site-card.html
subheading="Compilation tool"
heading="USWDS Compile"
body="A tool that makes it easy to customize and compile USWDS Sass into browser-readable CSS."
linkText=uswds_compile_link_text
linkUrl="https://github.com/uswds/uswds-compile/releases"
subheadingElement="span"
linkClasses="padding-x-105"
%}
</li>
<li class="{{ product_grid_list_classes }}">
{% include site-card.html
subheading="Design assets"
heading="USWDS for designers"
body="The official USWDS design kits in Sketch and Figma."
linkText=uswds_design_kit_link_text
linkUrl="https://www.design_kit.com/community/file/1440921849343185329"
subheadingElement="span"
linkClasses="padding-x-105"
%}
</li>
</ul>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Confirming it's not possible to pass data into front matter in Jekyl without plugins or potentially hacky work arounds. This is something I've struggled with in the past.

- title: Page views
source: Pageviews
lead: |
Stay up to date on the latest U.S. Web Design System (USWDS) product launches, learn how to use the design system, and dive deeper into our monthly call topics.
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: This is tipping into fine pen review but is learn how to use the design system appropriate here?

The links here seem less "how to" than other guidance pages on the site. Just a thought!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@finekatie @ceperkins Sending this comment to you for input.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mahoneycm to confirm, this isn't a blocker right?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say it's not meant literally as a "how to" page, but people can find their way from here to learn how to use the design system. @ceperkins would you agree?

Comment on lines 55 to 58
{% assign monthly_call = site.data.monthly-calls.videos[0] %}
{% capture monthly_call_heading %} {{ monthly_call.date }}: {{monthly_call.title}} {%- endcapture %}
{% capture monthly_call_image %} {{site.baseurl }}/img/uswds-logo/4c-lg-on-black.svg {%- endcapture %}
{% capture monthly_call_url %} {{ site.baseurl }}/about/monthly-calls {%- endcapture %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Praise: Very cool to see this working! Having this card be dynamic with the latest monthly calls is a great addition!

Co-authored-by: Charlie Mahoney <[email protected]>
@amyleadem
Copy link
Contributor Author

@finekatie and @ceperkins tagging you for review on the page copy and layout. Note that the changelog pieces from the prototype will be coming in a follow-on PR (but will all be released at the same time).

Let me know if you have questions!

Copy link
Contributor

@finekatie finekatie left a comment

Choose a reason for hiding this comment

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

Left comment about link to Figma releases page link.

heading="USWDS for designers"
body="The official USWDS design kits in Sketch and Figma."
linkText=uswds_design_kit_link_text
linkUrl="https://github.com/uswds/uswds-for-designers/releases"
Copy link
Contributor

Choose a reason for hiding this comment

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

My only issue with linking here is that the text says "USWDS design kits in Sketch and Figma" - but on the releases page I don't see anything about Sketch. That would confuse me if I was looking for the design kit for Sketch. What can we do?

Copy link
Contributor Author

@amyleadem amyleadem Feb 20, 2025

Choose a reason for hiding this comment

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

That's a good note. Wondering if we just need to add a line to the release notes to signal that Sketch still exists in the package, there just aren't any changes. Alternatively, we could consider shifting the card copy to be more focused on Figma. Curious to hear thoughts.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah this is a Dan/Matt question. Not a blocker though.

Copy link
Contributor

@mejiaj mejiaj left a comment

Choose a reason for hiding this comment

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

@amyleadem love the new look.

I've added a small comment to improve clarity of the new jump links include. This is the only issue I found.

Please take a look at the items marked polish or thought. These aren't required changes, but highlighting because they could have helped increase maintainability.

Copy link
Contributor

Choose a reason for hiding this comment

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

issue (non-blocking): We already have a jump links component in _includes/accessibility-tests/jump-links.html.

We should avoid repeating ourselves in the future and create a more flexible jump links component that can be reused. This would allow you to re-use the reduced motion styles and avoid setting them in multiple places, like accessibility-tests.html.

@@ -0,0 +1,25 @@
<!-- Turn on smooth scroll animation for anchor links -->
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: Can you add a comment with a brief description and where this is used?

Are there any settings related to this component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a comment in 84d5637

<ul class="site-checklist-jump-links">
{% for link in page.jump_links %}
<li>
<a href="#{{ link.href | default: link.text | downcase | slugify }}">
Copy link
Contributor

Choose a reason for hiding this comment

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

polish: Is downcase needed here? Slugify in Jekyll docs says it already handles lowercase.

Slugify

Convert a string into a lowercase URL "slug".

Suggested change
<a href="#{{ link.href | default: link.text | downcase | slugify }}">
<a href="#{{ link.href | default: link.text | slugify }}">

Copy link
Contributor

Choose a reason for hiding this comment

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

More polish: You could improve readability by saving this in a variable.

  {% for link in page.jump_links %}

    {% assign link_href = link.href | default: link.text | slugify %}

    <li>
      <a href="#{{ link_href }}">

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made these updates in 84d5637

<svg class="usa-icon" aria-hidden="true" role="img">
<use href="{{ site.baseurl }}/assets/img/sprite.svg#arrow_downward"></use>
</svg>
{{ link.text }}
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: If link.text is always available this is fine, but without checking for it you could run into issues.

For example
If it isn't passed you'll still have a list item, link, and icon but it'll be empty and the href will be broken (unless link.href exists).

Copy link
Contributor Author

@amyleadem amyleadem Feb 21, 2025

Choose a reason for hiding this comment

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

It feels to me like link.text should be mandatory here. Any objection to leaving it as is?


<{{ include.heading | default:"h2" }} class="post-preview__title">
<{{ include.heading | default:"h2" }} class="post-preview__title {{ include.headingClasses }}">
Copy link
Contributor

Choose a reason for hiding this comment

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

polish: Where's this class needed? What happens when headingClasses is empty?

I see an empty space in the what's new preview

<!-- about/whats-new/ -->
<h3 class="post-preview__title ">

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a conditional for include.headingClasses in 9961107

Copy link
Contributor

Choose a reason for hiding this comment

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

thought: Something for next time. This component could benefit from using capture to avoid having so many settings. It also gives flexibility to the author by using the markup that they need.

For example:

<!-- Set in template and passed to include. -->
{% capture card_heading %}
  <div>A subheading</div>
  <h3>The heading</h3>
{% endcapture %}


<!-- Component re-uses `card_heading`  -->
<header class="usa-card__header">
  {{ include.card_heading }}
</header>

Comment on lines 5 to 14
- heading: String heading for a single card.
- headingElement: The heading HTML element type.
- subheading: String subheading for a single card.
- subheadingElement: The subheading HTML element type.
- body: String body that gets placed in a paragraph tag.
- image: The card image.
- imageAlt: The alt tag for the image.
- linkUrl: String for the link url.
- linkText: String link label.
- linkClasses: Classes for the link element.
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: Are all these settings required or are some optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added notes about required vs optional in 5d18a6c

Comment on lines +50 to +109
.site-subheading {
color: color("gray-warm-10");
}

.usa-card__heading {
line-height: unset;
}

.usa-card__body,
.usa-card__header,
.usa-card__footer {
@include at-media("tablet") {
width: 100%;
}

@include at-media("desktop-lg") {
@include grid-col(7);
}
}

.usa-card__media {
@include u-padding(4);
background-image: url("../img/monthly_call_bg.png");
background-position-y: center;
background-size: 15rem;
display: flex;
justify-content: center;

@include at-media("tablet") {
position: relative;
width: 100%;
}

@include at-media("desktop-lg") {
@include grid-col(5);
@include u-padding(6);
position: absolute;
}
}

.usa-card__img {
background-color: initial;
max-width: 10rem;

@include at-media("desktop-lg") {
max-width: 15rem;
}
}

.usa-card__img img {
object-fit: initial;
}

.usa-button {
@include u-bg("gold-30v");
@include u-margin-top(1);
@include u-text("blue-warm-90");
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

issue (non-blocking): General partials, like typography and card, would have been better places for this.

One could unintentionally add conflicting global styles.

-->
{% assign monthly_call = site.data.monthly-calls.videos[0] %}
{% capture monthly_call_heading %} {{ monthly_call.date }}: {{monthly_call.title}} {%- endcapture %}
{% capture monthly_call_image %} {{site.baseurl }}/img/uswds-logo/4c-lg-on-black.svg {%- endcapture %}
Copy link
Contributor

Choose a reason for hiding this comment

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

polish: Using assign seems more appropriate for these short links.

Suggested change
{% capture monthly_call_image %} {{site.baseurl }}/img/uswds-logo/4c-lg-on-black.svg {%- endcapture %}
{% assign monthly_call_image = site.baseurl | append: '/img/uswds-logo/4c-lg-on-black.svg' %}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the captures to assigns in 333d592

Copy link
Contributor

@finekatie finekatie left a comment

Choose a reason for hiding this comment

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

I think the Figma/Sketch copy needs a look by Dan/Matt, and we might want to get their feedback on Charlie's question about "learn how to use the design system" but those are not blockers for me. I approve!

@amyleadem amyleadem requested a review from mejiaj February 21, 2025 20:43
@amyleadem
Copy link
Contributor Author

@mejiaj This is ready for your re-review

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.

USWDS-Site - What's new: Build production code for phase 2 prototype
5 participants