2
0
mirror of https://github.com/inventree/inventree-website.git synced 2025-04-27 21:16:45 +00:00

Move lookup and link to partials (#106)

This commit is contained in:
Matthias Mair 2023-01-20 00:59:31 +01:00 committed by GitHub
parent b5e1cf59e5
commit f4969b4cfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -0,0 +1,3 @@
{% assign pub_small = include.pub | downcase %}
{% assign publisher_ref = site.publishers | where: 'short_name', pub_small | first %}
<a href="{{ publisher_ref.url | relative_url }}">{{ publisher_ref.name }}</a>

View File

@ -15,10 +15,7 @@ layout: default
<h1>{{ page.title }}</h1>
<p>
{{ page.date | date_to_string }}
{% assign publisher = site.publishers | where: 'short_name', page.author | first %}
{% if publisher %}
- <a href="{{ publisher.url | relative_url }}">{{ publisher.name }}</a>
{% endif %}
{% include partial/publisher_link.html pub= page.author %}
</p>
{{ content }}
</article>

View File

@ -14,7 +14,7 @@ layout: default
<a href="{{ item.url | relative_url }}">{{ item.title }}</a>
</h2>
<span class="leading-relaxed mb-4">{{ item.excerpt | strip_html | strip_newlines | truncate: 156 }}</span>
<span>{{ item.date | date_to_string }} | {{ item.author }}</span>
<span>{{ item.date | date_to_string }} | {% include partial/publisher_link.html pub=item.author %}</span>
</div>
{% endfor %}
</div>