gbif / hosted-portals

Support material for establishing the GBIF Hosted Portals
Apache License 2.0
9 stars 6 forks source link

Get identifierBadge for DOIs #237

Closed bienflorencia closed 1 year ago

bienflorencia commented 1 year ago

Hello ! I was wondering if it's possible to have the DOI identifierBadge that GBIF displays in the datasets' references as a feature (example).

image

Found this, but I'm not familiar enough to bring it to the main.scss. https://github.com/gbif/gbif-web/tree/master/packages/react-components/src/components/IdentifierBadge

Thanks a lot!

MortenHofft commented 1 year ago

I'm not sure I understand. The DOI is already being showed as in the above example. Or is it not working properly? Or do you want to show it elsewhere? Sorry - I need a bit more details please.

MortenHofft commented 1 year ago

Reading this again. Is it because you wish to show DOI elsewhere on the site (in the markdown driven pages) and want to use the same styling?

bienflorencia commented 1 year ago

Sorry about that, Morten! Yes, I'm interested in showing the badge in a list of publications outside that (https://hp-biodiversidata.gbif-staging.org/recursos/publicaciones/)

MortenHofft commented 1 year ago

Hmm, there isn't a very good way to reuse that in your context. The medium good way would be to use react, but that is cumbersome for you. Then you could copy html part, and the style, but then they could deviate over time. It is probably the simplest I'm afraid

<a class="myDoi" href="https://doi.org/10.2307/25065646"><span>DOI</span><span>10.2307/25065646</span></a>

and style from https://github.com/gbif/gbif-web/blob/master/packages/react-components/src/components/IdentifierBadge/styles.js

bienflorencia commented 1 year ago

Thanks Morten! It's working :) https://hp-biodiversidata.gbif-staging.org/recursos/publicaciones/

imagen