isaadsalman/headless-refresh 问题修复 & 功能扩展

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

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

isaadsalman/headless-refresh

最新稳定版本:1.0.1

Composer 安装命令:

composer require isaadsalman/headless-refresh

包简介

Statamic addon for triggering headless updates.

README 文档

README

The Statamic Headless Refresh addon enhances your Statamic experience by seamlessly integrating headless CMS capabilities. It provides a convenient dashboard widget that allows you to trigger updates to your decoupled website directly from the Statamic backend. The plugin also supports automated URL triggers tied to specific events, such as when an entry is saved, ensuring your headless site is always up-to-date. Events are also customizable.

Key Features

  1. Dashboard Widget: Optionally add a widget to your Statamic dashboard for easy manual refreshes.
  2. Event-Driven Triggers: Automate the refresh process by tying URL triggers to events like entry saves.

Effortlessly manage and synchronize your headless CMS updates with Statamic Headless Refresh.

Installation

To install the Headless Refresh addon, follow these steps:

  1. Install the addon via Composer:

    composer require isaadsalman/headless-refresh
  2. Publish the addon assets and configuration:

    php artisan vendor:publish --tag=headless-refresh-config
  3. Update the configuration file config/statamic/headless-refresh.php as needed (see the Configuration section below).

Configuration

The configuration for the Headless Refresh addon is found in config/statamic/headless-refresh.php. Modify the following options as required:

return [
    'event_trigger' => env('HEADLESS_REFRESH_EVENT_TRIGGER', false),
    'trigger_link' => env('HEADLESS_REFRESH_TRIGGER_LINK', null),
    'deployment_message' => env('HEADLESS_REFRESH_DEPLOYMENT_MESSAGE', "Deployed"),
    'events' => [
        Statamic\Events\EntrySaved::class,
        Statamic\Events\EntryDeleted::class,
        Statamic\Events\NavSaved::class,
        Statamic\Events\NavDeleted::class,
        Statamic\Events\NavTreeSaved::class,
        Statamic\Events\NavTreeDeleted::class,
        Statamic\Events\TaxonomySaved::class,
        Statamic\Events\TaxonomyDeleted::class,
    ],
    'live_updates_notice_title' => 'Live Updates Notice',
    'live_updates_notice_text' => 'Please note that your updates will be visible online within 5 minutes from when you save an entry. If you require immediate visibility, simply click the button below.',
    'live_updates_notice_button' => 'Refresh Now'
];

Configuration Options:

  • event_trigger: Set to true to enable the event-based trigger.
  • trigger_link: Define the URL or link that triggers the headless refresh.
  • deployment_message: Customize the message displayed upon successful deployment.
  • events: Specify the events that should trigger the headless refresh.
  • live_updates_notice_title: Widget title
  • live_updates_notice_text: Widget description text
  • live_updates_notice_button: Widget button text.

Usage

Event-Based Trigger (Optional)

To enable the event-based trigger, set the event_trigger to true in the configuration file. This will trigger the headless refresh based on specified events.

Dashboard Widget

You can add the Headless Refresh widget to your dashboard by including it using its handle 'headless-refresh'.

统计信息

  • 总下载量: 136
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-12-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固