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 - What's new: Update post preview structure and styles #2979

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

amyleadem
Copy link
Contributor

@amyleadem amyleadem commented Nov 20, 2024

Summary

Updated the post previews on what's new page. This PR changes the styling of the post previews and also allows for custom urls in the preview header link via preview_url.

Example:

preview_url: https://github.com/uswds/uswds/releases/tag/v3.9.0

Important

This PR includes sample posts to demo content. We need to remove all of the changed files inside the _posts/ directory before merge. Removed demo posts in 61aaf20

Related issue

Closes #2953

Preview link

Problem statement

Content limitations:

  • The News and Updates feed is limited to posts only. The current post preview structure cannot accommodate a "blurb" content type that links to a non-post location.

Usability concerns:

  • Visually, post previews are very large. The large header text and vertical margins can make content difficult to scan.
  • Previews have two links that use different text for the same link location.

Accessibility concerns:

  • Post preview header is a link but doesn't look like one.
  • All post previews have the same generic "Continue reading" link text. This can make it hard for screen reader users to know where the link goes.
  • Post previews use a heading level that doesn't fit in the page hierarchy. The post previews use an h1 header for each post. This does not match the page hierarchy. The "What's new" page post previews should use an h3 and the "All news and updates" page should use an h2.
  • Posts have an unnecessary <article> wrapper. This makes sense for post previews, but not the post pages themselves.

Solution

image

Post previews:

Condensed the size of the previews and updated the structure to allow new content types:

  • Created the ability to designate a link for the preview to point to instead of a post. You can now use the preview_url data key in the pages front matter to set an alternate URL for the header link.
  • Removed the CTA link at the bottom of the preview post. Instead, we now rely only on the header link.
  • Updated header link styles to be smaller and look like links. They are now smaller, bolder, and show a text underline
  • Converted h1 headers to match the page hierarchy. They now are either an h2 or h3, depending on the page.
  • Shrunk vertical margins across the page.
  • Lightened the border between post previews.
  • Moved the date below the post.

Posts

  • Removed the wrapping <article> from the post page

Code

  • Created post-preview.html and pulled out all the "excerpt" conditionals from post.html. This was done to improve readability.
  • Moved utility classes from post.html to Sass

Testing and review

  • Confirm the structure of the post previews makes sense
  • Confirm the styles for the post previews make sense
  • Confirm no regressions in the styles or visual structure of posts

Accessibility

Post previews

  • Confirm header link styles meet a11y standards
  • Confirm header hierarchy meets standards

Posts

  • Confirm no a11y regressions on the post pages

@amyleadem amyleadem changed the title Al whats new post previews USWDS-Site - What's new: Update post preview structure and styles Nov 21, 2024
@amyleadem amyleadem marked this pull request as ready for review November 21, 2024 17:44
@amyleadem amyleadem requested a review from a team as a code owner November 21, 2024 17:44
Copy link
Contributor

@jaclinec jaclinec left a comment

Choose a reason for hiding this comment

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

Looks great! The only thing I wonder about is if we should display the date under the title and authors of each post, instead of at the bottom. I'm not sure I have a strong opinion either way, but wonder if there are considerations for screen reader users and zoom magnification users. Would it be better to display the date under the title/authors?

@amyleadem
Copy link
Contributor Author

I moved the date above the post summary text. This is ready for re-review.

jaclinec
jaclinec previously approved these changes Nov 22, 2024
Copy link
Contributor

@jaclinec jaclinec left a comment

Choose a reason for hiding this comment

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

LGTM!

finekatie
finekatie previously approved these changes Nov 22, 2024
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.

looking great! approved.

@amyleadem
Copy link
Contributor Author

@mejiaj and @mahoneycm, I believe I have addressed all of your comments. This is ready for re-review.

@amyleadem
Copy link
Contributor Author

Update: I just restored the <article> wrapper based on @alex-hull's recommendation in this comment.

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.

Overall LGTM, added some non-blocking comments. I can approve once resolved.

If you feel any don't apply or will be done in future work, feel free to resolve with a comment stating that.

Copy link
Contributor

Choose a reason for hiding this comment

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

praise: Much cleaner template, nice work.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was going to say the same thing! Great work here Amy!

_posts/2024-10-17-uswds-3.9.0.md Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

question: This is notional content too, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, these posts are all just notional content to demonstrate potential content types and test the new option to add a preview url.

Comment on lines +30 to +32
&__content p {
@include u-font("lang", "xs");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

polish: This doesn't make much of a difference and could mean one less style to maintain.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair. I like that it adds a tiny bit more visual hierarchy, but happy to remove it if that is the team's preference. It is not a must-have for me.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's really a tiny difference of 15.04px → 16px.

mejiaj
mejiaj previously approved these changes Nov 26, 2024
mahoneycm
mahoneycm previously approved these changes Nov 27, 2024
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.

LGTM! Great work here Amy!

Copy link
Contributor

Choose a reason for hiding this comment

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

I was going to say the same thing! Great work here Amy!

@finekatie finekatie added the Affects: Content Relates to content label Nov 27, 2024
finekatie
finekatie previously approved these changes Nov 27, 2024
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.

Thinking this looks really good! Approved.

@amyleadem
Copy link
Contributor Author

@annepetersen and @thisisdano, this is ready for your review.

Copy link
Contributor

@annepetersen annepetersen left a comment

Choose a reason for hiding this comment

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

Completely a content item, but I'd love to stop using "Here is" or "Here you can" from the lead of any page. You can usually omit it and still accomplish what the lead needs to do. Tagging @finekatie to maybe include this in voice/tone/guide materials we're intermittently working on.

Not a blocker.

Otherwise, looks good! Would obvs need a changelog and real first post, replacing any notional material. 😅

@finekatie
Copy link
Contributor

Completely a content item, but I'd love to stop using "Here is" or "Here you can" from the lead of any page. You can usually omit it and still accomplish what the lead needs to do. Tagging @finekatie to maybe include this in voice/tone/guide materials we're intermittently working on.

Not a blocker.

Otherwise, looks good! Would obvs need a changelog and real first post, replacing any notional material. 😅

Hi @annepetersen , I'd recommend taking it out and tweaking so the first sentence reads "Get the latest USWDS news and information here."

I've also drafted a bunch of posts (see #2989) for the page and to edit/approve content - some of which are already in the preview. There are three more for November and we can add more with the monthly call content as that's approved. :)

@amyleadem amyleadem dismissed stale reviews from finekatie, mahoneycm, and mejiaj via e9f2d18 November 29, 2024 17:48
@amyleadem
Copy link
Contributor Author

Update:

  • I updated the lead text according to @finekatie's recommendation (2b25d81)
  • I removed the notional posts to prepare for merge (I'll add a screenshot below for visual reference for the different post types) (61aaf20)
  • I did not include a changelog because none of the content meaning was changed on the page - only the styles and code structure. Let me know if you think it needs a changelog afterall.

Screenshot of styles for different post types:

image

@finekatie finekatie self-requested a review November 29, 2024 18:36
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.

This works! Approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Affects: Content Relates to content
Projects
None yet
Development

Successfully merging this pull request may close these issues.

USWDS-Site - What's new: Update post preview styles
8 participants