From 876d287cc82a29ed7fb9824adbeeb3719b85c2e4 Mon Sep 17 00:00:00 2001 From: CheariX Date: Sun, 7 Apr 2024 22:37:02 +0200 Subject: [PATCH] Feature: added "award" for publications (#2324) This PR adds an "award" button to publications. It takes the `award` value from the bibtex entry and displays(incl. Markdown rendering) the text in a box similarly to abstract and bibtex. User can set the entry `award_name` to configure the value. See example config with `award_name: Nobel Prize`. The color of the award box can be configured in `_base.scss`. Note, there is a similar PR #2175, it I saw to issues with: 1. There was no progress 2. The award button just prints the text directly in the button, similarly to `award_name`. Long award names could clutter the webpage. 3. IMHO, it brokes the current al-folio design, since butons do have a fixed size/text. However, variable prize names are also possible with this PR. *** Pictures: Default. Text are hidden: grafik Additional info is shown when the button is clicked. Markdown supported. grafik Only one text box shown at the same time, like it is with "ABS" and "BIB": grafik *** Feedback welcome. You can also check [my website](https://christianmainka.de/publications/awarded), which was the base for this PR. --- _bibliography/papers.bib | 16 ++++++++++++++++ _config.yml | 2 +- _layouts/bib.liquid | 10 ++++++++++ _sass/_base.scss | 9 +++++++++ _sass/_themes.scss | 1 + assets/js/common.js | 11 +++++++++-- 6 files changed, 46 insertions(+), 3 deletions(-) diff --git a/_bibliography/papers.bib b/_bibliography/papers.bib index f6d8b6bc4505..5ebc7b0ec3e2 100644 --- a/_bibliography/papers.bib +++ b/_bibliography/papers.bib @@ -83,6 +83,22 @@ @article{einstein1905electrodynamics year={1905} } +@Article{einstein1905photoelectriceffect, + bibtex_show={true}, + abbr={Ann. Phys.}, + title="{{\"U}ber einen die Erzeugung und Verwandlung des Lichtes betreffenden heuristischen Gesichtspunkt}", + author={Albert Einstein}, + abstract={This is the abstract text.}, + journal={Ann. Phys.}, + volume={322}, + number={6}, + pages={132--148}, + year={1905}, + doi={10.1002/andp.19053220607}, + award={Albert Einstein receveid the **Nobel Prize in Physics** 1921 *for his services to Theoretical Physics, and especially for his discovery of the law of the photoelectric effect*}, + award_name={Nobel Prize} +} + @book{przibram1967letters, bibtex_show={true}, title={Letters on wave mechanics}, diff --git a/_config.yml b/_config.yml index 12931613bedf..011a6751981d 100644 --- a/_config.yml +++ b/_config.yml @@ -323,7 +323,7 @@ enable_publication_badges: # Filter out certain bibtex entry keywords used internally from the bib output filtered_bibtex_keywords: - [abbr, abstract, altmetric, arxiv, bibtex_show, blog, code, html, pdf, poster, preview, selected, slides, supp, video, website] + [abbr, abstract, altmetric, arxiv, award, award_name, bibtex_show, blog, code, html, pdf, poster, preview, selected, slides, supp, video, website] # Maximum number of authors to be shown for each publication (more authors are visible on click) max_author_limit: 3 # leave blank to always show all authors diff --git a/_layouts/bib.liquid b/_layouts/bib.liquid index aca79fbeb86d..d5a32287bccf 100644 --- a/_layouts/bib.liquid +++ b/_layouts/bib.liquid @@ -156,6 +156,9 @@