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

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

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

Related issue

Closes #2915

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 %}

This comment was marked as duplicate.

@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
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 %}

This comment was marked as duplicate.

Comment on lines +30 to +57
<ul class="usa-card-group margin-top-6">
<li class="usa-card site-component-card desktop:grid-col-6">
<div class="usa-card__container">
<header class="usa-card__header">
<h2 class="usa-card__heading font-lang-lg">Release notes</h2>
</header>
<div class="usa-card__body font-lang-sm">
<p>Find summaries of each USWDS update on our GitHub releases page. Release notes explain bug fixes, new features, and other changes.</p>
</div>
<div class="usa-card__footer">
<a class="usa-button" href="https://github.com/uswds/uswds/releases">Read the USWDS release notes</a>
</div>
</div>
</li>
<li class="usa-card site-component-card desktop:grid-col-6">
<div class="usa-card__container">
<header class="usa-card__header">
<h2 class="usa-card__heading font-lang-lg">GitHub discussions</h2>
</header>
<div class="usa-card__body font-lang-sm">
<p>How our growing community of government engineers, content specialists, and designers participate and contribute to improving USWDS.</p>
</div>
<div class="usa-card__footer">
<a class="usa-button" href="https://github.com/uswds/uswds/discussions">USWDS GitHub discussions</a>
</div>
</div>
</li>
</ul>
Copy link
Contributor

@mejiaj mejiaj Nov 15, 2024

Choose a reason for hiding this comment

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

issue: Can we create a component or an include for this?

Ideally a component should be reusable, but having HTML in MD can be confusing and hard to maintain.

Comment on lines +9 to +13
<!--
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.
-->
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 could be a liquid comment.

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
3 participants