mirror of
https://github.com/dragonlock2/dragonlock2.github.io.git
synced 2025-10-11 12:07:56 +00:00
add teaser image support
This commit is contained in:
parent
1a4a33f297
commit
e032a187f0
35
_includes/archive-single.html
Normal file
35
_includes/archive-single.html
Normal file
@ -0,0 +1,35 @@
|
||||
{% if post.header.teaser %}
|
||||
{% capture teaser %}{{ post.header.teaser }}{% endcapture %}
|
||||
{% else %}
|
||||
{% assign teaser = site.teaser %}
|
||||
{% endif %}
|
||||
|
||||
{% if post.id %}
|
||||
{% assign title = post.title | markdownify | remove: "<p>" | remove: "</p>" %}
|
||||
{% else %}
|
||||
{% assign title = post.title %}
|
||||
{% endif %}
|
||||
|
||||
<div class="{{ include.type | default: 'list' }}__item">
|
||||
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
|
||||
{% if include.type == "grid" and teaser %}
|
||||
<div class="archive__item-teaser">
|
||||
<img src="{{ teaser | relative_url }}" alt="">
|
||||
</div>
|
||||
{% endif %}
|
||||
<h2 class="archive__item-title no_toc" itemprop="headline">
|
||||
{% if post.link %}
|
||||
<a href="{{ post.link }}">{{ title }}</a> <a href="{{ post.url | relative_url }}" rel="permalink"><i class="fas fa-link" aria-hidden="true" title="permalink"></i><span class="sr-only">Permalink</span></a>
|
||||
{% else %}
|
||||
<a href="{{ post.url | relative_url }}" rel="permalink">{{ title }}</a>
|
||||
{% endif %}
|
||||
</h2>
|
||||
{% include page__meta.html type=include.type %}
|
||||
{% if include.type == "list" and teaser %}
|
||||
<div class="archive__item-teaser">
|
||||
<img style="max-height: 15vh; width: auto; height: auto" src="{{ teaser | relative_url }}" alt="">
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if post.excerpt %}<p class="archive__item-excerpt" itemprop="description">{{ post.excerpt | markdownify | strip_html | truncate: 160 }}</p>{% endif %}
|
||||
</article>
|
||||
</div>
|
1
_includes/head/custom.html
Normal file
1
_includes/head/custom.html
Normal file
@ -0,0 +1 @@
|
||||
<link rel="shortcut icon" type="image/png" href="/assets/img/favicon.png">
|
@ -3,6 +3,8 @@ title: "Moving to Jekyll"
|
||||
date: 2023-07-03
|
||||
categories: other
|
||||
excerpt: After several years on WordPress, I realized my use case would be better suited for a static generator like Jekyll. To better maintainability and security!
|
||||
header:
|
||||
teaser: /assets/img/jekyll_logo.png
|
||||
---
|
||||
|
||||
Nothing much to see here. If the process gets rocky, I'll add some comments.
|
||||
|
BIN
assets/img/favicon.png
Executable file
BIN
assets/img/favicon.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
BIN
assets/img/jekyll_logo.png
Normal file
BIN
assets/img/jekyll_logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
Loading…
x
Reference in New Issue
Block a user