Step 9: Rebuild Your Site
This step walks through how to rebuild a Search frontend built using the theme. The reason you would want to do this is if you have a live site already published and want to retain the domain (and thus Yext Pages site) currently in use.
The main use case for rebuilding your site is when you are upgrading the theme version from a legacy version for two reasons:
- As you learned in this guide, the process of upgrading your theme to the latest version includes checking each intermediate version for upgrade implications you may have to incorporate into your repo (see Hitchhikers Theme Changelog reference doc), including potential breaking changes. Thus, when jumping many versions at once, you’ll have a longer upgrade process.
- On top of that, legacy theme versions use a different file structure, so upgrading is more involved and manual.
For these reasons, we recommend rebuilding the experience instead of trying to upgrade the Theme version manually. You may also decide to rebuild your site even when you’re not starting on a legacy theme version if you have many updates to make, for example if your current theme version is very old or if you decided on a different vision for the site.
Steps to Rebuild a Site
Here are the steps to rebuild a site. You’ll notice that the sequence of these steps mirror those for a theme upgrade. Review those steps for more guidance.
- Navigate to Pages > [[site to rebuild]].
- Click View Code Editor.
- Hover over the master branch, click the three dots, and click Create new branch.
- Enter a descriptive branch name, such as
rebuild-theme-1.33
(replace 1.33 with the latest Theme version). - Select to use the Search Jambo Template.
- This will create a fresh branch using the latest theme template - you’re essentially starting with a new repo. (Typically, when you create a new branch, you do it off of master or another existing branch, which makes a copy of that branch. Here you’re making a copy of the Theme template.)
- Then click Create Branch.
- You’ll have to re-add each page and card of the Search experience and add any styling or customizations. Check out the Build a Search Experience End-to-End guide for additional resources. However, this saves you the trouble of going through updates for every theme version, which may be complicated.
- QA the experience thoroughly using Live Preview and the staging site.
- Once everything looks good, merge the branch onto master.
- Navigate to Pages > [[site to rebuild]].
- Click View Code Editor.
- Hover over the branch you have been working on, click the three dots, and click Merge branch.
- Select to merge into master.
- Then click Merge Branch.
- Push the update to the live site.
The Search experience will still live in the same Pages site and domain, so there are no changes needed for the integration or from your client. You may want to let your client know the site will have some cool new features and an updated modern UI (from Theme 1.19 ). Of course, if there are any new features you want to remove, you can follow the instructions from that Theme version.