I am using Sitecore 10
and Angular JSS
without SXA
, I did not install it, so my question is how I can generate an XML sitemap
to our site?
-
What have you tried?– Richard Seal ♦Jun 3, 2021 at 14:04
-
I do not have idea about how to create it, and what i found in sitecore documentation doc.sitecore.com/developers/sxa/93/… related to SXA. so i need to know how i can generate it while iam using JSS not SXA.– shimaa elsayedJun 3, 2021 at 14:10
2 Answers
You can generate an XML sitemap by inheriting the sitemap SXA templates
on the JSS
settings template.
Please inherit the base template named _SitemapSettings
from below mentioned path to the JSS
setting template
/sitecore/templates/Feature/Experience Accelerator/SiteMetadata/Sitemap/_SitemapSettings
And another template named _Sitemap
from below mentioned path to the corresponding route template you have created.
/sitecore/templates/Feature/Experience Accelerator/SiteMetadata/Sitemap/_Sitemap
You can also check out the detailed blog about this on the below link. (For transparency, this is my personal blog post).
https://www.linkedin.com/pulse/steps-enable-sxa-sitemapxml-robotstxt-feature-sitecore-nijas-hameed/
To generate the sitemap, you will still need to go through the Sitecore Pipelines. The pipeline responsible for the sitemap would be httpRequestBegin
.
Even if you are not using SXA, you may try to see how the sitemap has been implemented. Moreover, there are many online resources on how to implement sitemap on Sitecore, examples:
If you want to see how the sitemap is implemented in SXA, you can check the following namespace
Sitecore.XA.Feature.SiteMetadata.Pipelines.HttpRequestBegin.SitemapHandler, Sitecore.XA.Feature.SiteMetadata
-
I'm not sure this really classifies as an answer for the OP question. The user is using a headless approach and therefore generating a sitemap via the CD server will likely not suffice here, since they'll need the sitemap generated on their rendering host(s). Feb 8, 2022 at 22:53