rias/craft-ssg
最新稳定版本:1.2.1
Composer 安装命令:
composer require rias/craft-ssg
包简介
Static Site Generation for Craft CMS
README 文档
README
Static Site Generation
Static Site Generation for Craft CMS
Requirements
This plugin requires Craft CMS 5.4.0 or later, and PHP 8.2 or later.
Installation
You can install this plugin from the Plugin Store or with Composer.
From the Plugin Store
Go to the Plugin Store in your project’s Control Panel and search for “ssg”. Then press “Install”.
With Composer
Open your terminal and run the following commands:
# go to the project directory cd /path/to/my-project.test # tell Composer to load the plugin composer require rias/craft-ssg # tell Craft to install the plugin ./craft plugin/install ssg
Usage
You can configure how SSG generates your static site through the plugin settings or the config file.
Generate your static site by running:
php craft ssg/static/generate
Events
You can listen to events and add additional functionality like this:
use craft\base\Event; use rias\ssg\SSG; use rias\ssg\events\BeforeGeneratingEvent; Event::on( SSG::class, SSG::EVENT_BEFORE_GENERATING, function (BeforeGeneratingEvent $event) { // Your code here } );
A list of events can be found below.
SSG::EVENT_BEFORE_GENERATING
This event is fired before generating a site. You can set ->isValid to false on the event to cancel the generation.
SSG::EVENT_AFTER_GENERATING
This event is fired after generating a site.
Demo
You can find a demo of the europa museum demo statically generated here.
统计信息
- 总下载量: 23
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: mit
- 更新时间: 2024-10-09