Skip to content

Commit

Permalink
Make publication thumbnails optional + fix small layout bugs (#1797)
Browse files Browse the repository at this point in the history
  • Loading branch information
alshedivat committed Oct 5, 2023
1 parent da661b1 commit 51d367c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
9 changes: 6 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,10 @@ scholar:
group_by: year
group_order: descending

badges: # Display different badges for your publications
altmetric_badge: true # Altmetric badge (https://www.altmetric.com/products/altmetric-badges/)
dimensions_badge: true # Dimensions badge (https://badge.dimensions.ai/)
# Display different badges withs stats for your publications
enable_publication_badges:
altmetric: true # Altmetric badge (https://www.altmetric.com/products/altmetric-badges/)
dimensions: true # Dimensions badge (https://badge.dimensions.ai/)

# Filter out certain bibtex entry keywords used internally from the bib output
filtered_bibtex_keywords: [abbr, abstract, arxiv, bibtex_show, html, pdf, selected, supp, blog, code, poster, slides, website, preview, altmetric]
Expand All @@ -308,6 +309,8 @@ filtered_bibtex_keywords: [abbr, abstract, arxiv, bibtex_show, html, pdf, select
max_author_limit: 3 # leave blank to always show all authors
more_authors_animation_delay: 10 # more authors are revealed on click using animation; smaller delay means faster animation

# Enables publication thumbnails. If disabled, none of the publications will display thumbnails, even if specified in the bib entry.
enable_publication_thumbnails: true

# -----------------------------------------------------------------------------
# Jekyll Link Attributes
Expand Down
4 changes: 2 additions & 2 deletions _includes/scripts/badges.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{%- if site.badges.altmetric_badge %}
{%- if site.enable_publication_badges.altmetric %}
<script async src="https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js"></script>
{%- endif %}
{%- if site.badges.dimensions_badge %}
{%- if site.enable_publication_badges.dimensions %}
<script async src="https://badge.dimensions.ai/badge.js"></script>
{%- endif %}
18 changes: 12 additions & 6 deletions _layouts/bib.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
---
<!-- _layouts/bib.html -->
<div class="row">
{%- if site.enable_publication_thumbnails -%}
<div class="col-sm-2 {% if entry.preview %}preview{% else %}abbr{% endif %}">
{%- if entry.preview -%}
{% if entry.preview contains '://' -%}
<img data-zoomable class="preview z-depth-1 rounded" src="{{ entry.preview }}">
<img class="preview z-depth-1 rounded" src="{{ entry.preview }}">
{%- else -%}
{%- assign entry_path = entry.preview | prepend: '/assets/img/publication_preview/' -%}
{% include figure.html
path=entry_path
class="preview z-depth-1 rounded"
zoomable=true
zoomable=false
alt=entry.preview -%}
{%- endif -%}
{%- elsif entry.abbr -%}
Expand All @@ -26,9 +27,10 @@
{%- endif -%}
{%- endif -%}
</div>
{%- endif -%}

<!-- Entry bib key -->
<div id="{{entry.key}}" class="col-sm-8">
<div id="{{entry.key}}" class="{% if site.enable_publication_thumbnails %}col-sm-8{% else %}col-sm-10{% endif %}">
<!-- Title -->
<div class="title">{{entry.title}}</div>
<!-- Author -->
Expand Down Expand Up @@ -186,9 +188,12 @@
<a href="{{ entry.website }}" class="btn btn-sm z-depth-0" role="button">Website</a>
{%- endif %}
</div>
{% if site.badges %}
{% if site.enable_publication_badges %}
{% assign entry_has_altmetric_badge = entry.altmetric or entry.doi or entry.eprint or entry.pmid or entry.isbn %}
{% assign entry_has_dimensions_badge = entry.dimensions or entry.doi or entry.pmid %}
{% if entry_has_altmetric_badge or entry_has_dimensions_badge %}
<div class="badges">
{%- if site.badges.altmetric_badge %}
{%- if site.enable_publication_badges.altmetric and entry_has_altmetric_badge %}
<span class="altmetric-embed" data-hide-no-mentions="true" data-hide-less-than="15" data-badge-type="2" data-badge-popover="right"
{% if entry.eprint %}
data-arxiv-id="{{ entry.eprint }}"
Expand All @@ -203,7 +208,7 @@
{% endif %}
></span>
{%- endif %}
{%- if site.badges.dimensions_badge %}
{%- if site.enable_publication_badges.dimensions and entry_has_dimensions_badge %}
<span class="__dimensions_badge_embed__"
{% if entry.doi %}
data-doi="{{ entry.doi }}"
Expand All @@ -216,6 +221,7 @@
{%- endif %}
</div>
{%- endif %}
{%- endif %}

{% if entry.abstract -%}
<!-- Hidden abstract block -->
Expand Down

0 comments on commit 51d367c

Please sign in to comment.