Make publication thumbnails optional + fix small layout bugs (#1797)

This commit is contained in:
Maruan 2023-10-05 00:28:44 -04:00 committed by GitHub
parent da661b1662
commit 51d367c765
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 11 deletions

View File

@ -297,9 +297,10 @@ scholar:
group_by: year group_by: year
group_order: descending group_order: descending
badges: # Display different badges for your publications # Display different badges withs stats for your publications
altmetric_badge: true # Altmetric badge (https://www.altmetric.com/products/altmetric-badges/) enable_publication_badges:
dimensions_badge: true # Dimensions badge (https://badge.dimensions.ai/) 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 # 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] filtered_bibtex_keywords: [abbr, abstract, arxiv, bibtex_show, html, pdf, selected, supp, blog, code, poster, slides, website, preview, altmetric]
@ -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 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 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 # Jekyll Link Attributes

View File

@ -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> <script async src="https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js"></script>
{%- endif %} {%- endif %}
{%- if site.badges.dimensions_badge %} {%- if site.enable_publication_badges.dimensions %}
<script async src="https://badge.dimensions.ai/badge.js"></script> <script async src="https://badge.dimensions.ai/badge.js"></script>
{%- endif %} {%- endif %}

View File

@ -2,16 +2,17 @@
--- ---
<!-- _layouts/bib.html --> <!-- _layouts/bib.html -->
<div class="row"> <div class="row">
{%- if site.enable_publication_thumbnails -%}
<div class="col-sm-2 {% if entry.preview %}preview{% else %}abbr{% endif %}"> <div class="col-sm-2 {% if entry.preview %}preview{% else %}abbr{% endif %}">
{%- if entry.preview -%} {%- if entry.preview -%}
{% if entry.preview contains '://' -%} {% 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 -%} {%- else -%}
{%- assign entry_path = entry.preview | prepend: '/assets/img/publication_preview/' -%} {%- assign entry_path = entry.preview | prepend: '/assets/img/publication_preview/' -%}
{% include figure.html {% include figure.html
path=entry_path path=entry_path
class="preview z-depth-1 rounded" class="preview z-depth-1 rounded"
zoomable=true zoomable=false
alt=entry.preview -%} alt=entry.preview -%}
{%- endif -%} {%- endif -%}
{%- elsif entry.abbr -%} {%- elsif entry.abbr -%}
@ -26,9 +27,10 @@
{%- endif -%} {%- endif -%}
{%- endif -%} {%- endif -%}
</div> </div>
{%- endif -%}
<!-- Entry bib key --> <!-- 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 --> <!-- Title -->
<div class="title">{{entry.title}}</div> <div class="title">{{entry.title}}</div>
<!-- Author --> <!-- Author -->
@ -186,9 +188,12 @@
<a href="{{ entry.website }}" class="btn btn-sm z-depth-0" role="button">Website</a> <a href="{{ entry.website }}" class="btn btn-sm z-depth-0" role="button">Website</a>
{%- endif %} {%- endif %}
</div> </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"> <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" <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 %} {% if entry.eprint %}
data-arxiv-id="{{ entry.eprint }}" data-arxiv-id="{{ entry.eprint }}"
@ -203,7 +208,7 @@
{% endif %} {% endif %}
></span> ></span>
{%- endif %} {%- endif %}
{%- if site.badges.dimensions_badge %} {%- if site.enable_publication_badges.dimensions and entry_has_dimensions_badge %}
<span class="__dimensions_badge_embed__" <span class="__dimensions_badge_embed__"
{% if entry.doi %} {% if entry.doi %}
data-doi="{{ entry.doi }}" data-doi="{{ entry.doi }}"
@ -216,6 +221,7 @@
{%- endif %} {%- endif %}
</div> </div>
{%- endif %} {%- endif %}
{%- endif %}
{% if entry.abstract -%} {% if entry.abstract -%}
<!-- Hidden abstract block --> <!-- Hidden abstract block -->