DSpace / dspace-angular

DSpace User Interface built on Angular.io
https://wiki.lyrasis.org/display/DSDOC8x/
BSD 3-Clause "New" or "Revised" License
124 stars 415 forks source link

Make the Google Scholar `citation_*` HTML `<meta>` tags configurable again #1198

Open tdonohue opened 3 years ago

tdonohue commented 3 years ago

Is your feature request related to a problem? Please describe. In DSpace 6.x, these were configurable in the google-metadata.properties file: https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace/config/crosswalks/google-metadata.properties

In DSpace 7.x, the <meta> tags are all generated by the UI's MetadataService. While they can be modified by customizing that Service, this is not as easy to customize.

We should consider making these customizable again, especially if we find that users need to modify these default <meta> tags on a regular basis.

This might be achievable by either making the existing google-metadata.properties settings accessible from the REST API (perhaps via the /api/properties endpoint) so that the UI code could use them. Or we could remove that google-metadata.properties file altogether and replace it with UI-level configurations.

At this time, this is considered low priority & I've moved this to the 7.2 board. However, this may be reprioritized as we gather more feedback.

TanyaHolm commented 2 years ago

I would argue that configurable meta tags are high priority, since DSpace metadata for most institutions are largely custom. The following is from Google Scholar guidelines: you need to provide at least three fields: (1) the title of the article, (2) the full name of at least the first author, and (3) the year of publication. Pages that don't provide any one of these three fields will be processed as if they had no meta tags at all.

In our case, we configured authors to be either default field for author (dc.contributor.author) or a custom field for creator - but not both. Does this mean that records containing the custom creator field will not be indexed by Google Scholar - since the custom field cannot be hardcoded?

tdonohue commented 2 years ago

@TanyaHolm : Just to clarify, currently these mappings are defined in the MetadataService class in the UI: https://github.com/DSpace/dspace-angular/blob/main/src/app/core/metadata/metadata.service.ts

However, you obviously are free to modify that class to add custom or additional fields to those Google Scholar tags. So, they are somewhat "configurable" in that you can easily modify the UI code to change the mappings. But, currently they do not use a configuration file like in v6.x, so the configuration is not as easy at this time.

For example, if you wanted to modify the fields used for citation_author, you'd simply add to the list of fields in this setCitationAuthorTags() method: https://github.com/DSpace/dspace-angular/blob/main/src/app/core/metadata/metadata.service.ts#L202 Similar methods exist in that same file which would allow you to choose your own mapping for citation_title, citation_publication_date, etc. But, at this time, you'd have to modify this MetadataService class & rebuild the UI in order to modify these tags.

TanyaHolm commented 2 years ago

Thank you - that clarifies the issue for me and it's great that custom fields can be added.

bram-atmire commented 1 month ago

Right now in Angular, this crosswalk is encapsulated in head-tag.service (not in metadata service anymore as said in the original ticket)