Upgrading
A new version brings fixes and features, but by then you have changed the theme: your settings, content, words and maybe components. The safest way to upgrade is to let git combine the two.
Recommended: a theme branch
Section titled “Recommended: a theme branch”Set this up once, ideally before you start customising.
-
Commit the untouched theme on its own branch:
Terminal window git checkout -b theme# copy in the theme files exactly as downloaded, thengit add -A && git commit -m "SwiftAgency 1.2.0"git checkout -b main -
Build your site on
mainas usual. -
When a new version comes out, update the
themebranch with the new files and commit:Terminal window git checkout theme# replace the files with the new version (keep the .git folder)git add -A && git commit -m "SwiftAgency 1.3.0" -
Merge it into your site and resolve the conflicts:
Terminal window git checkout maingit merge themeConflicts only appear where both you and the theme changed the same lines. Everything else merges by itself.
-
Follow the version’s upgrade steps in the changelog, run
npm installandnpm run verify, and check the site in the browser.
Without git history
Section titled “Without git history”Compare the new version with yours file by file, starting with the files listed under “Changed” in the changelog. A diff tool such as git diff --no-index old-theme/ new-theme/ shows exactly what the theme changed, which you can then apply to your copy.
What usually conflicts
Section titled “What usually conflicts”| File | Why | Tip |
|---|---|---|
src/config/site.ts |
You set your details, the theme added a setting | Keep your values, add the new keys |
src/i18n/ui/*.ts |
You changed words, the theme added keys | Keep your words; npm run check lists new keys you still need |
src/content/** |
You replaced the demo content | Keep yours. Demo content changes can be ignored |
package-lock.json |
Dependencies changed on both sides | Take the theme’s version, then run npm install |
Version history
Section titled “Version history”Each release in the changelog lists what was added and changed, and ends with Upgrading from… steps when a release needs you to do something. Upgrade one version at a time if you are several behind.