Skip to content

Commit

Permalink
Merge branch 'greenelab-main'
Browse files Browse the repository at this point in the history
  • Loading branch information
hyphaltip committed Oct 22, 2024
2 parents 54ffe7b + 5a67394 commit e74fde4
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 24 deletions.
4 changes: 1 addition & 3 deletions .docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#! /bin/bash

# print folder contents for debugging
echo "Contents:"
echo ""
printf "\n\nContents:\n\n"
ls
echo ""

# run cite process
python3 _cite/cite.py
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

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

- Minor bug fixes in cite process and sitemap generation.

## 1.2.0 - 2024-03-08

### Changed
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# citation metadata for the template itself

title: "Lab Website Template"
version: 1.2.0
date-released: 2024-03-08
version: 1.2.2
date-released: 2024-06-05
url: "https://github.com/greenelab/lab-website-template"
authors:
- family-names: "Rubinetti"
Expand Down
Binary file modified _cite/.cache/cache.db
Binary file not shown.
12 changes: 7 additions & 5 deletions _cite/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import yaml
from yaml.loader import SafeLoader
from pathlib import Path
from datetime import datetime
from datetime import date, datetime
from rich import print
from diskcache import Cache

Expand Down Expand Up @@ -88,15 +88,17 @@ def list_of_dicts(data):
return isinstance(data, list) and all(isinstance(entry, dict) for entry in data)


def format_date(date):
def format_date(_date):
"""
format date as YYYY-MM-DD, or no date if malformed
"""

if isinstance(date, int):
return datetime.fromtimestamp(date // 1000.0).strftime("%Y-%m-%d")
if isinstance(_date, int):
return datetime.fromtimestamp(_date // 1000.0).strftime("%Y-%m-%d")
if isinstance(_date, (date, datetime)):
return _date.strftime("%Y-%m-%d")
try:
return datetime.strptime(date, "%Y-%m-%d").strftime("%Y-%m-%d")
return datetime.strptime(_date, "%Y-%m-%d").strftime("%Y-%m-%d")
except Exception:
return ""

Expand Down
1 change: 1 addition & 0 deletions _includes/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

{%
include {{ include.component | append: ".html" }}
affiliation=d.affiliation
author=d.author
authors=d.authors
buttons=d.buttons
Expand Down
34 changes: 20 additions & 14 deletions _includes/portrait.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
{% assign member = include %}
{% endif %}

{% assign type = site.data.types[member.role] %}

<div class="portrait-wrapper">
<a
{% if page.slug != member.slug %}
Expand All @@ -16,6 +18,10 @@
data-style="{{ include.style }}"
aria-label="{{ member.name | default: "member link" }}"
>
{% if type %}
{% include icon.html icon=type.icon %}
{% endif %}

<img
src="{{ member.image | relative_url }}"
class="portrait-image"
Expand All @@ -24,21 +30,21 @@
{% include fallback.html %}
>

{% if member.name or member.role or member.description %}
<span class="portrait-text">
{% if member.name %}
<span class="portrait-name">
{{ member.name }}
</span>
{% endif %}
{% if member.name %}
<span class="portrait-name">
{{ member.name }}
</span>
{% endif %}

{% if member.description or type %}
<span class="portrait-description">
{{ member.description | default: type.description }}
</span>
{% endif %}

{% if member.role or member.description %}
<span class="portrait-role">
{% assign type = site.data.types[member.role] %}
{% include icon.html icon=type.icon %}
<span>{{ member.description | default: type.description }}</span>
</span>
{% endif %}
{% if member.affiliation %}
<span class="portrait-affiliation">
{{ member.affiliation }}
</span>
{% endif %}
</a>
Expand Down
4 changes: 4 additions & 0 deletions _includes/tags.html
Original file line number Diff line number Diff line change
@@ -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 %}
Expand Down
1 change: 1 addition & 0 deletions _members/jane-smith.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: Jane Smith
image: images/photo.jpg
role: pi
affiliation: University of Colorado
aliases:
- J. Smith
- J Smith
Expand Down

0 comments on commit e74fde4

Please sign in to comment.