From f4969b4cfe6c72a1c6982b50ec148131316c7213 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 20 Jan 2023 00:59:31 +0100 Subject: [PATCH] Move lookup and link to partials (#106) --- _includes/partial/publisher_link.html | 3 +++ _layouts/collection/collection_base.html | 5 +---- _layouts/collection/collection_index.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 _includes/partial/publisher_link.html diff --git a/_includes/partial/publisher_link.html b/_includes/partial/publisher_link.html new file mode 100644 index 00000000..1dd51881 --- /dev/null +++ b/_includes/partial/publisher_link.html @@ -0,0 +1,3 @@ +{% assign pub_small = include.pub | downcase %} +{% assign publisher_ref = site.publishers | where: 'short_name', pub_small | first %} +{{ publisher_ref.name }} \ No newline at end of file diff --git a/_layouts/collection/collection_base.html b/_layouts/collection/collection_base.html index 4cc6a965..dd89bf54 100644 --- a/_layouts/collection/collection_base.html +++ b/_layouts/collection/collection_base.html @@ -15,10 +15,7 @@ layout: default

{{ page.title }}

{{ page.date | date_to_string }} - {% assign publisher = site.publishers | where: 'short_name', page.author | first %} - {% if publisher %} - - {{ publisher.name }} - {% endif %} + {% include partial/publisher_link.html pub= page.author %}

{{ content }} \ No newline at end of file diff --git a/_layouts/collection/collection_index.html b/_layouts/collection/collection_index.html index 684d52fd..927ac218 100644 --- a/_layouts/collection/collection_index.html +++ b/_layouts/collection/collection_index.html @@ -14,7 +14,7 @@ layout: default {{ item.title }} {{ item.excerpt | strip_html | strip_newlines | truncate: 156 }} - {{ item.date | date_to_string }} | {{ item.author }} + {{ item.date | date_to_string }} | {% include partial/publisher_link.html pub=item.author %} {% endfor %}