diff options
| author | Alejandro Soto <alejandro@34project.org> | 2025-09-13 14:55:15 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2025-09-13 14:55:15 -0600 |
| commit | 87f85704af1fa866be83077b2b351c1fdad7c3ce (patch) | |
| tree | b49c8d49ef717e539bff6578992e692eea55d380 /themes/tabi-lean/templates/partials/cards_pages.html | |
| parent | 1a4c3216f027d6a6f36104547377b7b21faa5015 (diff) | |
| parent | a2ea06d513a5802964f8f0ef5795cec7e548ed7b (diff) | |
Merge commit 'a2ea06d513a5802964f8f0ef5795cec7e548ed7b' as 'themes/tabi-lean'
Diffstat (limited to 'themes/tabi-lean/templates/partials/cards_pages.html')
| -rw-r--r-- | themes/tabi-lean/templates/partials/cards_pages.html | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/themes/tabi-lean/templates/partials/cards_pages.html b/themes/tabi-lean/templates/partials/cards_pages.html new file mode 100644 index 0000000..89bdabc --- /dev/null +++ b/themes/tabi-lean/templates/partials/cards_pages.html @@ -0,0 +1,46 @@ +{%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%} +{%- set max_projects = max_projects | default(value=999999) -%} +<div class="cards"> + {%- for page in show_pages %} + {# Used only in main page #} + {% if loop.index > max_projects %} + {% break %} + {% endif %} + {# Determine which URL to use, default is page.permalink #} + {%- set blank_target = macros_target_attribute::target_attribute(new_tab=config.markdown.external_links_target_blank and page.extra.link_to) -%} + + {% set target_url = page.extra.link_to | default(value=page.permalink) %} + + <a rel="{{ rel_attributes }}" + {{ blank_target }} + href="{{ target_url }}" + class="card" + {% if page.taxonomies %} + data-tags="{% for tax_name, terms in page.taxonomies %}{% for term in terms | unique %}{{ term | lower }}{% if not loop.last %},{% endif %}{% endfor %}{% endfor %}" + {% endif %}> + {% if page.extra.local_image %} + {% set meta = get_image_metadata(path=page.extra.local_image, allow_missing=true) %} + <img class="card-image" + alt="{{ page.extra.local_image }}" + src="{{ get_url(path=page.extra.local_image) }}" + {% if meta.width %}width="{{ meta.width }}"{% endif %} + {% if meta.height %}height="{{ meta.height }}"{% endif %}> + {% elif page.extra.remote_image %} + <img class="card-image" + alt="{{ page.extra.remote_image }}" + src="{{ page.extra.remote_image }}"> + {% else %} + <div class="card-image-placeholder"></div> + {% endif %} + + <div class="card-info"> + <h2 class="card-title">{{ page.title | markdown(inline=true) | safe }}</h2> + <div class="card-description"> + {% if page.description %} + {{ page.description | markdown(inline=true) | safe }} + {% endif %} + </div> + </div> + </a> + {% endfor -%} +</div> |
