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: Combine "What's new" and "News and updates pages #2958

Merged
merged 19 commits into from
Nov 20, 2024

Conversation

amyleadem
Copy link
Contributor

@amyleadem amyleadem commented Nov 7, 2024

Summary

Combined "What's new" and "News and updates" pages.

This is a follow-up to the prototype work in #2855.

Note

This PR does not include the prototype's updates to the excerpt link structure in post.html. It was not clear how to accommodate external links in the header links, so I bumped it for now to prevent this from being blocked. We are going to address this in a fast follow-on in #2953. We will also work on further enhancing this layout in #2967.

Important

We need to update the changelog dates before merge

Important

This PR is failing because of HTML proofer errors that will be fixed in these PRs:

Related issue

Closes #2915

Follow up issues:

Preview links

Problem statement

  • There is not a clear place to post product updates in relation to Web Components launch
  • There is a gap in communicating about our new product
    • We talk about it in MCs and newsletters, but if you only went to our site, you’d have no idea
  • Our product looks stale - no “news”
    • We aren’t showing our full story
  • We’re currently splitting traffic between two “news” pages
    • Google Analytics review shows fairly similar traffic for the last six months, with What’s New page ahead by about 300 views. And, two blog posts under the What’s New URL have about combined 5000 views for that period.

Solution

  • Moved the "News and updates" page to be a child of "What's new" page, rather than a sibling
  • Moved "What's new" content into cards to visually condense the content
  • Replaced the Showcase link with a link to GitHub discussions.

Testing and review

All:

  • Confirm links work
  • Confirm pages display as expected at all screen widths
  • Confirm changelogs are present and accurate
  • Confirm sidenav highlights the correct current page on the what's new pages and posts

Content:

  • Confirm the updated page titles, leads are free from error and make sense
  • Confirm the content in the cards on the "What's new" page are free from error and make sense
  • Confirm "All news and updates" page shows the same posts as the previous "news and updates" page

Devs:

  • Confirm redirects work as expected
    • Confirm the previous link to "News and updates" (/about/updates/) now points to the "What's new" page
  • Confirm the permalinks and url directory structure makes sense for the new pages and posts
  • Confirm no regressions in sidenav on different page types.
  • Confirm the code meets USWDS standards

@amyleadem amyleadem changed the title Combine "What's new" and "News and updates pages USWDS-Site: Combine "What's new" and "News and updates pages Nov 8, 2024
@amyleadem amyleadem marked this pull request as ready for review November 8, 2024 16:02
@amyleadem amyleadem marked this pull request as draft November 13, 2024 17:22
Comment on lines +20 to +21
- /whats-new/updates/
- /about/updates/
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

These were redirects from the deleted updates.md file

Comment on lines 7 to 15
{% elsif page.collection and include.page.subnav.type == page.collection %}
{% assign _current = true %}
<!--
Use the page's `type` data key to connect the sidenav to a collection.
This sets "current" for the pages inside the _posts directory.
Collections are defined in config.yml, and "posts" is a default collection type in Jekyll.
-->
{% elsif page.collection and include.page.type == page.collection %}
{% assign _current = true %}
Copy link
Contributor Author

@amyleadem amyleadem Nov 14, 2024

Choose a reason for hiding this comment

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

Note

This change allows us to set the "current" page in the sidenav of all our posts to be the "All news and updates" page.

Notes:

  • To connect the pages, we needed to also add type: posts to the front matter of the What's new pages.
  • The type data key is used in the front matter across the site, but type: posts is not yet used in the repo.

Why I didn't use the existing subnav.type check

Currently, the site connects the posts to the "News and updates" page in the side navigation by using the conditional in lines 7-8 here, along with adding subnav.type = "posts" on the updates.md file.

However, I ran into some errors with this approach when I tried to add both a type and a link item to "All news and updates" inside the subnav in pages/whats-new/overview.md. It caused conflict that caused the side navigation to break (Please confirm that you are not able to get it to work either).

Needs discussion

Proposed additional change

I recommend we remove the subnav.type check in lines 7-8 and replace it with the check added in lines 14-15.

Currently, there is only one other page that uses subnav.type: security.md. Replacing subnav.type with type here should still connect it to the expected collection in config.yml.

I don't see anything in the repo relating to page.type that would cause any regressions, but of course we would want to test that. If we move forward with this approach, we would also need to make an update to the front matter in security.md.

Curious to hear thoughts on this approach and proposed additional change.

Suggested change
{% elsif page.collection and include.page.subnav.type == page.collection %}
{% assign _current = true %}
<!--
Use the page's `type` data key to connect the sidenav to a collection.
This sets "current" for the pages inside the _posts directory.
Collections are defined in config.yml, and "posts" is a default collection type in Jekyll.
-->
{% elsif page.collection and include.page.type == page.collection %}
{% assign _current = true %}
<!--
Use the page's `type` data key to connect the sidenav to a collection.
This sets "current" for the pages inside the _posts directory.
Collections are defined in config.yml, and "posts" is a default collection type in Jekyll.
-->
{% elsif page.collection and include.page.type == page.collection %}
{% assign _current = true %}

Copy link
Contributor

