Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 81 additions & 75 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
# Changelog

[Unreleased changes](https://github.com/justbetter/statamic-structured-data/compare/2.3.0...2.3.0)
## [2.3.0](https://github.com/justbetter/statamic-structured-data/releases/tag/2.3.0) - 2026-07-28

# Changelog

[Unreleased changes](https://github.com/justbetter/statamic-structured-data/compare/2.3.0...2.3.0)
## Unreleased

### Added
- Added optional Runway resource support (templates apply to all models of a resource)
- Added `structured-data:for` tag for explicit item/model rendering

## [2.3.0](https://github.com/justbetter/statamic-structured-data/releases/tag/2.3.0) - 2026-07-28

### Added
- Added SEO Pro support (#32)
- Added base package (#31)

## [2.2.1](https://github.com/justbetter/statamic-structured-data/releases/tag/2.2.1) - 2026-05-05

- Added base package (#31)
## [2.2.1](https://github.com/justbetter/statamic-structured-data/releases/tag/2.2.1) - 2026-05-05
### Fixed
- Fixed vite script loading (#29)

## [2.2.0](https://github.com/justbetter/statamic-structured-data/releases/tag/2.2.0) - 2026-05-05

- Fixed vite script loading (#29)
## [2.2.0](https://github.com/justbetter/statamic-structured-data/releases/tag/2.2.0) - 2026-05-05
### Added
- Added field duplication (#26)
- Added field collapse (#26)
Expand All @@ -22,16 +28,16 @@
- show imported fieldset fields (#28)

### Fixed
- Parse Bard content correctly (#27)

## [2.1.0](https://github.com/justbetter/statamic-structured-data/releases/tag/2.1.0) - 2026-04-13

- Parse Bard content correctly (#27)
## [2.1.0](https://github.com/justbetter/statamic-structured-data/releases/tag/2.1.0) - 2026-04-13
### Added

- Add Support for Laravel 13 (#24)

## [2.0.0](https://github.com/justbetter/statamic-structured-data/releases/tag/2.0.0) - 2026-03-24

- Add Support for Laravel 13 (#24)
## [2.0.0](https://github.com/justbetter/statamic-structured-data/releases/tag/2.0.0) - 2026-03-24
### Added

- Added apply to all action for templates (#19)
Expand All @@ -40,77 +46,77 @@
- Added tests + Small refactor (#22)

### Changed
- Statamic 6 update + Vue 3 & Statamic UI refactor (#23)

## [1.5.0](https://github.com/justbetter/statamic-structured-data/releases/tag/1.5.0) - 2025-12-15

- Statamic 6 update + Vue 3 & Statamic UI refactor (#23)
## [1.5.0](https://github.com/justbetter/statamic-structured-data/releases/tag/1.5.0) - 2025-12-15
### Added

- Added option to auto assign templates to new entries (#17)
- Changed Phpstan level & fixed Phpstan errors + ran Pint (#18)

## [1.4.2](https://github.com/justbetter/statamic-structured-data/releases/tag/1.4.2) - 2025-12-05

- Changed Phpstan level & fixed Phpstan errors + ran Pint (#18)
## [1.4.2](https://github.com/justbetter/statamic-structured-data/releases/tag/1.4.2) - 2025-12-05
### Fixed
- Fixed object array output (#15)

## [1.4.0](https://github.com/justbetter/statamic-structured-data/releases/tag/1.4.0) - 2025-08-26

- Fixed object array output (#15)
## [1.4.0](https://github.com/justbetter/statamic-structured-data/releases/tag/1.4.0) - 2025-08-26
### Added

- Presets (#11)

## [1.3.1](https://github.com/justbetter/statamic-structured-data/releases/tag/1.3.1) - 2025-08-12

- Presets (#11)
## [1.3.1](https://github.com/justbetter/statamic-structured-data/releases/tag/1.3.1) - 2025-08-12
### Fixed

- Dark mode styling fix (#10)

## [1.3.0](https://github.com/justbetter/statamic-structured-data/releases/tag/1.3.0) - 2025-05-20

- Dark mode styling fix (#10)
## [1.3.0](https://github.com/justbetter/statamic-structured-data/releases/tag/1.3.0) - 2025-05-20
### Changed
- Changed injection of structured data (#9)

## [1.2.2](https://github.com/justbetter/statamic-structured-data/releases/tag/1.2.2) - 2025-05-19

- Changed injection of structured data (#9)
## [1.2.2](https://github.com/justbetter/statamic-structured-data/releases/tag/1.2.2) - 2025-05-19
### Changed
- Allow json response from service class (#8)

## [1.2.1](https://github.com/justbetter/statamic-structured-data/releases/tag/1.2.1) - 2025-05-14

- Allow json response from service class (#8)
## [1.2.1](https://github.com/justbetter/statamic-structured-data/releases/tag/1.2.1) - 2025-05-14
### Changed
- Updated readme (#7)

## [1.2.0](https://github.com/justbetter/statamic-structured-data/releases/tag/1.2.0) - 2025-05-14

- Updated readme (#7)
## [1.2.0](https://github.com/justbetter/statamic-structured-data/releases/tag/1.2.0) - 2025-05-14
### Added
- Added numeric field to builder (#5)

## [1.1.0](https://github.com/justbetter/statamic-structured-data/releases/tag/1.1.0) - 2025-05-12

- Added numeric field to builder (#5)
## [1.1.0](https://github.com/justbetter/statamic-structured-data/releases/tag/1.1.0) - 2025-05-12
### Added
- Added support for structured data templates on Terms (#4)

## [1.0.3](https://github.com/justbetter/statamic-structured-data/releases/tag/1.0.3) - 2025-05-09

- Added support for structured data templates on Terms (#4)
## [1.0.3](https://github.com/justbetter/statamic-structured-data/releases/tag/1.0.3) - 2025-05-09
### Fixed

- Skip collection & taxonomy boot when running in console (#3)


## [1.0.2](https://github.com/justbetter/statamic-structured-data/releases/tag/1.0.2) - 2025-05-09

## [1.0.2](https://github.com/justbetter/statamic-structured-data/releases/tag/1.0.2) - 2025-05-09
### Fixed

- Fixed infinite loop when loading variables (#2).

## [1.0.1](https://github.com/justbetter/statamic-structured-data/releases/tag/1.0.1) - 2025-05-02

- Fixed infinite loop when loading variables (#2).
## [1.0.1](https://github.com/justbetter/statamic-structured-data/releases/tag/1.0.1) - 2025-05-02
### Added

- Added Laravel 12 support https://github.com/justbetter/statamic-structured-data/pull/1

## [1.0.0](https://github.com/justbetter/statamic-structured-data/releases/tag/1.0.0) - 2025-04-25

**Initial release**: https://github.com/justbetter/statamic-structured-data/commits/1.0.0

- Added Laravel 12 support https://github.com/justbetter/statamic-structured-data/pull/1
## [1.0.0](https://github.com/justbetter/statamic-structured-data/releases/tag/1.0.0) - 2025-04-25
**Initial release**: https://github.com/justbetter/statamic-structured-data/commits/1.0.0
40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ This Statamic addon provides a powerful and flexible way to add structured data

## Features

- 🔄 Dynamic JSON-LD generation based on entry and term data
- 🔄 Dynamic JSON-LD generation based on entry, term, and Runway model data
- 📝 Template-based structured data configuration
- 📦 Built-in schema presets (WebSite, WebPage, Organization, Article, LocalBusiness)
- 🎯 Support for multiple schemas per page
- 🛠 Antlers template parsing support
- 🧩 Support for replicator-to-JSON-LD field mapping
- ✈️ Optional [Runway](https://statamic.com/addons/rad-pack/runway) resource support
- 💪 Flexible and extensible architecture

## Requirements
Expand Down Expand Up @@ -57,6 +58,7 @@ After publishing the config, you can configure:

- which collections support structured data templates
- which taxonomies support structured data objects
- which Runway resource handles should use structured data templates
- whether presets are enabled
- which default presets are available
- custom preset paths
Expand All @@ -71,11 +73,41 @@ Create templates in your Statamic control panel that define your structured data
- Custom fields with various data types (strings, numeric, arrays, objects)
- Dynamic values using Antlers templating syntax

### 2. Assigning Templates to Entries
### 2. Assigning Templates to Entries and Terms

In your entry or term's content, you can assign one or more structured data templates using the `structured_data_templates` field. The addon will automatically process these templates and generate the appropriate JSON-LD scripts.

### 3. Rendering Structured Data
### 3. Runway resources (optional)

Runway is soft-optional. When `statamic-rad-pack/runway` is installed, templates can target a Runway resource (`blueprint_type: runway` + `use_for_runway`). Those templates apply to **all** models of that resource at render time — there is no per-model template picker.

Enable resources in config:

```php
'runway' => [
'product',
'category',
],
```

For projects that use Runway frontend routing, `structured-data:head` resolves the current model via Runway URI lookup.

For Magento/Rapidez-style routes (or any custom routing), pass the current model explicitly:

**Blade**:

```blade
@isset($product)
{!! Statamic::tag('structured-data:for')->param('item', $product)->param('resource', 'product')->fetch() !!}
@endisset
{!! Statamic::tag('structured-data:head')->fetch() !!}
```

The optional `resource` param forces the Runway handle when the storefront model class differs from the Runway model class.

Available variables for Runway templates include blueprint fields plus model attributes/appends.

### 4. Rendering Structured Data

Render the generated JSON-LD where you need it in your layout:

Expand Down Expand Up @@ -136,4 +168,4 @@ The MIT License (MIT). Please see [License File](LICENSE) for more information.

<a href="https://justbetter.nl" title="JustBetter">
<img src="./art/footer.svg" alt="JustBetter logo">
</a>
</a>
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
},
"autoload-dev": {
"psr-4": {
"Justbetter\\StatamicStructuredData\\Tests\\": "tests"
"Justbetter\\StatamicStructuredData\\Tests\\": "tests",
"StatamicRadPack\\Runway\\": "stubs/runway"
}
},
"require": {
Expand All @@ -24,6 +25,9 @@
"phpstan/phpstan-mockery": "^2.0",
"phpunit/phpunit": "^11.5"
},
"suggest": {
"statamic-rad-pack/runway": "Required to attach structured data templates to Runway resources."
},
"config": {
"allow-plugins": {
"pixelfear/composer-dist-plugin": true,
Expand Down
5 changes: 5 additions & 0 deletions config/structured-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
// Add taxonomy handles here that should have structured data objects
// Example: 'categories', 'tags'
],
'runway' => [
// Add Runway resource handles here that should use structured data templates
// Example: 'product', 'category'
// Templates targeting a Runway resource apply to all models of that resource.
],
'presets' => [
'enabled' => true,
'default_presets' => ['website', 'organization', 'article', 'webpage', 'localbusiness'],
Expand Down
4 changes: 4 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ parameters:
- src
- tests
level: 9
scanFiles:
- stubs/runway/Runway.php
- stubs/runway/Resource.php
- stubs/runway/ModelRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ tabs:
-
key: taxonomy
value: Taxonomy
-
key: runway
value: Runway
default: collection
type: select
display: 'Blueprint type'
Expand Down Expand Up @@ -70,6 +73,19 @@ tabs:
- required
if:
blueprint_type: 'equals taxonomy'
-
handle: use_for_runway
field:
type: structured_data_runway_resources
display: 'Use for Runway resource'
instructions: 'Templates targeting a Runway resource apply to all models of that resource.'
clearable: true
localizable: true
validate:
- sometimes
- required
if:
blueprint_type: 'equals runway'
-
handle: apply_automatically
field:
Expand All @@ -78,6 +94,8 @@ tabs:
instructions: 'Apply the structured data template automatically to new entries of the selected collection or taxonomy.'
localizable: true
default: false
unless:
blueprint_type: 'equals runway'
-
handle: structured_data_available_variables
field:
Expand Down

Large diffs are not rendered by default.

Loading
Loading