alt-design/alt-sitemap 问题修复 & 功能扩展

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

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

alt-design/alt-sitemap

最新稳定版本:v1.3.3

Composer 安装命令:

composer require alt-design/alt-sitemap

包简介

Alt Sitemap addon, create a sitemap from Statamic entries

README 文档

README

Alt Sitemap is a Statamic addon for creating sitemaps to help search engines discover URLs on your site

Features

  • Create basic sitemaps detailing and of all entries in your Statamic site.
  • Set priority of entire collections/taxonomies
  • Set priority of specific entries/terms
  • Exclude certain entries/terms from the sitemap.
  • Exclude entire collections/taxonomies from the sitemap.

How to Install

You can search for this addon in the Tools > Addons section of the Statamic control panel and click install, or run the following command from your project root:

composer require alt-design/alt-sitemap

How to Use

After installation, access your sitemap at /sitemap.xml

  • Set priorities for entire collections/taxonomies in CP > Tools > Alt Sitemap.
  • Exclude entire collections/taxonomies in CP > Tools > Alt Sitemap.
  • Set entry/term priorities in the entry/term under the Alt Sitemap tab. Entry priorities will override collection/taxonomy priorities.
  • Priorities are set as 0.5 by default.
  • Exclude entries/terms from the sitemap in the entry under the Alt Sitemap tab.
  • is set to the last updated date of the entry/term.

Manual Entries

Add a single, or multiple items to the sitemap, using code similar to the following in a service provider's boot() (e.g. AppServiceProvider) method.

Using registerItem() to register a single item.

$this->callAfterResolving(
    AltSitemapController::class,
    function ($altSitemapController) {
        $altSitemapController->registerItem(
            [
                '/url-1',
            ]
        );
    }
);

Using registerItems() to register multiple items at once.

$this->callAfterResolving(
     AltSitemapController::class,
     function ($altSitemapController) {
         $altSitemapController->registerItems(
             [
                 [
                     '/url-1',
                 ],
                 [
                     '/url-2',
                     Carbon::create(2024,10,23,12,20,0, 'UTC'),
                 ],
                 [
                     '/url-3',
                     Carbon::create(2024,10,23,12,20,0, 'UTC'),
                     0.8
                 ],
             ]
         );
     }
 );

Questions etc

Drop us a big shout-out if you have any questions, comments, or concerns. We're always looking to improve our addons, so if you have any feature requests, we'd love to hear them.

Starter Kits

Addons

Postcardware

Send us a postcard from your hometown if you like this addon. We love getting mail from other cool peeps!

Alt Design
St Helens House
Derby
DE1 3EE
UK

统计信息

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

GitHub 信息

  • Stars: 11
  • Watchers: 3
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-06