Skip to content

Commit

Permalink
Adds support for preview images for publications (alshedivat#730)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
2 people authored and GeorgeVern committed Feb 1, 2023
1 parent 7410c1b commit b7d86b7
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
13 changes: 13 additions & 0 deletions _bibliography/papers.bib
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
---
<<<<<<< HEAD
@inproceedings{document_metric,
abbr={WMT},
title = {Embarrassingly Easy Document-Level MT Metrics: How to Convert Any Pretrained Metric Into a Document-Level Metric},
Expand All @@ -9,6 +10,18 @@ @inproceedings{document_metric
pdf = {https://statmt.org/wmt22/pdf/2022.wmt-1.6.pdf},
code = {https://github.com/amazon-science/doc-mt-metrics}
selected={true},
=======

@string{aps = {American Physical Society,}}

@book{einstein1956investigations,
bibtex_show={true},
title={Investigations on the Theory of the Brownian Movement},
author={Einstein, Albert},
year={1956},
publisher={Courier Corporation,},
preview={brownian-motion.gif},
>>>>>>> 9411786 (Adds support for preview images for publications (#730))
}

@inproceedings{smala,
Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,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, preview] # Filter out certain bibtex entry keywords used internally from the bib output

# -----------------------------------------------------------------------------
# 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-2 {% if entry.preview %}preview{% else %}abbr{% endif %}">
{%- if entry.preview -%}
{% if entry.preview contains '://' -%}
<img class="preview z-depth-1 rounded" src="{{ entry.preview }}">
{%- else -%}
<img class="preview z-depth-1 rounded" src="{{ entry.preview | prepend: '/assets/img/publication_preview/' | relative_url }}">
{%- 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
5 changes: 5 additions & 0 deletions _sass/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,11 @@ footer.sticky-bottom {

li {
margin-bottom: 1rem;
.preview {
width: 100%;
min-width: 80px;
max-width: 200px;
}
.abbr {
height: 2rem;
margin-bottom: 0.5rem;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b7d86b7

Please sign in to comment.