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

Adds support for preview images for publications #730

Merged
merged 11 commits into from
Jul 3, 2022
3 changes: 2 additions & 1 deletion _bibliography/papers.bib
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ @book{einstein1956investigations
title={Investigations on the Theory of the Brownian Movement},
author={Einstein, Albert},
year={1956},
publisher={Courier Corporation,}
publisher={Courier Corporation,},
preview={brownian-motion.gif},
}

@article{einstein1950meaning,
Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ scholar:

query: "@*"

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
filtered_bibtex_keywords: [abbr, abstract, arxiv, bibtex_show, html, pdf, selected, supp, blog, code, poster, slides, website, teaser] # Filter out certain bibtex entry keywords used internally from the bib output
rohandebsarkar marked this conversation as resolved.
Show resolved Hide resolved

# -----------------------------------------------------------------------------
# Responsive WebP Images
Expand Down
10 changes: 8 additions & 2 deletions _layouts/bib.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
---
<!-- _layouts/bib.html -->
<div class="row">
<div class="col-sm-2 abbr">
{%- if entry.abbr -%}
<div class="col-sm-3 {% if entry.preview %} preview{% else %} abbr{% endif %}">
rohandebsarkar marked this conversation as resolved.
Show resolved Hide resolved
{%- if entry.preview -%}
{% if entry.preview contains '://' -%}
<img class="preview" src="{{ entry.preview }}">
rohandebsarkar marked this conversation as resolved.
Show resolved Hide resolved
{%- else -%}
<img class="preview" src="{{ entry.preview | prepend: '/assets/img/publication_preview/' | relative_url }}">
rohandebsarkar marked this conversation as resolved.
Show resolved Hide resolved
{%- endif -%}
{%- elsif entry.abbr -%}
{%- if site.data.venues[entry.abbr] -%}
<abbr class="badge"><a href="{{site.data.venues[entry.abbr].url}}">{{entry.abbr}}</a></abbr>
{%- else -%}
Expand Down
4 changes: 4 additions & 0 deletions _sass/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,13 @@ footer.sticky-bottom {

li {
margin-bottom: 1rem;
.preview {
width: 100%;
rohandebsarkar marked this conversation as resolved.
Show resolved Hide resolved
}
.abbr {
height: 2rem;
margin-bottom: 0.5rem;
font-size: large;
rohandebsarkar marked this conversation as resolved.
Show resolved Hide resolved
abbr {
display: inline-block;
background-color: var(--global-theme-color);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.