Skip to content

Commit

Permalink
Support different colors for different kinds of publications in publi…
Browse files Browse the repository at this point in the history
…cation list (alshedivat#797)
  • Loading branch information
gzwongkk committed Aug 6, 2022
1 parent 58391d1 commit a36d7f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions _data/venues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"AJP":
url: https://aapt.scitation.org/journal/ajp
color: "#00369f"

"PhysRev":
url: https://journals.aps.org/
8 changes: 6 additions & 2 deletions _layouts/bib.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
{%- 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>
{%- assign venue_style = nil -%}
{%- if site.data.venues[entry.abbr].color != blank -%}
{%- assign venue_style = site.data.venues[entry.abbr].color | prepend: 'style="background-color:' | append: '"' -%}
{%- endif -%}
<abbr class="badge" {% if venue_style %}{{venue_style}}{% endif %}><a href="{{site.data.venues[entry.abbr].url}}">{{entry.abbr}}</a></abbr>
{%- else -%}
<abbr class="badge">{{entry.abbr}}</abbr>
<abbr class="badge">{{entry.abbr}}</abbr>
{%- endif -%}
{%- endif -%}
</div>
Expand Down

0 comments on commit a36d7f5

Please sign in to comment.