How to Create Gallery

Battle in a futuristic city

Posted by Jason-json on September 5, 2025

This a template of galley:

You can write the text of your blog post, paragraphs like normal, before and/or after the gallery.

Step 1: Prepare & Upload Images

  1. Create a new folder for your gallery (e.g., /img/gallery/my-new-gallery/).
  2. Optimize your images (use lowercase .jpg or .png files).
  3. Upload the images to the new folder.

Step 2: Add Image List to Post Front Matter

In the YAML front matter (between the --- lines) of your .md post file, add a gallery_items list:

gallery_items:
  - name: "image-1.jpg"
    alt: "A descriptive alt text for the first image."
    caption: "Optional caption for image one"
  - name: "image-2.jpg"
    alt: "A descriptive alt text for the second image."
    caption: "Optional caption for image two"

Step 3: Place the Gallery in Your Post

In the body of your post, add the following line where you want the gallery to appear. Remember to update the path!

{% include image-gallery.html images=page.gallery_items path="/img/gallery/my-new-gallery/" %}