DOI-ONRR / nrrd

ONRR open data site hosted on cloud.gov
Other
13 stars 5 forks source link

External link indicator for NRRD markdown #2941

Closed cthomasONRR closed 7 months ago

cthomasONRR commented 8 months ago

We want to make sure all external links in NRRD have an external link indicator, but still open in the same window like they do now.

cthomasONRR commented 8 months ago

HTML option: https://github.com/PsyTeachR/book-template/issues/3 <a href="google.com">the link</a>

This says it's for R, but might work too https://psyteachr.github.io/book-template/psyteachr-style-guide.html#links [link text](url){target="_blank"}

From old onrr.gov: <a href="URL" target="_blank" >link text</a>.

cthomasONRR commented 8 months ago

@greensomes

I tried several code additions in PR https://github.com/DOI-ONRR/nrrd/pull/2945, but none have worked.

I think we might need to install the font package (or something similar) to what's listed here: https://www.w3schools.com/icons/tryit.asp?filename=tryicons_fa-external-link https://www.w3resource.com/icon/font-awesome/web-application-icons/external-link.php

I'll move this to the product backlog until we have more time to work on it.

cthomasONRR commented 8 months ago

Recording my PR attempts here in case we decide to delete it:

<a href="google.com">the link</a> Does not work- no indicator but still opens in same window image

[link text](url){target="_blank"} Does not work- "{target="_blank"}" shows in text. Link still opens in same window. image

<a href="URL" target="_blank" >link text</a>. Does not work- no indicator and link now opens in new tab. This is what we used in the old onrr.gov but it's not working for MDX. image

<ExternalLink href="URL">link text</ExternalLink> Does not work either. image

I think we need to install some sort of theme package? https://kabartolo.github.io/chicago-docs-demo/docs/components-and-hooks/#externallink

This is what USWDS shows https://designsystem.digital.gov/components/link/ image

I tried this and it does not work. No external link icon for "Federal lands" and adding the new code for Federal lands somehow messed up the OCS link. image

I tried the code here: https://www.w3schools.com/icons/tryit.asp?filename=tryicons_fa-external-link by just adding it to the end of the markdown format: [link text](link url)<i class="fa fa-external-link" style="font-size:24px"></i> a And it didn't do anything: image

I think we need to install the font package (or something similar) to what's listed here https://www.w3schools.com/icons/tryit.asp?filename=tryicons_fa-external-link https://fontawesome.com/v5/icons/external-link?f=classic&s=solid

greensomes commented 8 months ago

Hi @cthomasONRR. We can use the Material UI icons currently available to us. I should be able to tackle this in the next sprint.

greensomes commented 8 months ago

I've added external link indicator icons to external links under the Downloads and How does revenue work pages.