diff --git a/CHANGELOG.md b/CHANGELOG.md index fb1f988eed..35da88ea80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ Reference: common-changelog.org +## 1.2.2 - 2024-06-05 + +### Added + +- Add `affiliation` member portrait field. + +### Changed + +- Change order and type of preferred ids from ORCID API. +- Expand list of supported Manubot identifiers and thus keep ORCID API details less often. +- Simplify portrait component under-the-hood. +- Make tag component de-duplication consistent with search plugin de-duplication. + ## 1.2.1 - 2024-04-01 ### Changed diff --git a/CITATION.cff b/CITATION.cff index 4b875d4752..2ded51e8d2 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,8 +1,8 @@ # citation metadata for the template itself title: "Lab Website Template" -version: 1.2.1 -date-released: 2024-04-01 +version: 1.2.2 +date-released: 2024-06-05 url: "https://github.com/greenelab/lab-website-template" authors: - family-names: "Rubinetti" diff --git a/_cite/.cache/cache.db b/_cite/.cache/cache.db index 2ca6d98078..96041e520e 100644 Binary files a/_cite/.cache/cache.db and b/_cite/.cache/cache.db differ diff --git a/_cite/plugins/orcid.py b/_cite/plugins/orcid.py index 0017145942..2f7d04de19 100644 --- a/_cite/plugins/orcid.py +++ b/_cite/plugins/orcid.py @@ -1,6 +1,7 @@ import json from urllib.request import Request, urlopen from util import * +from manubot.cite.handlers import prefix_to_handler as manubot_prefixes def main(entry): @@ -35,16 +36,24 @@ def query(_id): # go through response structure and pull out ids e.g. doi:1234/56789 for work in response: # get list of ids - ids = get_safe(work, "external-ids.external-id", []) + ids = [] for summary in get_safe(work, "work-summary", []): ids = ids + get_safe(summary, "external-ids.external-id", []) - # prefer doi id type, or fallback to first id + # find first id of particular "relationship" type _id = next( - (id for id in ids if get_safe(id, "external-id-type", "") == "doi"), - ids[0] if len(ids) > 0 else {}, + ( + id + for id in ids + if get_safe(id, "external-id-relationship", "") + in ["self", "version-of", "part-of"] + ), + ids[0] if len(ids) > 0 else None, ) + if _id == None: + continue + # get id and id-type from response id_type = get_safe(_id, "external-id-type", "") id_value = get_safe(_id, "external-id-value", "") @@ -52,20 +61,11 @@ def query(_id): # create source source = {"id": f"{id_type}:{id_value}"} - # if not a doi, Manubot likely can't cite, so keep citation details - if id_type != "doi": + # if not an id type that Manubot can cite, keep citation details + if id_type not in manubot_prefixes: # get summaries summaries = get_safe(work, "work-summary", []) - # sort summary entries by most recent - summaries = sorted( - summaries, - key=lambda summary: (get_safe(summary, "last-modified-date.value", 0)) - or get_safe(summary, "created-date.value", 0) - or 0, - reverse=True, - ) - # get first summary with defined sub-value def first(get_func): return next( diff --git a/_data/citations.yaml b/_data/citations.yaml index db4e4b0036..0e483e3a9d 100644 --- a/_data/citations.yaml +++ b/_data/citations.yaml @@ -141,11 +141,11 @@ - Jacob D Krol - Joseph T Burke - Samuel Z Chen - - Lo Sosinski + - Lo M Sosinski - Faisal S Alquaddoomi - Evan P Brenner - Ethan P Wolfe - - Vince P Rubinetti + - Vincent P Rubinetti - Shaddai Amolitos - Kellen M Reason - John B Johnston diff --git a/_includes/list.html b/_includes/list.html index 92026fd511..cdb030c956 100644 --- a/_includes/list.html +++ b/_includes/list.html @@ -24,6 +24,7 @@ {% include {{ include.component | append: ".html" }} + affiliation=d.affiliation author=d.author authors=d.authors buttons=d.buttons diff --git a/_includes/portrait.html b/_includes/portrait.html index 3b77f3d168..3986db06d8 100644 --- a/_includes/portrait.html +++ b/_includes/portrait.html @@ -7,6 +7,8 @@ {% assign member = include %} {% endif %} +{% assign type = site.data.types[member.role] %} +