Skip to content

Commit 9411786

Browse files
Adds support for preview images for publications (alshedivat#730)
* Adds support for publication teaser * Adds an example for publication teaser * Update example publication teaser * Update size * change `teaser` to `preview` * Update _config.yml Co-authored-by: Maruan <alshedivat@users.noreply.github.com> * Update _layouts/bib.html Co-authored-by: Maruan <alshedivat@users.noreply.github.com> * Update _layouts/bib.html Co-authored-by: Maruan <alshedivat@users.noreply.github.com> * Update _layouts/bib.html Co-authored-by: Maruan <alshedivat@users.noreply.github.com> * Update _sass/_base.scss Co-authored-by: Maruan <alshedivat@users.noreply.github.com> * Update _sass/_base.scss Co-authored-by: Maruan <alshedivat@users.noreply.github.com> Co-authored-by: Maruan <alshedivat@users.noreply.github.com>
1 parent 6b61236 commit 9411786

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

_bibliography/papers.bib

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ @book{einstein1956investigations
88
title={Investigations on the Theory of the Brownian Movement},
99
author={Einstein, Albert},
1010
year={1956},
11-
publisher={Courier Corporation,}
11+
publisher={Courier Corporation,},
12+
preview={brownian-motion.gif},
1213
}
1314

1415
@article{einstein1950meaning,

_config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ scholar:
232232

233233
query: "@*"
234234

235-
filtered_bibtex_keywords: [abbr, abstract, arxiv, bibtex_show, html, pdf, selected, supp, blog, code, poster, slides, website] # Filter out certain bibtex entry keywords used internally from the bib output
235+
filtered_bibtex_keywords: [abbr, abstract, arxiv, bibtex_show, html, pdf, selected, supp, blog, code, poster, slides, website, preview] # Filter out certain bibtex entry keywords used internally from the bib output
236236

237237
# -----------------------------------------------------------------------------
238238
# Responsive WebP Images

_layouts/bib.html

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22
---
33
<!-- _layouts/bib.html -->
44
<div class="row">
5-
<div class="col-sm-2 abbr">
6-
{%- if entry.abbr -%}
5+
<div class="col-sm-2 {% if entry.preview %}preview{% else %}abbr{% endif %}">
6+
{%- if entry.preview -%}
7+
{% if entry.preview contains '://' -%}
8+
<img class="preview z-depth-1 rounded" src="{{ entry.preview }}">
9+
{%- else -%}
10+
<img class="preview z-depth-1 rounded" src="{{ entry.preview | prepend: '/assets/img/publication_preview/' | relative_url }}">
11+
{%- endif -%}
12+
{%- elsif entry.abbr -%}
713
{%- if site.data.venues[entry.abbr] -%}
814
<abbr class="badge"><a href="{{site.data.venues[entry.abbr].url}}">{{entry.abbr}}</a></abbr>
915
{%- else -%}

_sass/_base.scss

+5
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,11 @@ footer.sticky-bottom {
461461

462462
li {
463463
margin-bottom: 1rem;
464+
.preview {
465+
width: 100%;
466+
min-width: 80px;
467+
max-width: 200px;
468+
}
464469
.abbr {
465470
height: 2rem;
466471
margin-bottom: 0.5rem;
Loading

0 commit comments

Comments
 (0)