Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,023 changes: 517 additions & 506 deletions _data/citations.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _data/sources.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- id: doi:10.1111/jvim.70133
- type: journal paper
type: journal paper
tags:
- ontology
- animals
Expand Down
60 changes: 36 additions & 24 deletions _includes/citation.html
Original file line number Diff line number Diff line change
@@ -1,50 +1,62 @@
{% assign citation = site.data.citations
{% assign matched_citation = site.data.citations
| where_exp: "citation",
"citation.id == include.lookup or citation.title contains include.lookup"
| first
| default: include
%}

<div class="citation">
{% assign citation_link = include.link | default: matched_citation.link %}
{% assign citation_title = include.title | default: matched_citation.title %}
{% assign citation_image = include.image | default: matched_citation.image %}
{% assign citation_authors = include.authors | default: matched_citation.authors %}
{% assign citation_publisher = include.publisher | default: matched_citation.publisher %}
{% assign citation_date = include.date | default: matched_citation.date %}
{% assign citation_id = include.id | default: matched_citation.id %}
{% assign citation_description = include.description | default: matched_citation.description %}
{% assign citation_buttons = include.buttons | default: matched_citation.buttons %}
{% assign citation_tags = include.tags | default: matched_citation.tags %}
{% assign citation_repo = include.repo | default: matched_citation.repo %}
{% assign citation_type_key = include.type | default: matched_citation.type %}
{% assign citation_type = site.data.types[citation_type_key] %}

{% if include.style == "rich" %}
<a
{% if citation.link %}
href="{{ citation.link | relative_url }}"
{% if citation_link %}
href="{{ citation_link | relative_url }}"
{% endif %}
class="citation-image"
aria-label="{{ citation.title | default: "citation link" }}"
aria-label="{{ citation_title | default: "citation link" }}"
>
<img
src="{{ citation.image | relative_url }}"
alt="{{ citation.title | default: "citation image" }}"
src="{{ citation_image | relative_url }}"
alt="{{ citation_title | default: "citation image" }}"
loading="lazy"
{% include fallback.html %}
>
</a>
{% endif %}

<div class="citation-text">
{% assign type = site.data.types[citation.type] %}
{% include icon.html icon=type.icon %}
{% include icon.html icon=citation_type.icon %}

<a
{% if citation.link %}
href="{{ citation.link | relative_url }}"
{% if citation_link %}
href="{{ citation_link | relative_url }}"
{% endif %}
class="citation-title"
>
{{ citation.title | default: "[no title info]" }}
{{ citation_title | default: "[no title info]" }}
</a>

<div
class="citation-authors"
{% if citation.authors.size > 10 %}
data-tooltip="{{ citation.authors | join: ", " }} "
{% if citation_authors.size > 10 %}
data-tooltip="{{ citation_authors | join: ", " }} "
{% endif %}
tabindex="0"
>
{{
citation.authors
citation_authors
| join: ","
| split: ","
| array_carve: 5
Expand All @@ -54,28 +66,28 @@
</div>

<div class="citation-details">
{{ citation.publisher | default: "[no publisher info]" }}
{{ citation_publisher | default: "[no publisher info]" }}
&nbsp; · &nbsp;
{{ citation.date | default: "[no date info]" | date: "%d %b %Y" }}
{{ citation_date | default: "[no date info]" | date: "%d %b %Y" }}
&nbsp; · &nbsp;
{{ citation.id | default: "[no id info]" }}
{{ citation_id | default: "[no id info]" }}
</div>

{% if include.style == "rich" %}
{% if citation.description %}
{% if citation_description %}
<div class="citation-description">
{{
citation.description
citation_description
| markdownify
| remove: "<p>"
| remove: "</p>"
}}
</div>
{% endif %}

{% if citation.buttons.size > 0 %}
{% if citation_buttons.size > 0 %}
<div class="citation-buttons">
{% for button in citation.buttons %}
{% for button in citation_buttons %}
{%
include button.html
type=button.type
Expand All @@ -88,8 +100,8 @@
</div>
{% endif %}

{% if citation.tags.size > 0 or citation.repo %}
{% include tags.html tags=citation.tags repo=citation.repo %}
{% if citation_tags.size > 0 or citation_repo %}
{% include tags.html tags=citation_tags repo=citation_repo %}
{% endif %}
{% endif %}
</div>
Expand Down
65 changes: 65 additions & 0 deletions _includes/course-excerpt.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<div class="post-excerpt">
{% assign course_website = include.course_website | default: empty %}
{% assign url = include.url | default: include.link | default: course_website %}
{% assign title = include.title | default: "[no course title]" %}
{% assign subtitle = include.subtitle %}
{% capture display_title %}
{% if subtitle %}{{ subtitle }}: {% endif %}{{ title }}
{% endcapture %}
{% if url %}
<a href="{{ url | relative_url }}" class="post-excerpt-title">{{ display_title | strip }}</a>
{% else %}
<span class="post-excerpt-title">{{ display_title | strip }}</span>
{% endif %}

{% if course_website %}
<p>
<strong>Course website:</strong>
<a href="{{ course_website }}">{{ course_website }}</a>
</p>
{% endif %}

{% if include.distribution %}
<p><strong>Distribution:</strong> {{ include.distribution }}</p>
{% endif %}

{% if include.next_offered %}
<p><strong>Next offering:</strong> {{ include.next_offered }}</p>
{% endif %}

{% assign terms_offered = include.terms_offered | default: empty %}
{% if terms_offered.size > 0 %}
{% assign teaching_link = "/teaching" | relative_url %}
<p><strong>Previously offered:</strong></p>
<div class="tags">
{% for term in terms_offered %}
<a
href="{{ teaching_link }}?search=&quot;{{ term }}&quot;"
class="tag"
data-tooltip="Show courses taught in {{ term }}"
>
{{ term }}
</a>
{% endfor %}
</div>
{% endif %}

{% assign body = include.content | default: "" %}
{% if body != "" %}
{% assign excerpt = body
| regex_scan: "<!-- excerpt start -->(.*)<!-- excerpt end -->", true
| default: include.excerpt
| default: include.description
| default: ""
| strip_html
%}
{% assign search = body
| strip_html
| strip_newlines
| regex_strip
%}
<p data-search="{{ search }}">
{{ excerpt }}
</p>
{% endif %}
</div>
103 changes: 41 additions & 62 deletions _includes/post-excerpt.html
Original file line number Diff line number Diff line change
@@ -1,77 +1,56 @@
{% assign post = site.posts
{% assign matched_post = site.posts
| where_exp: "post", "post.slug == include.lookup"
| first
| default: include
%}

<div class="post-excerpt">
{% assign course_website = post.course_website | default: empty %}
{% assign url = post.url | default: post.link | default: course_website %}
{% assign title = post.title %}
{% assign subtitle = post.subtitle %}
{% capture display_title %}
{% if subtitle %}{{ subtitle }}: {% endif %}{{ title }}
{% endcapture %}
{% assign url = matched_post.url | default: include.url | default: include.link %}
{% assign title = matched_post.title | default: include.title | default: include.lookup %}
{% if url %}
<a href="{{ url | relative_url }}" class="post-excerpt-title">{{ display_title | strip }}</a>
<a href="{{ url | relative_url }}" class="post-excerpt-title">{{ title }}</a>
{% else %}
<span class="post-excerpt-title">{{ display_title | strip }}</span>
<span class="post-excerpt-title">{{ title }}</span>
{% endif %}

{% if course_website %}
<p>
<strong>Course website:</strong>
<a href="{{ course_website }}">{{ course_website }}</a>
</p>
{% endif %}

{% if post.distribution %}
<p><strong>Distribution:</strong> {{ post.distribution }}</p>
{% endif %}

{% if post.next_offered %}
<p><strong>Next offering:</strong> {{ post.next_offered }}</p>
{% endif %}

{% assign terms_offered = post.terms_offered | default: empty %}
{% if terms_offered.size > 0 %}
{% assign teaching_link = "/teaching" | relative_url %}
<p><strong>Previously offered:</strong></p>
<div class="tags">
{% for term in terms_offered %}
<a
href="{{ teaching_link }}?search=&quot;{{ term }}&quot;"
class="tag"
data-tooltip="Show courses taught in {{ term }}"
>
{{ term }}
</a>
{% endfor %}
</div>
{% endif %}
{% assign info_author = matched_post.author | default: include.author %}
{% assign info_people = matched_post.people | default: include.people %}
{% assign info_published = matched_post.date | default: include.date %}
{% assign info_updated = matched_post.last_modified_at | default: include.last_modified_at %}
{% assign info_tags = matched_post.tags | default: include.tags %}

{%
include post-info.html
author=post.author
published=post.date
updated=post.last_modified_at
tags=post.tags
author=info_author
people=info_people
published=info_published
updated=info_updated
tags=info_tags
hide_author_image=true
hide_updated=true
%}

{% assign excerpt = post.content
| default: ""
| regex_scan: "<!-- excerpt start -->(.*)<!-- excerpt end -->", true
| default: post.excerpt
| default: post.description
| default: ""
| strip_html
%}
{% assign search = post.content
| strip_html
| strip_newlines
| regex_strip
%}
<p data-search="{{ search }}">
{{ excerpt }}
</p>
{% assign body = matched_post.content | default: include.content | default: "" %}
{% if include.show_full_content %}
<div class="post-excerpt-body" data-search="{{ body | strip_html | strip_newlines | regex_strip }}">
{{ body | markdownify }}
</div>
{% else %}
{% assign excerpt = body
| regex_scan: "<!-- excerpt start -->(.*)<!-- excerpt end -->", true
| default: matched_post.excerpt
| default: matched_post.description
| default: include.excerpt
| default: include.description
| default: ""
| strip_html
%}
{% assign search = body
| strip_html
| strip_newlines
| regex_strip
%}
<p data-search="{{ search }}">
{{ excerpt }}
</p>
{% endif %}
</div>
32 changes: 30 additions & 2 deletions _includes/post-info.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
| first
%}
{% if member %}
{% include portrait.html lookup=include.author style="tiny" %}
{% unless include.hide_author_image %}
{% include portrait.html lookup=include.author style="tiny" %}
{% endunless %}
<span data-tooltip="Author">
{% include icon.html icon="fa-solid fa-feather-pointed" %}
<span>{{ member.name }}</span>
</span>
{% else %}
<span data-tooltip="Author">
{% include icon.html icon="fa-solid fa-feather-pointed" %}
Expand All @@ -24,14 +30,36 @@
</span>
{% endif %}

{% unless include.hide_updated %}
{% if updated and updated != "" and updated != published %}
<span data-tooltip="Last updated on">
{% include icon.html icon="fa-solid fa-clock-rotate-left" %}
<span>{{ updated }}</span>
</span>
{% endif %}
{% endunless %}
</div>

{% assign tagged_people = include.people | default: empty %}
{% assign tagged_people = tagged_people | join: "," | split: "," | array_filter %}

{% if tagged_people.size > 0 %}
<p class="center">
Mentioned:
{% for person in tagged_people %}
{% assign member = site.members
| where_exp: "member", "member.slug == person"
| first
%}
{% if member %}
<a href="{{ member.url | relative_url }}">{{ member.name }}</a>{% unless forloop.last %}, {% endunless %}
{% else %}
{{ person }}{% unless forloop.last %}, {% endunless %}
{% endif %}
{% endfor %}
</p>
{% endif %}

{% if include.tags %}
{% include tags.html tags=include.tags link="blog" %}
{% include tags.html tags=include.tags link="news" %}
{% endif %}
Loading
Loading