mirror of
https://github.com/inventree/inventree-website.git
synced 2025-06-13 10:35:27 +00:00
refactor
This commit is contained in:
24
_layouts/collection/collection_base.html
Normal file
24
_layouts/collection/collection_base.html
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
<header>
|
||||
{% if page.backLink or page.backLink == nil %}
|
||||
<a href="{{ layout.base_link | relative_url }}" class="flex items-center m-5 text-xl hover:underline">
|
||||
<img class="w-6 h-6" src="{{ '/assets/back.svg' | relative_url }}" />
|
||||
<span>Back</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<h1>{{ page.title }}</h1>
|
||||
<p>
|
||||
{{ page.date | date_to_string }}
|
||||
{% assign publisher = site.publishers | where: 'short_name', page.publisher | first %}
|
||||
{% if publisher %}
|
||||
- <a href="{{ publisher.url | relative_url }}">{{ publisher.name }}</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
{{ content }}
|
||||
</article>
|
22
_layouts/collection/collection_index.html
Normal file
22
_layouts/collection/collection_index.html
Normal file
@ -0,0 +1,22 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
<section class="cm-gray-2 body-font">
|
||||
<div class="pt-3 pb-1 section-container">
|
||||
<h1 class="header-text title-font mb-4 cm-gray-2">{{ page.title_text }}</h1>
|
||||
<div class="flex flex-wrap">
|
||||
|
||||
{% assign cols = site[page.collection] %}
|
||||
{% if page.collection_reverse == true %}{% assign cols = cols | reverse %}{% endif %}
|
||||
{% for item in cols %}
|
||||
<div class="p-6 md:w-1/2 flex flex-col items-start">
|
||||
<h2 class="header-text title-font mb-4 cm-gray-1">
|
||||
<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 }} | </span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
5
_layouts/collection/news.html
Normal file
5
_layouts/collection/news.html
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
layout: collection/collection_base
|
||||
base_link: '/news'
|
||||
---
|
||||
{{ content }}
|
5
_layouts/collection/post.html
Normal file
5
_layouts/collection/post.html
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
layout: collection/collection_base
|
||||
base_link: '/blog'
|
||||
---
|
||||
{{ content }}
|
Reference in New Issue
Block a user