justbetter/statamic-structured-data 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

justbetter/statamic-structured-data

最新稳定版本:1.5.0

Composer 安装命令:

composer require justbetter/statamic-structured-data

包简介

无描述信息

README 文档

README

Banner

Statamic Structured Data

This Statamic addon provides a powerful and flexible way to add structured data (JSON-LD) to your Statamic website. It allows you to define structured data templates and automatically inject them into your pages, improving your site's SEO and making your content more understandable for search engines.

Features

  • ???? Dynamic JSON-LD generation based on entry and term data
  • ???? Template-based structured data configuration
  • ???? Automatic injection of structured data into your pages
  • ???? Support for multiple schemas per page
  • ???? Antlers template parsing support
  • ???? Flexible and extensible architecture

Requirements

  • PHP ^8.2 or ^8.3
  • Laravel ^11.0
  • Statamic ^5.0

Installation

You can install this addon via Composer:

composer require justbetter/statamic-structured-data

After installing make sure to load the Structured Data tag in your head.

Blade:

{!! Statamic::tag('structured-data:head')->fetch() !!}

Antlers

{{ structured-data:head }}

Configuration

Make sure to publish the config by running:

php artisan vendor:publish --tag=justbetter-structured-data

You can now find the config file at config/justbetter/structured-data.php. After publishing the config, you can set the collections and taxonomies that should have structured data templates.

Usage

1. Creating Structured Data Templates

Create templates in your Statamic control panel that define your structured data schemas. Each template can contain multiple schema definitions with:

  • Special properties (@context, @type, @id)
  • Custom fields with various data types (strings, numeric, arrays, objects)
  • Dynamic values using Antlers templating syntax

2. Assigning Templates to Entries

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. Automatic Injection

The addon automatically injects the generated JSON-LD scripts into your pages before the closing </body> tag. No additional configuration is required.

Example Schema

Here's an example of how you might structure a basic Organization schema:

{ "specialProps": { "context": "https://schema.org", "type": "Organization", "id": "https://example.com" }, "fields": [ { "key": "name", "type": "string", "value": "{{ company_name }}" }, { "key": "url", "type": "string", "value": "{{ config:app:url }}" } ] }

Credits

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

License

The MIT License (MIT). Please see License File for more information.

JustBetter logo

统计信息

  • 总下载量: 3.41k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 5
  • Forks: 2
  • 开发语言: Vue

其他信息

  • 授权协议: Unknown
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固