Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#292 Configure Sling Mappings and Sitemap Generation #317

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

buuhuu
Copy link

@buuhuu buuhuu commented Feb 9, 2022

Description

This PR contributes the configuration of a Sling Mapping using a AEM_DOMAIN_WKND_SITE environment variable. It is activated only for the publish.dev, publish.stage and publish.prod runmode by the configuration of the Resource Resolver Factory pointing to the mappings directory /etc/map.publish.

Additionally a SitemapGenerator configuration was added to run Sitemap generation once a day at midnight. Both homepages us/en and ca/en were marked as sitemap roots. The error pages are configured with a noindex tag to exclude them from the sitemap.

Related Issue

#292

Motivation and Context

Achieve a 100% SEO score with WKND.

How Has This Been Tested?

Locally,
AEMaaCS

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@godanny86
Copy link
Contributor

@buuhuu what is the motivation to use Sling Maps over Resource Resolver for shortening the /content/wknd?

@buuhuu buuhuu marked this pull request as ready for review February 9, 2022 19:48
@buuhuu buuhuu changed the title Configure Sling Mappings and Sitemap Generation #292 Configure Sling Mappings and Sitemap Generation Feb 9, 2022
jcr:primaryType="sling:Folder"
jcr:mixinTypes="[sling:MappingSpec]"
sling:internalRedirect="[/,/content/wknd]"
sling:match="$[env:AEM_DOMAIN_WKND_SITE].\\d+"/>
Copy link
Contributor

@godanny86 godanny86 Feb 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@buuhuu if someone wanted to mimic this for an on-prem (6.5) deployment they would need to use some other mechanism, because env:AEM_DOMAIN_WKND_SITE is an environment variable set via Cloud Manager and would only be available using AEM as a Cloud Service...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I think WKND should be cloud first and backwards compatible whenever possible, but just wanted to know

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using environment variables works as well for AEM on-prem and AMS. However, afaik it is currently only possible with CM and AEMaaCS to set the environment variables in a self-service way.

More details can be found here in the Apache Sling Mappings for Resource Resolution documentation. It would also be possible to refer to config in combination with an OSGI configuration in on-prem setups instead of using env.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants