From ee9f2691e8a03f675b55dc08cb75409edb295c67 Mon Sep 17 00:00:00 2001 From: Darius Auding <Darius.auding@gmx.de> Date: Thu, 4 Apr 2024 22:26:55 +0200 Subject: [PATCH] Add shortcode section with params title, img, alt, credit --- templates/shortcodes/section.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 templates/shortcodes/section.html diff --git a/templates/shortcodes/section.html b/templates/shortcodes/section.html new file mode 100644 index 00000000..6d7a2558 --- /dev/null +++ b/templates/shortcodes/section.html @@ -0,0 +1,17 @@ +<section class="section"> + <h2 class="title is-2">{{ title }}</h2> + <div class="columns is-vcentered"> + <div class="column"> + <figure class="image is-4by3"> + {% set image = resize_image(path="@/" ~ page.colocated_path ~ "/" ~ img, width=800, height=600) -%} + <img src="{{image.url}}" alt="{{ alt }}"/> + {% if credit %} + <figcaption class="p-1 has-text-white has-background-black is-size-7 is-italic">{{ credit }}</figcaption> + {% endif %} + </figure> + </div> + <div class="column content"> + {{ body|markdown|safe }} + </div> + </div> +</section> -- GitLab