DPGAlliance / publicgoods-scripts

Scripts to generate static site from WordPress
http://digitalpublicgoods.net
MIT License
4 stars 6 forks source link

Add Valid HTML ids to registry items. #128

Closed seanmarcia closed 1 year ago

seanmarcia commented 2 years ago

Summary

Currently Digital Public Goods (DPGs) are published in a large list with no apparent way to link directly to a specific DPG. You need to link to the list itself and then navigate/search for a specific DPG. I propose adding in an html id tag to each of the items in the list of Digital Public Goods.

Justification

This will allow folks to link back to their Digital Public Good on the list. This will:

Details

It looks like this could be accomplished fairly simply by adding an id in the ListItem function in following file: packages/registry/src/index.js which appears to be generating the registry. I suggest we use linkName as it is already a generated variable in the script and as it is based of the name it should be unique.

I think we can do this easily by swapping line 291 from:

<tr key={index} className={itemClass}>

to:

<tr key={index} id={linkName} className={itemClass}>

Other considerations

I'm under the assumption that names of DPGs are unique but if it is possible for a nominee and an approved good to have the same name and therefore the same generated linkName this could lead to an id collision.

Criteria for completion