satnaing / astro-paper

A minimal, accessible and SEO-friendly Astro blog theme
https://astro-paper.pages.dev/
MIT License
2.12k stars 440 forks source link

Add image gallery functionality. #316

Open absurditiesmediallc opened 1 week ago

absurditiesmediallc commented 1 week ago

Hoping you'll find this useful. I needed the functionality, so I'm offering it to you.

I mirrored the implementation of blog posts, and used photoswipe for a lightbox. Whether you're interested in adding it or not, I'd appreciate any feedback you have to offer.

I'm open to making changes to the implementation based on your vision for how something like this should work.

works like this,

add a directory of images under /content/src/albums/[new-album] add a file describing the album /content/src/albums/[new-album].yml

author: "Author Name"
pubDatetime: 2024-01-23T15:22:00Z
modDatetime: 2024-02-21T09:12:47.400Z
title: "Album 1"
description: "This is an album"
featured: true
draft: false
tags: ['Photography', 'People']
cover: './album1/cover.jpg'
canonicalURL: 'https://example.com/albums/album1/'
slug: 'album1'