stefandoorn/sitemap-plugin
Composer 安装命令:
composer require stefandoorn/sitemap-plugin
包简介
Sitemap Plugin for Sylius
关键字:
README 文档
README
Big thanks
Goes out to the Sylius team. The core code of this plugin is created by the Sylius team. Unfortunately it got removed from the Sylius core. Luckily the Sylius team approved the extraction to a separate bundle.
Features
- Creates a sitemap index file to point to sub sitemap files per type of data
- Default providers: taxons, products & static content (homepage & contact)
- Easily add your own providers
- Product provider supports locales (hreflang) & is channel aware
- Taxon provider supports locales (hreflang)
Installation
- Run
composer require stefandoorn/sitemap-plugin. - Add to
app/config/bundles.php:
SitemapPlugin\SitemapPlugin::class => ['all' => true],
- Add to
app/config/packages/_sylius.yaml:
- { resource: "@SitemapPlugin/Resources/config/config.yaml" }
- Add to
app/config/routes.yaml:
sylius_sitemap:
resource: "@SitemapPlugin/Resources/config/routing.yml"
-
Add to
app/config/packages/sylius_sitemap.yaml: -
Forcing HTTPS on Generated URLs, see Symfony Docu. In console commands, where there is no HTTP request, URLs use http by default. You can change this globally with these configuration parameters:
# config/services.yaml
parameters:
router.request_context.scheme: 'https'
Usage
Generate your sitemap from the CLI:
$ bin/console sylius:sitemap:generate
Add this command to your cronjob to regularly generate a new sitemap, e.g. once a day.
If you only want to generate the sitemap for a specific channel, use:
$ bin/console sylius:sitemap:generate --channel=US_WEB
The plugin defines three default URI's:
sitemap.xml: redirects tositemap_index.xmlsitemap_index.xml: renders the sitemap index file (with links to the provider xml files)
Next to this, each provider registers its own URI. Take a look in the sitemap index file for the correct URI's.
Default Configuration
Get a full list of configuration: bin/console config:dump-reference sitemap
sitemap: providers: products: true taxons: true static: true template: '@SitemapPlugin/show.xml.twig' index_template: '@SitemapPlugin/index.xml.twig' exclude_taxon_root: true hreflang: true images: true static_routes: - { route: sylius_shop_homepage, parameters: [], locales: [] } - { route: sylius_shop_contact_request, parameters: [], locales: [] }
The request context is also important for generating the URLs inside the sitemap:
- The hostname is defined per channel, if nothing set it defaults to
localhost - Other request context settings can be adjusted as mentioned in the Symfony docs
Default storage
By default, the sitemaps will be saved in %kernel.root_dir%/var/sitemap. You can change this setting
by adjusting the parameter sylius.sitemap.path.
Feature switches
providers: Enable/disable certain providers to be included in the sitemap. Defaults are true.exclude_taxon_root: Often you don't want to include the root of your taxon tree as it has a generic name as 'products'.hreflang: Whether to generate alternative URL versions for each locale. Defaults to true. Background: https://support.google.com/webmasters/answer/189077?hl=en.images: Whether to add images to URL output in case the provider adds them. Defaults to true. Background: https://support.google.com/webmasters/answer/178636?hl=en.
Default providers
- Products
- Taxons
- Static content (homepage & contact)
Add own provider
- Register & tag your provider service with
sylius.sitemap_provider - Let your provider implement
UrlProviderInterface - Use one of the default providers as an example to implement code
stefandoorn/sitemap-plugin 适用场景与选型建议
stefandoorn/sitemap-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.07M 次下载、GitHub Stars 达 84, 最近一次更新时间为 2017 年 04 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sylius」 「sylius-plugin」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 stefandoorn/sitemap-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 stefandoorn/sitemap-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 stefandoorn/sitemap-plugin 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Implementation of the Omnibus Directive for Sylius application.
Bulk export of sylius resources
Sylius plugin that integrates Addwish
Setono example plugin for Sylius.
Will translate fragments of text automatically
Use price tiers in your Sylius store.
统计信息
- 总下载量: 1.07M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 84
- 点击次数: 24
- 依赖项目数: 3
- 推荐数: 6
其他信息
- 授权协议: MIT
- 更新时间: 2017-04-12