clivewalkden / jigsaw-sitemap
Jigsaw的网站地图和网站地图索引构建器。
v1.3.1
2022-11-09 14:11 UTC
Requires
- samdark/sitemap: ^2.2
- tightenco/jigsaw: ^1.3.16
This package is auto-updated.
Last update: 2024-09-09 18:39:54 UTC
README
为Jigsaw提供网站地图和网站地图索引构建器。
使用方法
在bootstrap.php
中将它添加为一个事件监听器。
use CliveWalkden\JigsawSitemap\SitemapListener; /** * An afterBuild event is fired after the build is complete, and all output files * have been written to the build directory. This allows you to obtain a list of * the output file paths (to use, for example, when creating a sitemap.xml file), * programmatically create output files, or take care of any other post-processing tasks. * * @link http://jigsaw.tighten.co/docs/event-listeners/ */ $events->afterBuild([ SitemapListener::class, ]);
注意:您可以通过在
config.php
中添加以下内容来排除网站地图中的文件
'sitemap' => [ 'url_trailing_slash' => true, 'exclude' => [ '.htaccess', 'favicon.ico', // ... ], 'image_sitemap' => [ 'generate' => true, 'filename' => 'sitemap_images.xml', 'extensions' => [ 'gif', 'jpg', 'jpeg', 'png', // ... ] ] ],
Laravel 6更新(Jigsaw 1.3.16+)
Clive Walkden为了使插件与Jigsaw 1.3.16+中使用的Laravel 6组件兼容而进行的更新。所有以前的工作都是由Ryan Scherler完成的。
变更日志
要查看变更日志,请打开CHANGELOG.md