Choose a reason for hiding this comment

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

Note

This change allows us to set the "current" page in the sidenav of all our posts to be the "All news and updates" page.

Notes:

  • To connect the pages, we needed to also add type: posts to the front matter of the What's new pages.
  • The type data key is used in the front matter across the site, but type: posts is not yet used in the repo.

Would setting type be necessary since we have that setup in defaults?

uswds-site/_config.yml

Lines 92 to 96 in 849d779

- scope:
path: ""
type: posts
values:
layout: post

Copy link
Contributor

Choose a reason for hiding this comment

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

This is somewhere I was also getting caught up while testing. I think it would be a good idea to normalize this across pages. It would also reduce complexity of this current page logic which would be a win!

Praise: Thank you for breaking this down in a clear and easy to follow way!

Copy link
Contributor Author

@amyleadem amyleadem Nov 18, 2024

Choose a reason for hiding this comment

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

Update: I opened issue #2974 to explore this conversation so that we can prevent scope creep here.

@amyleadem amyleadem marked this pull request as ready for review November 14, 2024 19:21
@amyleadem amyleadem requested a review from a team as a code owner November 14, 2024 19:21
finekatie
finekatie previously approved these changes Nov 14, 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.

Merge is looking good to me. Excited to get to add content!

@mejiaj mejiaj self-assigned this Nov 15, 2024
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.

Thanks for consolidating this and the notes. The changes look good and the reasoning to consolidate make a lot of sense.

Added a question and a comment. Ideally, we should move away from the pattern of embedding chunks of HTML in markdown. The larger the chunk the harder it is to update/maintain and could introduce code duplication.

Comment on lines 7 to 15
{% elsif page.collection and include.page.subnav.type == page.collection %}
{% assign _current = true %}
<!--
Use the page's `type` data key to connect the sidenav to a collection.
This sets "current" for the pages inside the _posts directory.
Collections are defined in config.yml, and "posts" is a default collection type in Jekyll.
-->
{% elsif page.collection and include.page.type == page.collection %}
{% assign _current = true %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Note

This change allows us to set the "current" page in the sidenav of all our posts to be the "All news and updates" page.

Notes:

  • To connect the pages, we needed to also add type: posts to the front matter of the What's new pages.
  • The type data key is used in the front matter across the site, but type: posts is not yet used in the repo.

Would setting type be necessary since we have that setup in defaults?

uswds-site/_config.yml

Lines 92 to 96 in 849d779

- scope:
path: ""
type: posts
values:
layout: post

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.

Barring other potential changes, this is looking good! I left one non-blocking recommendation for code consistency.

  • Confirm links work
  • Confirm pages display as expected at all screen widths
  • Confirm changelogs are present and accurate
  • Confirm sidenav highlights the correct current page on the what's new pages and posts
  • Confirm redirects work as expected
    • Confirm the previous link to "News and updates" (/about/updates/) now points to the "What's new" page
  • Confirm the permalinks and url directory structure makes sense for the new pages and posts
  • Confirm no regressions in sidenav on different page types.
  • Confirm the code meets USWDS standards (pending other requested changes)

Comment on lines 7 to 15
{% elsif page.collection and include.page.subnav.type == page.collection %}
{% assign _current = true %}
<!--
Use the page's `type` data key to connect the sidenav to a collection.
This sets "current" for the pages inside the _posts directory.
Collections are defined in config.yml, and "posts" is a default collection type in Jekyll.
-->
{% elsif page.collection and include.page.type == page.collection %}
{% assign _current = true %}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is somewhere I was also getting caught up while testing. I think it would be a good idea to normalize this across pages. It would also reduce complexity of this current page logic which would be a win!

Praise: Thank you for breaking this down in a clear and easy to follow way!

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 nice job, the new component looks great and looking forward to seeing more re-usable components.

Added minor comments (mostly polish). Tried to make them easy to incorporate via suggestions. If you don't want to accept, then feel free to resolve with a comment saying Decided against or something to that effect.

I can approve once all comments are resolved.

@amyleadem
Copy link
Contributor Author

Great idea to include comments in the includes, @mejiaj. I committed both of your suggestions. This is ready for re-review.

@amyleadem amyleadem requested a review from mejiaj November 18, 2024 22:35
mejiaj
mejiaj previously approved these changes Nov 19, 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.

Just had one capitalization correction that I previously missed. Other than that it looks great!

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

All looks good! I approve.

mahoneycm
mahoneycm previously approved these changes Nov 19, 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.

Loving the flow of the page and the new card includes look fantastic! Great work here @amyleadem 🥳

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

Thank you!

updated changelog date, assuming we'll wrap tomorrow
@annepetersen annepetersen dismissed stale reviews from mahoneycm and finekatie via e02741b November 19, 2024 21:16
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.

LGTM

@amyleadem
Copy link
Contributor Author

Update: I fixed the build errors on this PR. All checks are now passing.

@annepetersen annepetersen merged commit 1591ddb into main Nov 20, 2024
11 checks passed
@annepetersen annepetersen deleted the al-combine-whats-new-pages branch November 20, 2024 18:19
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 combined "What's new" and "News and updates" page
5 participants