first working banner
This commit is contained in:
parent
2d3dfddc29
commit
0a8be90c90
432 changed files with 13477 additions and 1291 deletions
74
templates/partials/articles.html
Normal file
74
templates/partials/articles.html
Normal file
|
@ -0,0 +1,74 @@
|
|||
{%- if paginator.pages -%}
|
||||
{%- set pages = paginator.pages -%}
|
||||
{%- elif section.pages -%}
|
||||
{%- set pages = section.pages -%}
|
||||
{%- else -%}
|
||||
{%- set pages = term.pages -%}
|
||||
{%- endif -%}
|
||||
|
||||
<div id="article-list">
|
||||
{%- for page in pages %}
|
||||
{%- if page.draft -%}
|
||||
{%- set article_type = "draft" -%}
|
||||
{%- set article_string = macros_translate::translate(key="drafted", default="Drafted", language_strings=language_strings) -%}
|
||||
{%- elif page.extra.archive -%}
|
||||
{%- set article_type = "archive" -%}
|
||||
{%- set article_string = macros_translate::translate(key="archived", default="Archived", language_strings=language_strings) -%}
|
||||
{%- elif page.extra.featured -%}
|
||||
{%- set article_type = "featured" -%}
|
||||
{%- set article_string = macros_translate::translate(key="featured", default="Featured", language_strings=language_strings) -%}
|
||||
{%- elif page.extra.hot -%}
|
||||
{%- set article_type = "hot" -%}
|
||||
{%- set article_string = macros_translate::translate(key="hot", default="Hot", language_strings=language_strings) -%}
|
||||
{%- elif page.extra.poor -%}
|
||||
{%- set article_type = "poor" -%}
|
||||
{%- set article_string = macros_translate::translate(key="poor", default="Poor", language_strings=language_strings) -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- if page.extra.banner -%}
|
||||
{%- if page.colocated_path -%}
|
||||
{%- set blurnail = resize_image(path=page.colocated_path ~ page.extra.banner, width=4, height=2, op="fill", format="webp") -%}
|
||||
{%- else -%}
|
||||
{%- set blurnail_url = page.extra.banner -%} <!-- Ensure no leading slash -->
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
|
||||
|
||||
<article {% if article_type %}class="{{ article_type }}"{% endif %} {% if blurnail or blurnail_url %}style="--blurnail: url('{{ blurnail.url | default(value=blurnail_url) }}')"{% endif %}>
|
||||
<a href="{{ page.permalink | safe }}"></a>
|
||||
{% if article_type %}
|
||||
<span class="badge">
|
||||
<i class="icon"></i>
|
||||
{{- article_string -}}
|
||||
</span>
|
||||
{%- endif %}
|
||||
<h3>{{ page.title }}</h3>
|
||||
{%- if page.description %}
|
||||
{{ page.description | markdown | safe }}
|
||||
{%- endif %}
|
||||
{%- if page.date -%}
|
||||
<div class="details">
|
||||
<small>
|
||||
<time datetime="{{ page.date | date(format='%+') }}" pubdate>
|
||||
{{- page.date | date(format=date_format, locale=date_locale) -}}
|
||||
</time>
|
||||
{%- if page.authors -%}
|
||||
<span> {{ config.extra.separator | default(value="•") }} {% include "partials/authors.html" -%}</span>
|
||||
{%- endif -%}
|
||||
</small>
|
||||
{%- if page.taxonomies -%}
|
||||
{%- for name, taxon in page.taxonomies %}
|
||||
<small>
|
||||
<ul class="tags">
|
||||
{%-for item in taxon -%}
|
||||
<li><a class="tag" href="{{ get_taxonomy_url(kind=name, name=item, lang=lang) }}">{{ item }}</a></li>
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
</small>
|
||||
{%- endfor -%}
|
||||
{%- endif %}
|
||||
</div>
|
||||
{%- endif -%}
|
||||
</article>
|
||||
{%- endfor %}
|
||||
</div>
|
17
templates/partials/card.html
Normal file
17
templates/partials/card.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
{%- if page.extra.card -%}
|
||||
{{ get_url(path=page.colocated_path ~ page.extra.card) }}
|
||||
|
||||
{%- elif section.extra.card -%}
|
||||
{{ get_url(path=section.colocated_path ~ section.extra.card) }}
|
||||
|
||||
{%- elif page.extra.banner -%}
|
||||
{%- if page.colocated_path -%}
|
||||
{%- set card = resize_image(path=page.colocated_path ~ page.extra.banner, width=1200, height=628, op="fill") -%}
|
||||
{{ card.url }}
|
||||
{%- else -%}
|
||||
{{ page.extra.banner }}
|
||||
{%- endif -%}
|
||||
|
||||
{%- else -%}
|
||||
{{ get_url(path="card.png") }}
|
||||
{%- endif -%}
|
Loading…
Add table
Add a link
Reference in a new issue