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

Added logic to set href for service link #7524

Merged
merged 7 commits into from May 20, 2024
Merged

Conversation

nick-mon1
Copy link
Contributor

@nick-mon1 nick-mon1 commented Apr 25, 2024

Summary

Visiting https://digital.gov/services/ and clicking each link will take back to the top of the page.
It should link to the external or internal service.

Preview

Link to Preview

Solution

Added logic to properly set the link for each card-service.

  {{- $href := "" -}}

  {{ if .Params.source_url }}
    {{ $href = .Params.source_url }}
  {{ else }}
    {{ $href = .Params.url }}
  {{ end }}

How To Test

All links point to an external page except U.S. Digital Registry and the DAP guide.


Dev Checklist

  • PR has correct labels
  • A11y testing (voice over testing, meets WCAG, run axe tools)
  • Code is formatted properly

Copy link

🔍 Preview in Federalist

@nick-mon1 nick-mon1 added the Dev: Template Logic Fixes and improvements associated with our static site generator label Apr 25, 2024
@nick-mon1 nick-mon1 self-assigned this Apr 25, 2024
clmedders
clmedders previously approved these changes Apr 26, 2024
Copy link
Contributor

@clmedders clmedders left a comment

Choose a reason for hiding this comment

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

LGTM - all links are leading to the excited external site and are not sending me to the top of the page

sarah-sch
sarah-sch previously approved these changes Apr 26, 2024
Copy link
Contributor

@sarah-sch sarah-sch left a comment

Choose a reason for hiding this comment

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

The U.S. Digital Registry link isn't working--is that because it's an internal link and gets messed up in the federalist preview? Otherwise looks good--the bug that was reported has been fixed.

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.

@nick-mon1 if one case is more common than others, would it make more sense to set that as the default?

Pseudocode example

// Save the fallback.
{{ $fallback_url := .Params.source_url }}

// Set the override with fallback.
{{ .Params.url | default $fallback_url }}

@nick-mon1 nick-mon1 dismissed stale reviews from sarah-sch and clmedders via 7216143 April 26, 2024 21:28
@nick-mon1
Copy link
Contributor Author

Thanks for the comments team!

  • @sarah-sch The link is now fixed for federalist.
  • @mejiaj I've simplified the logic with your suggestion.

Copy link
Contributor

@sarah-sch sarah-sch left a comment

Choose a reason for hiding this comment

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

Looks good!

@bonnieAcameron bonnieAcameron self-requested a review April 30, 2024 17:49
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.

Looks good, tested all links in services pages.

Copy link
Contributor

@ToniBonittoGSA ToniBonittoGSA left a comment

Choose a reason for hiding this comment

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

w00t!

@ToniBonittoGSA ToniBonittoGSA merged commit 63f8bfa into main May 20, 2024
8 checks passed
@ToniBonittoGSA ToniBonittoGSA deleted the nl-fix-link-for-services branch May 20, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dev: Template Logic Fixes and improvements associated with our static site generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants