From fd81e03ccc8ea6e1704daebaaaceb2b6a101ac9a Mon Sep 17 00:00:00 2001 From: Dirk Rudolph Date: Wed, 9 Feb 2022 15:54:30 +0100 Subject: [PATCH 1/8] Use Sling Mappings for externalization --- ...esource.internal.JcrResourceResolverFactoryImpl.cfg.json | 4 +--- ...esource.internal.JcrResourceResolverFactoryImpl.cfg.json | 4 +--- ...esource.internal.JcrResourceResolverFactoryImpl.cfg.json | 4 +--- ui.content/pom.xml | 2 +- .../src/main/content/jcr_root/etc/map.publish/.content.xml | 3 +++ .../content/jcr_root/etc/map.publish/https/.content.xml | 3 +++ .../etc/map.publish/https/wknd-site-reverse/.content.xml | 6 ++++++ .../jcr_root/etc/map.publish/https/wknd-site/.content.xml | 6 ++++++ 8 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 ui.content/src/main/content/jcr_root/etc/map.publish/.content.xml create mode 100644 ui.content/src/main/content/jcr_root/etc/map.publish/https/.content.xml create mode 100644 ui.content/src/main/content/jcr_root/etc/map.publish/https/wknd-site-reverse/.content.xml create mode 100644 ui.content/src/main/content/jcr_root/etc/map.publish/https/wknd-site/.content.xml diff --git a/ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/config.publish.dev/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl.cfg.json b/ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/config.publish.dev/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl.cfg.json index 9d6e28cf40..338630c4cb 100644 --- a/ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/config.publish.dev/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl.cfg.json +++ b/ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/config.publish.dev/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl.cfg.json @@ -1,5 +1,3 @@ { - "resource.resolver.mapping": [ - "/content/wknd/ - /conf,/content,/content/experience-fragments,/content/dam,/content/cq:tags + /conf,/content,/content/experience-fragments,/content/dam,/content/cq:tags,/etc diff --git a/ui.content/src/main/content/jcr_root/etc/map.publish/.content.xml b/ui.content/src/main/content/jcr_root/etc/map.publish/.content.xml new file mode 100644 index 0000000000..a0e61cc66c --- /dev/null +++ b/ui.content/src/main/content/jcr_root/etc/map.publish/.content.xml @@ -0,0 +1,3 @@ + + \ No newline at end of file diff --git a/ui.content/src/main/content/jcr_root/etc/map.publish/https/.content.xml b/ui.content/src/main/content/jcr_root/etc/map.publish/https/.content.xml new file mode 100644 index 0000000000..a0e61cc66c --- /dev/null +++ b/ui.content/src/main/content/jcr_root/etc/map.publish/https/.content.xml @@ -0,0 +1,3 @@ + + \ No newline at end of file diff --git a/ui.content/src/main/content/jcr_root/etc/map.publish/https/wknd-site-reverse/.content.xml b/ui.content/src/main/content/jcr_root/etc/map.publish/https/wknd-site-reverse/.content.xml new file mode 100644 index 0000000000..327c090205 --- /dev/null +++ b/ui.content/src/main/content/jcr_root/etc/map.publish/https/wknd-site-reverse/.content.xml @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/ui.content/src/main/content/jcr_root/etc/map.publish/https/wknd-site/.content.xml b/ui.content/src/main/content/jcr_root/etc/map.publish/https/wknd-site/.content.xml new file mode 100644 index 0000000000..95e152dc0d --- /dev/null +++ b/ui.content/src/main/content/jcr_root/etc/map.publish/https/wknd-site/.content.xml @@ -0,0 +1,6 @@ + + \ No newline at end of file From b09e9bae4b93a8bddac983057557e49b5579a08f Mon Sep 17 00:00:00 2001 From: Dirk Rudolph Date: Wed, 9 Feb 2022 15:56:45 +0100 Subject: [PATCH 2/8] Enable daily Sitemap generation --- ...pache.sling.sitemap.impl.SitemapScheduler~default.cfg.json | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/config.publish/org.apache.sling.sitemap.impl.SitemapScheduler~default.cfg.json diff --git a/ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/config.publish/org.apache.sling.sitemap.impl.SitemapScheduler~default.cfg.json b/ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/config.publish/org.apache.sling.sitemap.impl.SitemapScheduler~default.cfg.json new file mode 100644 index 0000000000..3dcbee2df6 --- /dev/null +++ b/ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/config.publish/org.apache.sling.sitemap.impl.SitemapScheduler~default.cfg.json @@ -0,0 +1,4 @@ +{ + "scheduler.name": "default", + "scheduler.expression": "0 0 0 * * ?" +} \ No newline at end of file From 8f862d04811e4c0d559e98883eb1f2e57d4c5d5e Mon Sep 17 00:00:00 2001 From: Dirk Rudolph Date: Wed, 9 Feb 2022 16:06:38 +0100 Subject: [PATCH 3/8] Make ca/en us/en a sling:sitemapRoot --- .../src/main/content/jcr_root/content/wknd/ca/en/.content.xml | 1 + .../src/main/content/jcr_root/content/wknd/us/en/.content.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/.content.xml b/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/.content.xml index dd02566d91..1c666abf01 100644 --- a/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/.content.xml +++ b/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/.content.xml @@ -14,6 +14,7 @@ jcr:primaryType="cq:PageContent" jcr:title="WKND Adventures and Travel" sling:resourceType="wknd/components/page" + sling:sitemapRoot="{Boolean}true" pageTitle="Home"> Date: Wed, 9 Feb 2022 19:05:25 +0100 Subject: [PATCH 4/8] Add /etc/map.publish paths to filter.xml --- ui.content/src/main/content/META-INF/vault/filter.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui.content/src/main/content/META-INF/vault/filter.xml b/ui.content/src/main/content/META-INF/vault/filter.xml index fb9e302559..b5d3c69b50 100644 --- a/ui.content/src/main/content/META-INF/vault/filter.xml +++ b/ui.content/src/main/content/META-INF/vault/filter.xml @@ -1,5 +1,7 @@ + + From 553a56423aa4b2fb9ec6d5aa5607845a97b29de5 Mon Sep 17 00:00:00 2001 From: Dirk Rudolph Date: Wed, 9 Feb 2022 20:47:13 +0100 Subject: [PATCH 5/8] Rewrite short .xml urls to full content paths --- dispatcher/src/conf.d/rewrites/rewrite.rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dispatcher/src/conf.d/rewrites/rewrite.rules b/dispatcher/src/conf.d/rewrites/rewrite.rules index f9af561706..b784074f03 100644 --- a/dispatcher/src/conf.d/rewrites/rewrite.rules +++ b/dispatcher/src/conf.d/rewrites/rewrite.rules @@ -28,5 +28,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] From 0ab71cef4cc9e5f1c9044fb5978ac019372715d0 Mon Sep 17 00:00:00 2001 From: Dirk Rudolph Date: Thu, 10 Feb 2022 09:25:22 +0100 Subject: [PATCH 6/8] Exclude error pages from sitemap --- .../content/jcr_root/content/wknd/ca/en/errors/.content.xml | 2 +- .../content/jcr_root/content/wknd/ca/en/errors/404/.content.xml | 1 + .../content/jcr_root/content/wknd/ca/en/errors/500/.content.xml | 1 + .../jcr_root/content/wknd/ca/en/errors/sign-in/.content.xml | 1 + .../content/wknd/language-masters/en/errors/404/.content.xml | 1 + .../content/wknd/language-masters/en/errors/500/.content.xml | 1 + .../wknd/language-masters/en/errors/sign-in/.content.xml | 1 + .../content/jcr_root/content/wknd/us/en/errors/.content.xml | 2 +- .../content/jcr_root/content/wknd/us/en/errors/404/.content.xml | 1 + .../content/jcr_root/content/wknd/us/en/errors/500/.content.xml | 1 + .../jcr_root/content/wknd/us/en/errors/sign-in/.content.xml | 1 + 11 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/errors/.content.xml b/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/errors/.content.xml index cd2a1f789b..3d3c9d084a 100644 --- a/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/errors/.content.xml +++ b/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/errors/.content.xml @@ -6,7 +6,7 @@ cq:lastModifiedBy="admin" cq:lastRolledout="{Date}2020-11-13T14:10:14.819-08:00" cq:lastRolledoutBy="admin" - cq:redirectTarget="/content/wknd/language-masters/en" + cq:redirectTarget="/content/wknd/ca/en" cq:template="/conf/wknd/settings/wcm/templates/content-page-template" jcr:mixinTypes="[cq:LiveRelationship]" jcr:primaryType="cq:PageContent" diff --git a/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/errors/404/.content.xml b/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/errors/404/.content.xml index a0d4dff205..e461570c1a 100644 --- a/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/errors/404/.content.xml +++ b/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/errors/404/.content.xml @@ -6,6 +6,7 @@ cq:lastModifiedBy="admin" cq:lastRolledout="{Date}2020-11-13T14:10:14.827-08:00" cq:lastRolledoutBy="admin" + cq:robotsTags="[noindex]" cq:template="/conf/wknd/settings/wcm/templates/content-page-template" jcr:mixinTypes="[cq:LiveRelationship]" jcr:primaryType="cq:PageContent" diff --git a/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/errors/500/.content.xml b/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/errors/500/.content.xml index 5a6ca86599..adef74f2c7 100644 --- a/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/errors/500/.content.xml +++ b/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/errors/500/.content.xml @@ -6,6 +6,7 @@ cq:lastModifiedBy="admin" cq:lastRolledout="{Date}2020-11-13T14:10:14.828-08:00" cq:lastRolledoutBy="admin" + cq:robotsTags="[noindex]" cq:template="/conf/wknd/settings/wcm/templates/content-page-template" jcr:isCheckedOut="{Boolean}true" jcr:mixinTypes="[cq:LiveRelationship,mix:versionable]" diff --git a/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/errors/sign-in/.content.xml b/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/errors/sign-in/.content.xml index 44d369dc99..9c519991ab 100644 --- a/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/errors/sign-in/.content.xml +++ b/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/errors/sign-in/.content.xml @@ -6,6 +6,7 @@ cq:lastModifiedBy="admin" cq:lastRolledout="{Date}2020-11-13T14:10:14.828-08:00" cq:lastRolledoutBy="admin" + cq:robotsTags="[noindex]" cq:template="/conf/wknd/settings/wcm/templates/content-page-template" jcr:mixinTypes="[cq:LiveRelationship]" jcr:primaryType="cq:PageContent" diff --git a/ui.content.sample/src/main/content/jcr_root/content/wknd/language-masters/en/errors/404/.content.xml b/ui.content.sample/src/main/content/jcr_root/content/wknd/language-masters/en/errors/404/.content.xml index f67301de80..5b9fdca475 100644 --- a/ui.content.sample/src/main/content/jcr_root/content/wknd/language-masters/en/errors/404/.content.xml +++ b/ui.content.sample/src/main/content/jcr_root/content/wknd/language-masters/en/errors/404/.content.xml @@ -4,6 +4,7 @@ Date: Thu, 10 Feb 2022 09:28:37 +0100 Subject: [PATCH 7/8] Properly cancel inheritance of sling:sitemapRoot property --- .../src/main/content/jcr_root/content/wknd/ca/en/.content.xml | 1 + .../src/main/content/jcr_root/content/wknd/us/en/.content.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/.content.xml b/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/.content.xml index 1c666abf01..31c6fdf8f7 100644 --- a/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/.content.xml +++ b/ui.content.sample/src/main/content/jcr_root/content/wknd/ca/en/.content.xml @@ -7,6 +7,7 @@ cq:lastModifiedBy="admin" cq:lastRolledout="{Date}2020-09-30T17:38:20.875-07:00" cq:lastRolledoutBy="admin" + cq:propertyInheritanceCancelled="[sling:sitemapRoot]" cq:tags="[wknd:customer-journey/attract]" cq:template="/conf/wknd/settings/wcm/templates/landing-page-template" jcr:description="WKND is a collective of outdoors, music, crafts, adventure sports, and travel enthusiasts that want to share our experiences, connections, and expertise with the world." diff --git a/ui.content.sample/src/main/content/jcr_root/content/wknd/us/en/.content.xml b/ui.content.sample/src/main/content/jcr_root/content/wknd/us/en/.content.xml index a722f2489a..fbc452f632 100644 --- a/ui.content.sample/src/main/content/jcr_root/content/wknd/us/en/.content.xml +++ b/ui.content.sample/src/main/content/jcr_root/content/wknd/us/en/.content.xml @@ -7,6 +7,7 @@ cq:lastModifiedBy="admin" cq:lastRolledout="{Date}2020-09-30T17:38:21.080-07:00" cq:lastRolledoutBy="admin" + cq:propertyInheritanceCancelled="[sling:sitemapRoot]" cq:tags="[wknd:customer-journey/attract]" cq:template="/conf/wknd/settings/wcm/templates/landing-page-template" jcr:description="WKND is a collective of outdoors, music, crafts, adventure sports, and travel enthusiasts that want to share our experiences, connections, and expertise with the world." From 5a540945e5896330ff0633eee786a8f38a94d82b Mon Sep 17 00:00:00 2001 From: Dirk Rudolph Date: Fri, 11 Feb 2022 11:48:36 +0100 Subject: [PATCH 8/8] Prevent double // when resolving paths --- .../jcr_root/etc/map.publish/https/wknd-site/.content.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui.content/src/main/content/jcr_root/etc/map.publish/https/wknd-site/.content.xml b/ui.content/src/main/content/jcr_root/etc/map.publish/https/wknd-site/.content.xml index 95e152dc0d..d623fed84f 100644 --- a/ui.content/src/main/content/jcr_root/etc/map.publish/https/wknd-site/.content.xml +++ b/ui.content/src/main/content/jcr_root/etc/map.publish/https/wknd-site/.content.xml @@ -2,5 +2,5 @@ \ No newline at end of file + sling:internalRedirect="[/,/content/wknd/]" + sling:match="$[env:AEM_DOMAIN_WKND_SITE].\\d+/"/> \ No newline at end of file