Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat bib preview (closes #1162) #2352

Merged
merged 4 commits into from
Apr 17, 2024
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
3 changes: 2 additions & 1 deletion _bibliography/papers.bib
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,6 @@ @book{przibram1967letters
author={Einstein, Albert and Schrödinger, Erwin and Planck, Max and Lorentz, Hendrik Antoon and Przibram, Karl},
year={1967},
publisher={Vision},
preview={wave-mechanics.gif}
preview={wave-mechanics.gif},
abbr={Vision}
}
3 changes: 3 additions & 0 deletions _data/venues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@

"PhysRev":
url: https://journals.aps.org/

"Vision":
color: "#009f36"
46 changes: 27 additions & 19 deletions _layouts/bib.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,29 @@
---
<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 abbr">
{%- if entry.abbr -%}
{%- if site.data.venues[entry.abbr] -%}
{% assign venue_style = null %}
{% if site.data.venues[entry.abbr].color != blank %}
{% assign venue_style = site.data.venues[entry.abbr].color | prepend: 'style="background-color:' | append: '"' %}
{%- endif -%}
<abbr
class="badge rounded"
{% if venue_style %}
{{ venue_style }}
{% endif -%}
>
{% if site.data.venues[entry.abbr].url %}
<a href="{{site.data.venues[entry.abbr].url}}">{{ entry.abbr }}</a>
{% else %}
<div>{{- entry.abbr -}}</div>
{% endif %}
</abbr>
{% else %}
<abbr class="badge rounded">{{ entry.abbr }}</abbr>
{% endif %}
{% endif %}
{% if entry.preview %}
{% if entry.preview contains '://' %}
<img class="preview z-depth-1 rounded" src="{{ entry.preview }}">
Expand All @@ -14,26 +36,10 @@
path=entry_path
sizes = "200px"
class="preview z-depth-1 rounded"
zoomable=false
zoomable=true
alt=entry.preview
%}
{% endif %}
{% elsif entry.abbr %}
{% if site.data.venues[entry.abbr] %}
{% assign venue_style = null %}
{% if site.data.venues[entry.abbr].color != blank %}
{% assign venue_style = site.data.venues[entry.abbr].color | prepend: 'style="background-color:' | append: '"' %}
{% endif %}
<abbr
class="badge"
{% if venue_style %}
{{ venue_style }}
{% endif %}
><a href="{{site.data.venues[entry.abbr].url}}">{{ entry.abbr }}</a></abbr
>
{% else %}
<abbr class="badge">{{ entry.abbr }}</abbr>
{% endif %}
{% endif %}
</div>
{% endif %}
Expand Down Expand Up @@ -167,7 +173,9 @@
<!-- Links/Buttons -->
<div class="links">
{% if entry.award %}
<a class="award btn btn-sm z-depth-0" role="button">{{ entry.award_name ? entry.award_name : "Awarded" }}</a>
<a class="award btn btn-sm z-depth-0" role="button">
{%- if entry.award_name %}{{ entry.award_name }}{% else %}Awareded{% endif -%}
</a>
{% endif %}
{% if entry.abstract %}
<a class="abstract btn btn-sm z-depth-0" role="button">Abs</a>
Expand Down
4 changes: 2 additions & 2 deletions _sass/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,8 @@ footer.sticky-bottom {
abbr {
display: inline-block;
background-color: var(--global-theme-color);
padding-left: 1rem;
padding-right: 1rem;
margin-bottom: 0.5rem;
width: 100%;

a {
color: white;
Expand Down