Tailwind Logo

Adding HTML pages

XM CloudNext.js

Published: 2022-12-21

What should you do if you already have website content and HTML data for a Next.js-based site? In fact, the basic functionality of Next.js makes it possible to host a whole set of HTML files and other files on the server.

Use of public folders

In the top directory of the Next.js project, there is a public folder where favicons and images are placed. In fact, HTML files can be placed here. This time, let's place existing HTML files here.

<!DOCTYPE html>
    <h1>My First Heading</h1>
    <p>My first paragraph.</p>

With this file in place, when you publish it, it can be recognized as a page as shown below.


What should I be aware of?

Now that we have introduced the basic features of Next.js, how should we take care of them when working with Sitecore? The main points to take care of are as follows

  • CMS content for pages that are frequently edited as pages
  • CMS content for important pages (pages that are not edited but are frequently referenced)
    • This is to allow for immediate improvements in the future.
    • Components can also be placed to make the page more valuable.
    • For example, header and footer changes can be updated together with valuable pages.
  • As for pages that have no impact, leave them in place.
    • Google Tag Manager or other necessary tags should be included to allow for integration with tag solutions.
    • Assuming analytics and other linkages

This mechanism is an easy-to-use form of site migration in progress. The old pages are temporarily placed on the site, the CMS is started, and the old pages are gradually converted to CMS in separate phases. For pages that will not be converted to a CMS in the end, the pages will be those that are not needed for the site in the first place, so you can use the procedure of migrating only the necessary pages instead of migrating all pages.


In this article, we have introduced a feature that is not specific to XM Cloud, but rather to Next.js. While this feature is useful, it is not recommended in the long run for large numbers of HTML pages to be placed on the same site as the CMS. It would be good to use it in the form of promoting CMS conversion, minimizing it as much as possible in the future (there is no need to reduce it to zero), or just putting elaborate one-off pages on it.