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: Create posts_short directory and add new items #3064

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

Conversation

amyleadem
Copy link
Contributor

@amyleadem amyleadem commented Jan 15, 2025

Summary

  • Created an alternative directory for "short posts", which are entries to the news feed that do not have a related posts page. These short posts include a header, a short summary, and a link to another (non-posts) location.
    • To do this, I added a _/posts_short directory to the site and moved all "what's new" content that did not have an attached post to this directory.
    • The items inside _posts_short will be integrated with the items inside _posts in the "What's new" feed.
  • Added multiple post files to the What's new page for October and November.

Important

The build failures in this PR should be fixed by #3088

Related PR

Note

This PR is a replacement for #3056, which did not include any technical work and just added new content to the "what's new" page. However, we realized additional dev work was needed to get these items to build correctly. This PR incorporates both the new content and the technical fixes.

Related issue

Closes #2989

The README instructions for creating posts and post-previews will be added in #3047.

Preview link

Problem statement

Outdated content on what's new page

What's new page is out of date after recent page merge and reworking how content can be added. Need new news items added.

Post previews added to _posts generated empty pages

Adding preview-only items to the /_posts directory caused the site to build empty posts, which is unnecessary and bad for SEO.

Solution

Outdated content on what's new page

Blurbs were written up for events from October and November, reviewed and approved with feds and posts were created.

Post previews added to _posts generated empty pages

We created a separate collection for /_posts_short and set the output for this collection to false. This means that no pages will be generated for these files.

Anatomy of a short post

image

Example data structure for short posts with a link

---
title: USWDS 3.9.0 is out now
tags:
 - Releases
excerpt: USWDS version 3.9.0 is out now!
preview_url: https://github.com/uswds/uswds/releases/tag/v3.9.0
---

Example data structure for short posts without a link

---
title: Sunsetting the USWDS 1.0 documentation site
tags:
 - Product updates
excerpt: It's been over five years since we launched USWDS 2.0 and moved on from USWDS v1. We archived the USWDS v1 documentation site a few years back, and at the end of 2024 we'll be taking it offline. Content will likely still be available via archive.org.
preview_url: none
---

Testing and review

Content

  • Confirm the content is correct and relevant and links work.
  • Confirm the "Sunsetting the USWDS 1.0 documentation site" renders as expected (with no link in the header)
  • Confirm posts are appearing in the expected order

Devs

  • Confirm the what's new feed incorporates items from both /_posts and /_post-previews in the expected sort order
    • Because of its assigned date of 12/01/2024, the "Post test" item should appear in the feed in between "November monthly call Q&A" and "USWDS Figma design kit beta is live". Screenshot of expected order:
      image
  • Confirm pages are NOT generated for items in /_post-previews
  • Confirm pages are generated for items in /_posts
    • For example, Post test should exist and have expected content
  • Confirm no link is added to the "Sunsetting the USWDS 1.0 documentation site" preview on the All news and updates page
  • Confirm the directory structure and "post_previews" name is intuitive and makes sense
  • Confirm the code meets standards

finekatie and others added 30 commits January 9, 2025 18:18
Added October Accessibility discussion update.
Added update about sunsetting 1.0
Adding November accessibility discussion blurb
Added november 3.10.0 release blurb
Added blurb about Figma design kit beta
Added November monthly call blurb
added tag so it will appear
Added tag so it'll display on the page
Added tag so it'll display on the page
Added tag so it'll display on the page
corrected my markup on tags
corrected my markup on tags
Added tag so it'll display on the page
Added tag so it'll display on the page
Added tag so it'll display on the page
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.

Functionally everything looks good. Added some suggestions.

From the description, it wasn't immediately clear what this meant:

“Turned on the ability for "post previews" to not have a link in the header.”
What's the default behavior? What use case is this for? Is there an example?

_config.yml Outdated
Comment on lines 80 to 81
post_previews:
output: false
Copy link
Contributor

Choose a reason for hiding this comment

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

polish: It'd be nice to name this something more accurate. It could be easily misinterpreted and potentially confusing with post_previews. It's a short news update or blurb, not a post preview because there is no post.

Possible ideas

  • post_short
  • post_blurb
  • update
  • note
  • quick_post
  • post_quick

(Open to other ideas)

_includes/post-preview.html Outdated Show resolved Hide resolved
_post_previews/2024-10-17-uswds-3.9.0-is-out.md Outdated Show resolved Hide resolved
_post_previews/2024-10-19-a11y-discussion-october.md Outdated Show resolved Hide resolved
amyleadem and others added 2 commits January 21, 2025 07:21
Co-authored-by: James Mejia <james.mejia@gsa.gov>
@amyleadem amyleadem changed the title USWDS-Site - What's new: Create post_previews directory and add new items USWDS-Site - What's new: Create posts_short directory and add new items Jan 21, 2025
@amyleadem amyleadem requested a review from mejiaj January 21, 2025 15:22
mahoneycm
mahoneycm previously approved these changes Jan 21, 2025
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.

This is looking good to me!

  • News feed contains both posts and posts-short content
  • Blank pages are not generated for posts-short content
  • Pages are appropriately generated for posts content
  • Approach taken is logical and matches code standards

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.

Minor comments, otherwise LGTM.

pages/whats-new/all-news.md Show resolved Hide resolved
_config.yml Show resolved Hide resolved
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.

It looks to me in preview like the post test item is still linking to a page. I don't think the intended change is working. I'm not sure where to comment in the code lines.

Co-authored-by: James Mejia <james.mejia@gsa.gov>
@amyleadem
Copy link
Contributor Author

@finekatie This is actually the expected behavior because that test is coming from the "posts" directory rather than the "posts_short" directory. Anything added to the "posts" directory will generate a related page, whereas the items in "posts_short" should only generate a preview for the news feed and NOT generate a page. I'll make sure the READMEs are clear on this in #3047

@amyleadem
Copy link
Contributor Author

Note

There is a new html-proofer build error. I will work on building a fix in a separate PR.

mejiaj
mejiaj previously approved these changes Jan 28, 2025
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.

Verified changes and resolved comments. Thanks @amyleadem.

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 is looking good! Great work, Amy and team!

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.

What's New: Add new recent content items to updated page
4 participants