From 496e071b92894eae99bcce450fea24e32d763831 Mon Sep 17 00:00:00 2001 From: Dirk Rudolph Date: Mon, 9 Aug 2021 10:52:45 +0200 Subject: [PATCH] CIF-2251: adds sitemap configurations (#173) * add sitemap configurations * update dispatcher rules --- dispatcher-cloud/src/conf.d/rewrites/rewrite.rules | 2 +- dispatcher-cloud/src/conf.dispatcher.d/filters/filters.any | 7 +++++++ ...he.sling.sitemap.impl.SitemapScheduler~default.cfg.json | 4 ++++ .../main/content/jcr_root/content/venia/us/en/.content.xml | 3 ++- .../jcr_root/content/venia/us/en/my-account/.content.xml | 1 + .../venia/us/en/my-account/account-details/.content.xml | 1 + .../venia/us/en/my-account/address-book/.content.xml | 1 + .../venia/us/en/products/category-page/.content.xml | 3 ++- .../content/venia/us/en/products/product-page/.content.xml | 3 ++- .../content/venia/us/en/reset-password/.content.xml | 1 + .../jcr_root/content/venia/us/en/search/.content.xml | 4 +++- 11 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 ui.config/src/main/content/jcr_root/apps/venia/osgiconfig/config.publish/org.apache.sling.sitemap.impl.SitemapScheduler~default.cfg.json diff --git a/dispatcher-cloud/src/conf.d/rewrites/rewrite.rules b/dispatcher-cloud/src/conf.d/rewrites/rewrite.rules index 3d782320..ed99daca 100644 --- a/dispatcher-cloud/src/conf.d/rewrites/rewrite.rules +++ b/dispatcher-cloud/src/conf.d/rewrites/rewrite.rules @@ -21,5 +21,5 @@ RewriteCond %{REQUEST_URI} !^/saml_login RewriteCond %{REQUEST_URI} !^/system RewriteCond %{REQUEST_URI} !^/tmp RewriteCond %{REQUEST_URI} !^/var -RewriteCond %{REQUEST_URI} (.html|.jpe?g|.png|.svg)$ +RewriteCond %{REQUEST_URI} (.html|.jpe?g|.png|.svg|.xml)$ RewriteRule ^/(.*)$ /content/${CONTENT_FOLDER_NAME}/$1 [PT,L] diff --git a/dispatcher-cloud/src/conf.dispatcher.d/filters/filters.any b/dispatcher-cloud/src/conf.dispatcher.d/filters/filters.any index 03fbae38..e8f60439 100644 --- a/dispatcher-cloud/src/conf.dispatcher.d/filters/filters.any +++ b/dispatcher-cloud/src/conf.dispatcher.d/filters/filters.any @@ -14,3 +14,10 @@ $include "./default_filters.any" # /0200 { /type "allow" /method "GET" /path "/content/venia/*" /selectors '[0-9-]+' /extension "html" } /0201 { /type "allow" /method "GET" /path "/conf/venia/settings/wcm/templates/*" /extension "svg" } + +# +# Sling Sitemap filter +# +/0300 { /type "allow" /method "GET" /path "/content/venia/*" /selectors "sitemap-index" /extension "xml" } +/0301 { /type "allow" /method "GET" /path "/content/venia/*" /selectors "sitemap" /extension "xml" } +/0302 { /type "allow" /method "GET" /path "/content/venia/*" /selectors "sitemap\.[^\.\/]+-sitemap" /extension "xml" } diff --git a/ui.config/src/main/content/jcr_root/apps/venia/osgiconfig/config.publish/org.apache.sling.sitemap.impl.SitemapScheduler~default.cfg.json b/ui.config/src/main/content/jcr_root/apps/venia/osgiconfig/config.publish/org.apache.sling.sitemap.impl.SitemapScheduler~default.cfg.json new file mode 100644 index 00000000..0524ac83 --- /dev/null +++ b/ui.config/src/main/content/jcr_root/apps/venia/osgiconfig/config.publish/org.apache.sling.sitemap.impl.SitemapScheduler~default.cfg.json @@ -0,0 +1,4 @@ +{ + "scheduler.name": "default", + "scheduler.expression": "0 0 0 * * ?" +} diff --git a/ui.content/src/main/content/jcr_root/content/venia/us/en/.content.xml b/ui.content/src/main/content/jcr_root/content/venia/us/en/.content.xml index a6de58bf..e28c93f1 100644 --- a/ui.content/src/main/content/jcr_root/content/venia/us/en/.content.xml +++ b/ui.content/src/main/content/jcr_root/content/venia/us/en/.content.xml @@ -16,7 +16,8 @@ jcr:primaryType="cq:PageContent" jcr:title="Venia Demo Store - Home" navRoot="{Boolean}true" - sling:resourceType="venia/components/page" + sling:resourceType="venia/components/page" + sling:sitemapRoot="{Boolean}true" pageTitle="Home"> + sling:resourceType="venia/components/page" + sling:sitemapRoot="{Boolean}true"> + sling:resourceType="venia/components/page" + sling:sitemapRoot="{Boolean}true"> -