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] %} +
+ {% if type %} + {% include icon.html icon=type.icon %} + {% endif %} + - {% if member.name or member.role or member.description %} - - {% if member.name %} - - {{ member.name }} - - {% endif %} + {% if member.name %} + + {{ member.name }} + + {% endif %} + + {% if member.description or type %} + + {{ member.description | default: type.description }} + + {% endif %} - {% if member.role or member.description %} - - {% assign type = site.data.types[member.role] %} - {% include icon.html icon=type.icon %} - {{ member.description | default: type.description }} - - {% endif %} + {% if member.affiliation %} + + {{ member.affiliation }} {% endif %} diff --git a/_includes/tags.html b/_includes/tags.html index fb16266d50..4f92729dae 100644 --- a/_includes/tags.html +++ b/_includes/tags.html @@ -1,8 +1,12 @@ {% assign tags = include.tags | object_items | join: "," + | downcase | split: "," | array_filter + | join: "," + | regex_replace: "\s+", "-" + | split: "," | uniq %} {% assign link = include.link | default: page.dir | absolute_url %} diff --git a/_members/jane-smith.md b/_members/jane-smith.md index f4cae89631..c60188ecd7 100644 --- a/_members/jane-smith.md +++ b/_members/jane-smith.md @@ -2,6 +2,7 @@ name: Jane Smith image: images/photo.jpg role: pi +affiliation: University of Colorado aliases: - J. Smith - J Smith diff --git a/_scripts/search.js b/_scripts/search.js index fa23ca4c21..3d1da24045 100644 --- a/_scripts/search.js +++ b/_scripts/search.js @@ -38,7 +38,7 @@ // normalize tag string for comparison window.normalizeTag = (tag) => - tag.trim().toLowerCase().replaceAll(/-|\s+/g, " "); + tag.trim().toLowerCase().replaceAll(/\s+/g, "-"); // get data attribute contents of element and children const getAttr = (element, attr) => diff --git a/_styles/portrait.scss b/_styles/portrait.scss index fa0c03960b..d91785721c 100644 --- a/_styles/portrait.scss +++ b/_styles/portrait.scss @@ -11,7 +11,6 @@ justify-content: center; align-items: center; flex-direction: column; - gap: 20px; margin: 20px; width: 175px; max-width: calc(100% - 20px - 20px); @@ -29,25 +28,42 @@ text-align: left; } -.portrait-image { - width: 100%; +.portrait .icon { + position: absolute; + left: 0; + top: 0; + display: flex; + justify-content: center; + align-items: center; + width: calc(20px + 10%); aspect-ratio: 1 / 1; border-radius: 999px; - object-fit: cover; + background: var(--background); box-shadow: var(--shadow); + transform: translate(14%, 14%); } -.portrait[data-style="tiny"] .portrait-image { - width: 50px; +.portrait[data-style="small"] .icon { + left: -2px; + top: -2px; } -.portrait[data-style="tiny"] .portrait-role { +.portrait[data-style="tiny"] .icon { display: none; } -.portrait-text { - display: flex; - flex-direction: column; +.portrait-image { + width: 100%; + margin-bottom: 20px; + aspect-ratio: 1 / 1; + border-radius: 999px; + object-fit: cover; + box-shadow: var(--shadow); +} + +.portrait[data-style="tiny"] .portrait-image { + width: 50px; + margin: 0; } .portrait-name { @@ -55,22 +71,9 @@ font-weight: var(--semi-bold); } -.portrait-role .icon { - position: absolute; - left: 0; - top: 0; - display: flex; - justify-content: center; - align-items: center; - width: calc(20px + 10%); - aspect-ratio: 1 / 1; - border-radius: 999px; - background: var(--background); - box-shadow: var(--shadow); - transform: translate(14%, 14%); -} - -.portrait[data-style="small"] .portrait-role .icon { - left: -2px; - top: -2px; +.portrait[data-style="tiny"] { + .portrait-description, + .portrait-affiliation { + display: none; + } }