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

1.1.0(4mo ago)051MITPHPPHP ^8.4

Since Jan 5Pushed 4mo 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 1mo ago

READMEChangelogDependencies (2)Versions (6)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

38

—

LowBetter than 85% of packages

Maintenance76

Regular maintenance activity

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

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 ~1 days

Total

5

Last Release

130d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/af70e3d71b3fb87f45c1025d3a21149958da1a416cabbebd4f450e18f920babc?d=identicon)[calevans](/maintainers/calevans)

---

Top Contributors

[![calevans](https://avatars.githubusercontent.com/u/426938?v=4)](https://github.com/calevans "calevans (6 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

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)[humanmade/tachyon-plugin

Rewrites WordPress image URLs to use Tachyon

87338.5k2](/packages/humanmade-tachyon-plugin)

PHPackages © 2026

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