From 0c9cde78061c1b1c097944a127114fe7bfff805d Mon Sep 17 00:00:00 2001 From: Christian Mainka Date: Tue, 16 Apr 2024 21:39:19 +0000 Subject: [PATCH 1/4] add: example abbr + preview --- _bibliography/papers.bib | 3 ++- _data/venues.yml | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/_bibliography/papers.bib b/_bibliography/papers.bib index 97bc49ea5466..948f6b6f91ed 100644 --- a/_bibliography/papers.bib +++ b/_bibliography/papers.bib @@ -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} } diff --git a/_data/venues.yml b/_data/venues.yml index 6c16ad5dcbdf..41963201fba1 100644 --- a/_data/venues.yml +++ b/_data/venues.yml @@ -4,3 +4,6 @@ "PhysRev": url: https://journals.aps.org/ + +"Vision": + color: "#009f36" From d9e56718c1fec85b5fc65251c8a95d414ec89e8e Mon Sep 17 00:00:00 2001 From: Christian Mainka Date: Tue, 16 Apr 2024 21:40:06 +0000 Subject: [PATCH 2/4] feat: enable abbr + preview --- _layouts/bib.liquid | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/_layouts/bib.liquid b/_layouts/bib.liquid index 3443f3ad4665..7aa2d5ae4c90 100644 --- a/_layouts/bib.liquid +++ b/_layouts/bib.liquid @@ -2,7 +2,29 @@ ---
{% if site.enable_publication_thumbnails %} -
+
+ {%- 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 -%} + + {% if site.data.venues[entry.abbr].url %} + {{ entry.abbr }} + {% else %} +
{{- entry.abbr -}}
+ {% endif %} +
+ {% else %} + {{ entry.abbr }} + {% endif %} + {% endif %} {% if entry.preview %} {% if entry.preview contains '://' %} @@ -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 %} - {{ entry.abbr }} - {% else %} - {{ entry.abbr }} - {% endif %} {% endif %}
{% endif %} From 78d03ce0edeea9996f347b5a406b4e58ffb450b8 Mon Sep 17 00:00:00 2001 From: Christian Mainka Date: Tue, 16 Apr 2024 21:40:41 +0000 Subject: [PATCH 3/4] fix: liquid does not supprot ternary operator --- _layouts/bib.liquid | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_layouts/bib.liquid b/_layouts/bib.liquid index 7aa2d5ae4c90..96ddff0a48aa 100644 --- a/_layouts/bib.liquid +++ b/_layouts/bib.liquid @@ -173,7 +173,9 @@