Skip to content

Instantly share code, notes, and snippets.

@gabrielwalt
Last active February 22, 2024 11:11
Show Gist options
  • Save gabrielwalt/63108b7e0dfb7891993d8c7e56d1ff9d to your computer and use it in GitHub Desktop.
Save gabrielwalt/63108b7e0dfb7891993d8c7e56d1ff9d to your computer and use it in GitHub Desktop.
Frontend module configuration below /conf/SITENAME/sling:configs.json
{
"jcr:primaryType": "nt:unstructured",
"com.adobe.aem.wcm.site.manager.config.SiteConfig": {
"jcr:primaryType": "nt:unstructured",
"themePackageName": "SITENAME-theme"
},
"com.adobe.cq.wcm.core.components.config.HtmlPageItemsConfig": {
"jcr:primaryType": "nt:unstructured",
"prefixPath": "/content/SITENAME.theme/_default",
"css": {
"jcr:primaryType": "nt:unstructured",
"element": "link",
"location": "header",
"attributes": {
"jcr:primaryType": "nt:unstructured",
"rel": "stylesheet",
"href": "/css/theme.css",
"type": "text/css"
}
},
"javascript": {
"jcr:primaryType": "nt:unstructured",
"element": "script",
"location": "header",
"attributes": {
"jcr:primaryType": "nt:unstructured",
"async": "true",
"src": "/js/theme.js",
"type": "text/javascript"
}
},
"favicon": {
"jcr:primaryType": "nt:unstructured",
"element": "link",
"location": "header",
"attributes": {
"jcr:primaryType": "nt:unstructured",
"rel": "icon",
"href": "/resources/images/favicon.png",
"type": "image/png"
}
}
}
}
@gabrielwalt
Copy link
Author

gabrielwalt commented Nov 18, 2021

  • Every theme deployed by the front end pipeline has a name defined in its package.json file.
  • When a theme update got successfully deployed, AEM knows which site uses the deployed theme thanks to the themePackageName of the SiteConfig node.
  • Then, to update the site using the newly deployed theme, AEM updates the prefixPath of the HtmlPageItemsConfig node with the uniquely timestamped path where the updated theme was deployed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment