PHPackages                             calevans/staticforge-gallery - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. calevans/staticforge-gallery

ActiveLibrary[Image &amp; Media](/categories/media)

calevans/staticforge-gallery
============================

StaticForge Feature: PhotoGallery

2.0.2(2mo ago)081MITPHPPHP ^8.4

Since Jan 5Pushed 2mo agoCompare

[ Source](https://github.com/calevans/staticforge-gallery)[ Packagist](https://packagist.org/packages/calevans/staticforge-gallery)[ RSS](/packages/calevans-staticforge-gallery/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (9)Used By (1)

PhotoGallery Feature
====================

[](#photogallery-feature)

The **PhotoGallery** feature for StaticForge allows you to easily embed responsive, justified image galleries into your static site. It leverages the power of [Justified Gallery](http://miromannino.github.io/Justified-Gallery/) and [Magnific Popup](https://dimsemenov.com/plugins/magnific-popup/) to provide a seamless and beautiful viewing experience.

Overview
--------

[](#overview)

This feature scans a specified directory for images and generates the necessary HTML, CSS, and JavaScript to display them in a grid layout. It automatically handles asset injection and script initialization, making it a "drop-in" solution for image galleries.

Installation
------------

[](#installation)

To install the PhotoGallery feature, require it via Composer in your StaticForge project:

```
composer require calevans/gallery
```

Once installed, the feature will be automatically discovered by StaticForge.

Usage
-----

[](#usage)

The feature registers a `[gallery]` shortcode that you can use in your Markdown content.

### Basic Usage

[](#basic-usage)

To display a gallery of images located in `content/assets/images/vacation`, use the following shortcode. Note that the `id` attribute is required and must be unique for each gallery on a page:

```
[gallery path="assets/images/vacation" id="my-vacation-gallery"]
```

### Customizing the Layout

[](#customizing-the-layout)

You can customize the appearance of the gallery using additional attributes:

```
[gallery path="assets/images/portfolio" id="portfolio-gallery" rowHeight="250" margins="15" lastRow="justify"]
```

### Available Attributes

[](#available-attributes)

AttributeDescriptionDefault`path`**Required**. The path to the directory containing your images, relative to your source directory (e.g., `assets/images/my-gallery`).N/A`id`**Required**. A unique identifier for the gallery (e.g., `vacation-pics`).N/A`rowHeight`The preferred height of rows in pixels.`200``margins`The margin between images in pixels.`10``lastRow`How to handle the last row. Options: `nojustify`, `justify`, `hide`, `center`, `right`, `left`.`nojustify``limit`The number of images to show initially. A "Load More" button will appear if there are more images.`20`Technical Details
-----------------

[](#technical-details)

### Asset Management

[](#asset-management)

The feature is designed to copy its assets (CSS and JS files) to your output directory, listening to the `POST_LOOP` event to copy files from `src/assets/vendor` to `[OUTPUT_DIR]/assets/vendor/gallery`. However, the current Shortcode implementation utilizes **CDNs** (cdnjs.cloudflare.com) for Justified Gallery, Magnific Popup, and jQuery to ensure fast loading and reliability.

### Shortcode Processing

[](#shortcode-processing)

When the `[gallery]` shortcode is encountered, the `GalleryService` scans the provided `path` for supported image files (`jpg`, `jpeg`, `png`, `gif`, `webp`). It generates the initial HTML structure and registers the necessary CSS and JavaScript files from CDNs. If the number of images exceeds the `limit`, it automatically generates a "Load More" button and handles the pagination logic via JavaScript. Finally, it appends an initialization script to the output to activate the gallery and lightbox.

### Dependencies

[](#dependencies)

This feature relies on **jQuery**, **Justified Gallery** (v3.8.1), and **Magnific Popup** (v1.1.0) which are loaded via CDN.

License
-------

[](#license)

This project is licensed under the MIT License.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance87

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~16 days

Recently: every ~29 days

Total

8

Last Release

63d ago

Major Versions

1.1.0 → 2.0.02026-05-01

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/426938?v=4)[Cal Evans](/maintainers/calevans)[@calevans](https://github.com/calevans)

---

Top Contributors

[![calevans](https://avatars.githubusercontent.com/u/426938?v=4)](https://github.com/calevans "calevans (12 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/calevans-staticforge-gallery/health.svg)

```
[![Health](https://phpackages.com/badges/calevans-staticforge-gallery/health.svg)](https://phpackages.com/packages/calevans-staticforge-gallery)
```

###  Alternatives

[goat1000/svggraph

Generates SVG graphs

135911.1k3](/packages/goat1000-svggraph)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

16653.6k2](/packages/gravatarphp-gravatar)[rsoury/wp-imgix

Rewrites WordPress image URLs to use ImgIX

167.2k](/packages/rsoury-wp-imgix)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
