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:
parent
b5e1cf59e5
commit
f4969b4cfe
3
_includes/partial/publisher_link.html
Normal file
3
_includes/partial/publisher_link.html
Normal 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>
|
@ -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>
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user