git send-email poast

This commit is contained in:
Jade Lovelace 2022-04-22 22:05:21 -07:00
parent f6444034c3
commit 06091bbbb3
6 changed files with 175 additions and 23 deletions

View file

@ -7,7 +7,7 @@
{% endif %}
<article class="homepage-article" typeof="BlogPosting" resource="{{ page.permalink | safe }}">
<a class="homepage-link" href="{{ page.permalink | safe }}">
<h2 property="headline">{{ page.title }}</h2>
<h2 property="headline">{{ page.title | markdown(inline=true) | safe }}</h2>
</a>
<div class="detail">
<span property="datePublished"
@ -21,4 +21,4 @@
{% if config.extra.debug and config.mode == "Serve" %}
<pre><code>{{ __tera_context | escape | safe }}</code></pre>
{% endif %}
{% endblock content %}
{% endblock content %}

View file

@ -0,0 +1,32 @@
{%- import "macros/colocated_asset.html" as colocated_asset -%}
{%- macro image(name, alt, colocated, height) -%}
{%- set name_sanitized = name | replace(from=".", to="-") | replace(from="/", to="-") -%}
{%- set image_id = "image" ~ name_sanitized -%}
{%- if colocated == true -%}
{%- set image_path = colocated_asset::colocated_asset(path=name) -%}
{%- set image_url = name -%}
{%- else -%}
{%- set image_path = "/static/images/" ~ name -%}
{%- set image_url = get_url(path=image_path) -%}
{%- endif -%}
{%- set image = resize_image(path=image_path, width=800, height=height, op="fit") -%}
<div class="image">
<a href="{{ image_url }}">
<img src="{{ image.url }}"
alt="{{ alt }}"
title="{{ alt }}"
{% if label %}
aria-describedby="{{ image_id }}"
{% endif %}
>
</a>
{% if label %}
<span class="image-label" id="{{ image_id }}">
{{ label }}
</span>
{% endif %}
</div>
{%- endmacro image -%}

View file

@ -18,7 +18,7 @@
{% block content %}
<div class="post" typeof="BlogPosting">
<header class="page-header">
<h1 property="headline">{{ page.title }}</h1>
<h1 property="headline">{{ page.title | markdown(inline=true) | safe }}</h1>
{% if not page.extra.isPage %}
<div class="detail page-detail">

View file

@ -1,20 +1,9 @@
{% set name_sanitized = name | replace(from=".", to="-") | replace(from="/", to="-") %}
{% set image_id = "image" ~ name_sanitized %}
{% set alt = alt | default(value=body) %}
{% set height = height | default(value=600) %}
<div class="image">
<a href="{{ get_url(path="images/" ~ name) }}">
<img src="{{ resize_image(path="../static/images/" ~ name, width=800, height=height, op="fit") }}"
alt="{{ alt }}"
title="{{ alt }}"
{% if label %}
aria-describedby="{{ image_id }}"
{% endif %}
>
</a>
{% if label %}
<span class="image-label" id="{{ image_id }}">
{{ label }}
</span>
{% endif %}
</div>
{%- import "macros/image.html" as image -%}
{{ image::image(
name=name,
colocated=colocated | default(value=false),
alt=alt | default(value=body),
height=height | default(value=600)
) }}