mirror of
https://github.com/welpo/tabi.git
synced 2025-12-14 11:48:45 +01:00
Merge 185a37553f into 980e58e356
This commit is contained in:
commit
0dbdb63bc3
3 changed files with 21 additions and 2 deletions
|
|
@ -414,6 +414,7 @@ local_image = "img/tabi.webp"
|
||||||
- `description` is the description of the project.
|
- `description` is the description of the project.
|
||||||
- `weight` determines the order in which the projects are shown. The lower the weight, the higher the project will appear.
|
- `weight` determines the order in which the projects are shown. The lower the weight, the higher the project will appear.
|
||||||
- `local_image` is the path to the image of the project. This image is shown on the projects page.
|
- `local_image` is the path to the image of the project. This image is shown on the projects page.
|
||||||
|
- `local_image_dark` is an optional path to an alternative image to be shown in dark mode. When set, `local_image` is shown in light mode only.
|
||||||
|
|
||||||
When a user clicks on the image or title of a project, they will be taken to the project's page. If you'd rather have users go to an external link, you can set `link_to = "https://example.com` in the `[extra]` section of the project's `.md` file.
|
When a user clicks on the image or title of a project, they will be taken to the project's page. If you'd rather have users go to an external link, you can set `link_to = "https://example.com` in the `[extra]` section of the project's `.md` file.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,8 +98,17 @@
|
||||||
<li class="post-thumbnail">
|
<li class="post-thumbnail">
|
||||||
<a href="{{ post.permalink }}">
|
<a href="{{ post.permalink }}">
|
||||||
{% if post.extra.local_image %}
|
{% if post.extra.local_image %}
|
||||||
|
{% if post.extra.local_image_dark %}
|
||||||
|
{# Show light image only in light mode, dark image only in dark mode #}
|
||||||
|
{% set meta_dark = get_image_metadata(path=post.extra.local_image_dark, allow_missing=true) %}
|
||||||
|
<img class="thumbnail-image img-dark"
|
||||||
|
alt="{{ post.extra.local_image_dark }}"
|
||||||
|
src="{{ get_url(path=post.extra.local_image_dark) }}"
|
||||||
|
{% if meta_dark.width %}width="{{ meta_dark.width }}"{% endif %}
|
||||||
|
{% if meta_dark.height %}height="{{ meta_dark.height }}"{% endif %}>
|
||||||
|
{% endif %}
|
||||||
{% set meta = get_image_metadata(path=post.extra.local_image, allow_missing=true) %}
|
{% set meta = get_image_metadata(path=post.extra.local_image, allow_missing=true) %}
|
||||||
<img class="thumbnail-image"
|
<img class="thumbnail-image{% if page.extra.local_image_dark %} img-light{% endif %}"
|
||||||
alt="{{ post.extra.local_image }}"
|
alt="{{ post.extra.local_image }}"
|
||||||
src="{{ get_url(path=post.extra.local_image) }}"
|
src="{{ get_url(path=post.extra.local_image) }}"
|
||||||
{% if meta.width %}width="{{ meta.width }}"{% endif %}
|
{% if meta.width %}width="{{ meta.width }}"{% endif %}
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,17 @@
|
||||||
data-tags="{% for tax_name, terms in page.taxonomies %}{% for term in terms | unique %}{{ term | lower }}{% if not loop.last %},{% endif %}{% endfor %}{% endfor %}"
|
data-tags="{% for tax_name, terms in page.taxonomies %}{% for term in terms | unique %}{{ term | lower }}{% if not loop.last %},{% endif %}{% endfor %}{% endfor %}"
|
||||||
{% endif %}>
|
{% endif %}>
|
||||||
{% if page.extra.local_image %}
|
{% if page.extra.local_image %}
|
||||||
|
{% if page.extra.local_image_dark %}
|
||||||
|
{# Show light image only in light mode, dark image only in dark mode #}
|
||||||
|
{% set meta_dark = get_image_metadata(path=page.extra.local_image_dark, allow_missing=true) %}
|
||||||
|
<img class="card-image img-dark"
|
||||||
|
alt="{{ page.extra.local_image_dark }}"
|
||||||
|
src="{{ get_url(path=page.extra.local_image_dark) }}"
|
||||||
|
{% if meta_dark.width %}width="{{ meta_dark.width }}"{% endif %}
|
||||||
|
{% if meta_dark.height %}height="{{ meta_dark.height }}"{% endif %}>
|
||||||
|
{% endif %}
|
||||||
{% set meta = get_image_metadata(path=page.extra.local_image, allow_missing=true) %}
|
{% set meta = get_image_metadata(path=page.extra.local_image, allow_missing=true) %}
|
||||||
<img class="card-image"
|
<img class="card-image{% if page.extra.local_image_dark %} img-light{% endif %}"
|
||||||
alt="{{ page.extra.local_image }}"
|
alt="{{ page.extra.local_image }}"
|
||||||
src="{{ get_url(path=page.extra.local_image) }}"
|
src="{{ get_url(path=page.extra.local_image) }}"
|
||||||
{% if meta.width %}width="{{ meta.width }}"{% endif %}
|
{% if meta.width %}width="{{ meta.width }}"{% endif %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue