diff --git a/_includes/citation.html b/_includes/citation.html index 338be68..644e092 100644 --- a/_includes/citation.html +++ b/_includes/citation.html @@ -8,22 +8,44 @@ {% assign citation = include %} {% endif %} +{% assign citation_pdf = citation.pdf | default: nil %} +{% if citation_pdf == nil and citation.buttons.size > 0 %} + {% for button in citation.buttons %} + {% assign button_link = button.link | default: "" | downcase %} + {% assign button_text = button.text | default: "" | downcase %} + {% assign button_icon = button.icon | default: "" | downcase %} + {% assign is_pdf_link = button_link contains ".pdf" %} + {% assign is_pdf_text = button_text contains "pdf" %} + {% assign is_pdf_icon = button_icon contains "pdf" %} + {% if is_pdf_link or is_pdf_text or is_pdf_icon %} + {% assign citation_pdf = button.link %} + {% break %} + {% endif %} + {% endfor %} +{% endif %} +