当前位置:网站首页>关于 Spartacus 的 sitemap.xml 问题
关于 Spartacus 的 sitemap.xml 问题
2022-06-27 14:24:00 【Jerry Wang】
在 SAP Commerce 中,可以使用 cronJob 生成 XML 站点地图。 这个 cronJob 将收集当前站点中的所有页面,并构建一个带有每个页面的 url 的媒体文件。 将根据页面类型创建单独的文件。 稍后当使用旧的加速器店面(使用 Web 模块配置 /yacceleratorstorefront 扩展)并访问 /yacceleratorstorefront/sitemap.xml url 时,将显示站点地图索引,其中包含对所有部分站点地图的引用。
站点地图允许网站管理员通知搜索引擎他们网站上可用于索引的页面。 Accelerator 支持不同页面类型(例如产品页面和类别页面)以及不同语言和货币的站点地图。
在最简单的形式中,站点地图是一个 XML 文件,其中列出了站点的 URL,以及有关每个 URL 的其他元数据,以便搜索引擎可以更智能地索引站点。 元数据的示例包括有关 URL 上次更新时间、更改频率、相对于站点中其他 URL 的重要性等信息。
站点地图通过以下 URL 在 Accelerator 中公开:
http://electronics.local:9001/yacceleratorstorefront/sitemap.xml。
下面是一个 sitemap index 的一个例子:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>http://electronics.local:9001/medias/Homepage-ja-JPY-3422021852412885281.xml?context=bWFzdGVyfHJvb3R8MzQwfHRleHQveG1sfGgyNi9oNTUvODc5NzA3NjQyMjY4Ni54bWx8ODhkMDBhODYyMGU5OGY4YTRlMGVjNTE1MmVkMTgxOWYxNDBkOTU0MjU0MjRlZmZhODA5ZWNkY2Q2YzJlZmFhYg</loc>
</sitemap>
</sitemapindex>Accelerator 里负责生成 sitemap 的代码:SiteMapController.java
客户通常需要一种机制来自动发现所有 Spartacus 页面 (URL),以便生成站点地图,或在 SSR/SSG 中预渲染它们。这是一项跨组件和模块的任务,需要整合许多信息和机制:
- 收集 backoffice 定义的所有 categories
- 收集 backoffice 定义的所有 products
- 收集 Spartacus / 客户应用程序中定义的所有静态 Angular 路由
- 使用 Spartacus 路由配置来塑造特定的 PDP、PLP 和内容页面的 URL
- 更多
对于某些页面,您可能希望生成规范的 URL 替代方案。 (注意:Spartacus 具有规范 URL 的功能,用于将链接放置在当前文档的 <head> 中;也许它可以以某种方式适应生成站点地图/ URL 发现…)
对于产品列表,收集想要索引的 URL 中的所有构面组合或搜索查询
对于内容页面,了解所有 Spartacus CMS 驱动的子路由。例如,在后台有一个带有页面标签 /store-finder 的单个内容页面,但在 Spartacus 中,该单个内容页面顶部的 CMS 驱动的子路由是:/store-finder(父)、/store-finder/view-全部, /store-finder/country/:country, /store-finder/country/:country/region/:region, … .对于特定功能,例如 store-finder,还需要收集所有可能且有效的动态 URL 参数组合(例如 :country、:region)。
由于复杂性(涉及的各种机制)和规模(大量产品、类别等),发现所有 Spartacus 页面的过程需要自动化。为了使站点地图保持最新状态,客户应定期运行该流程,以了解内容经理添加新页面、产品、类别和方面的频率。
边栏推荐
- Bidding announcement: Oracle database maintenance service procurement of the First Affiliated Hospital of Jinan University
- Handling methods for NVIDIA deepstream running delay, jamming and crash
- NLP - monocleaner
- 初识云原生安全:云时代的最佳保障
- What kind of experience is it to read other people's code
- 剑指 Offer II 039. 直方图最大矩形面积 单调栈
- Référence forte, faible, douce et virtuelle de threadlocal
- AQS Abstract queue synchronizer
- Integration of entry-level SSM framework based on XML configuration file
- Daily 3 questions (1): find the nearest point with the same X or Y coordinate
猜你喜欢
随机推荐
【微服务|Sentinel】热点规则|授权规则|集群流控|机器列表
Is flutter easy to learn? How to learn? The most complete introduction and actual combat of flutter in history. Take it away without thanks~
机械硬盘和ssd固态硬盘的原理对比分析
【每日3题(3)】盒子中小球的最大数量
Buuctf Misc
Why must Oracle cloud customers self test after the release of Oracle cloud quarterly update?
CCID Consulting released the database Market Research Report on key application fields during the "14th five year plan" (attached with download)
剑指 Offer II 039. 直方图最大矩形面积 单调栈
NLP - monocleaner
【业务安全03】密码找回业务安全以及接口参数账号修改实例(基于metinfov4.0平台)
AQS Abstract queue synchronizer
隱私計算FATE-離線預測
易周金融 | Q1手机银行活跃用户规模6.5亿;理财子公司布局新兴领域
Great God developed the new H5 version of arXiv, saying goodbye to formula typography errors in one step, and the mobile phone can easily read literature
A brief analysis of the differences between domestic and foreign e-commerce
初识云原生安全:云时代的最佳保障
Kyndryl partnered with Oracle and Veritas
In the past, domestic mobile phones were arrogant in pricing and threatened that consumers would like to buy or not, but now they have plummeted by 2000 for sale
Leetcode 724. Find the central subscript of the array (yes, once)
At a time of oversupply of chips, China, the largest importer, continued to reduce imports, and the United States panicked







