Post: Gallery

1 minute read

Published:

These are gallery tests for images wrapped in <figure> elements, as defined in /_includes/gallery. Note that the gallery url and image_path items are automatically prepended with /base_path/images/, so place all of your images in that directory.

To place a gallery you may add the necessary YAML Front Matter:

gallery:
  - url: /assets/images/unsplash-gallery-image-1-th.jpg
    image_path: /assets/images/unsplash-gallery-image-1-th.jpg
    alt: "placeholder image 1"
    title: "Image 1 title caption"
  - url: /assets/images/unsplash-gallery-image-2-th.jpg
    image_path: /assets/images/unsplash-gallery-image-2-th.jpg
    alt: "placeholder image 2"
    title: "Image 2 title caption"
  - url: /assets/images/unsplash-gallery-image-3-th.jpg
    image_path: /assets/images/unsplash-gallery-image-3-th.jpg
    alt: "placeholder image 3"
    title: "Image 3 title caption"
  - url: /assets/images/unsplash-gallery-image-4-th.jpg
    image_path: /assets/images/unsplash-gallery-image-4-th.jpg
    alt: "placeholder image 4"
    title: "Image 4 title caption"

And then drop-in the gallery include — the gallery caption is optional.

{% include gallery caption="This is a sample gallery with **Markdown support**." %}
placeholder image 1 placeholder image 2 placeholder image 3 placeholder image 4 placeholder image 5 placeholder image 6 placeholder image 7 placeholder image 8 placeholder image 9 placeholder image 10 placeholder image 11 placeholder image 12
This is a sample gallery with Markdown support.

This is some text after the gallery just to make sure that everything aligns properly. To include images, you may also place the <figure> class directly in the body text. By the way, this allows you to bypass the auto-prepend of the /base_path/images directory, as shown in the fenced code block:

<figure class="third">
    <img src="/assets/images/unsplash-gallery-image-3-th.jpg" title="Image 1">
    <img src="/assets/images/unsplash-gallery-image-2-th.jpg" title="Image 2">
    <img src="/assets/images/unsplash-gallery-image-3-th.jpg" title="Image 3">
    <figcaption>Caption describing these three images.</figcaption>
</figure>
Caption describing these three images.

Investigate fortran syntax highlighting:

do i = 1,10
  a = a+i
end do