Change Site Root
The AEM Boilerplate project assumes that the document root is situated at the project's root. However, if your project begins on a subpage of another site, it is necessary to adjust the site root to align with the path.
Modifying the site root involves relocating various files and folders in both the document storage and code repository, along with making code updates where paths are referenced. The new folder should have identical names in both the document storage and GitHub and it should also correspond to the name in the path where the site will be located.
That means if the site location will be at https://yourdomain.com/topics
then the recommended folder name would be topics
.
SharePoint/GDrive Changes
To update your document storage, follow these steps:
- Create the new root folder in document storage
- Move all items into the new folder, excluding the following:
.helix
folderredirects.xslx
block-library
folder (if it exists)
- Publish the relocated files in their new location
IMPORTANT: In case any files in the previous location have been previewed or published, it is advisable to delete the published content. These outdated files can be seen as duplicate content, will probably not get updates from authors and confuse visitors who stumble upon them.
Code Changes
To update your project code, follow these steps:
- Create the new root folder in your code, using the identical folder name used in document storage
- Move the following folders into the new folder:
blocks
fonts
icons
scripts
styles
- Update the paths to styles and scripts in the following files:
head.html
404.html
- In
package.json
, update thelint:css
path for both blocks and styles - In
font.css
, update font paths- Since the fonts folder was moved, these paths may need to be updated
Other things to look for
Depending on your stage of development, you might have to identify additional instances where paths are referenced.
- Look for
fetchPlaceholders()
calls. Pass your folder name as an argument- e.g.
fetchPlaceholders('/your-folder-name')
- e.g.
- Look for
loadCSS()
orloadBlock()
calls- In some cases the
codeBasePath
may not have been used
- In some cases the
- Look for HTML snippets that are included in blocks
- You can incorporate HTML snippets into your custom code. If the snippet contains relative paths, it may be necessary to update them
- Look for any custom Git workflows
- In a workflow, file relocations may occur, necessitating the correction of paths as needed