rapidez/sitemap
Composer 安装命令:
composer require rapidez/sitemap
包简介
Rapidez sitemap index through Eventy filters
README 文档
README
Rapidez sitemap index through Eventy filters
Installation
composer require rapidez/sitemap
Configuration
You can publish the configuration file with:
php artisan vendor:publish --tag=config --provider="Rapidez\Sitemap\SitemapServiceProvider"
This will create a config/rapidez-sitemap.php file where you can configure:
disk: The Laravel filesystem disk to use (defaults to 'public')path: The path within the disk where sitemaps will be stored (defaults to root)
Make sure the specified disk is properly configured in your application's config/filesystems.php.
Views
You can publish the views with:
php artisan vendor:publish --tag=rapidez-sitemap-views
Sitemap Generation
To generate the sitemap manually, use:
php artisan rapidez:sitemap:generate
This command will generate sitemap.xml for the default store and sitemap_{store_id}.xml for additional stores in your configured storage location.
If you'd like to schedule the sitemap generation you can add the rapidez:sitemap:generate command in routes/console.php, for more information see Task Scheduling
Schedule::command('rapidez:sitemap:generate')->twiceDaily(0, 12);
Hooking into the Generation Action
When the rapidez:sitemap:generate command runs, an Eventy action rapidez.sitemap.generate is triggered.
You can hook into this generation process by adding an action in the boot method of your service provider:
Eventy::addAction('rapidez.sitemap.generate', fn() => DoMagicHere(), 20, 1);
Adding Additional Sitemap Indexes with Eventy
If you have additional indexes, such as CMS pages or other custom routes, you can dynamically add them to your sitemap index based on the Store ID using the rapidez.site.{storeId} filter provided by Eventy.
To do this, simply add the following code to the appropriate place in your application (e.g., in a service provider or a dedicated sitemap configuration file):
use TorMorten\Eventy\Facades\Eventy; Eventy::addFilter('rapidez.sitemap.{storeId}', function ($sitemaps) { // Add your custom sitemap URL here $sitemaps[] = [ 'url' => 'your-custom-sitemap.xml', 'lastmod' => now()->toDateString(), ]; return $sitemaps; }, 20, 1);
License
GNU General Public License v3. Please see License File for more information.
rapidez/sitemap 适用场景与选型建议
rapidez/sitemap 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.02k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2024 年 11 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Sitemap」 「rapidez」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 rapidez/sitemap 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rapidez/sitemap 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 rapidez/sitemap 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Symfony sitemap generator
PHP Simple Sitemap Generator
Rapidez Reviews
Interfaces for web resource models and services to retrieve and create them
Rapidez Experius Postcode NL implementation
Rapidez Amasty Label
统计信息
- 总下载量: 7.02k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 20
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2024-11-05