Move your site into src/custom/site
Older versions of Arc CMS had no website folder of the app's own, so a site changed its home page, header, footer, templates and styles by editing files in public/. Those are Arc CMS's files now. npm run arc:own-site moves your changes into src/custom/site/ and puts Arc CMS's files back, so later updates merge cleanly.
Is this you?
Yes, if your copy has edits in any of these. npm run check:core lists them, and points here.
| You edited or added | It moves to |
|---|---|
public/index.html | src/custom/site/home.html, as a whole HTML page |
public/i18n/{lang}/index.html | src/custom/site/home.{lang}.html |
public/i18n/{lang}/strings.json | src/custom/site/strings/{lang}.json, only the keys you added or reworded |
public/_partials/_header.html, _footer.html | src/custom/site/header.html, footer.html |
public/templates/{folder}/…, public/pages/… | The same path under src/custom/site/ |
public/assets/css/main.css | src/custom/site/site.css, loaded after Arc CMS's own |
public/favicon.ico, 403.html, 404.html | The same name under src/custom/site/ |
Any file you added, such as public/assets/images/logo.png | src/custom/site/assets/images/logo.png, served at /site/images/logo.png. Links to it in the moved files are updated. |
Files you never changed stay Arc CMS's, so you keep getting its improvements to them.
Move it
Merge the newer Arc CMS, as on Upgrade Arc CMS. Leave conflicts in
public/open: the command settles them.git merge upstream/mainSee the plan. Nothing changes yet:
npm run arc:own-siteIt lists each file and where it goes, how many of Arc CMS's files it puts back, and what to check by hand.
Do it:
npm run arc:own-site -- --writeA file that already exists in
src/custom/site/is never overwritten; the command names it instead.Look at the site with
npm run devnext to the live one, and fix what the plan listed under "Check by hand".Check and commit:
npm run check:coreNo file in
public/should be listed now. Finish the merge commit.Deploy everything, so the published pages are built from the new files. Run the guided deploy and choose Everything:
npm run deployAfter the website deploy it publishes every page again by itself. If you deploy the website with options instead (
npm run deploy -- --only hosting), it keeps the published pages but does not publish them again: runnpm run seed:devafterwards for thedefaultproject, ornpm run seed:prod, which always publishes to theproductionproject.
Your home page
The old home page was an Angular template. The command turns it into a plain HTML page (see Build your home page):
[contentType]="'articles'"becomescontent-type="articles", and the same for other fixed values;ngSrcbecomessrc, andassets/…becomes/assets/…, so images also load at/hi/;- it gets a
<head>with the title and description it had: fromindex.html, or for another language from its old home component; - if you never edited
main.css, the oldmain.cssit was styled with comes along assrc/custom/site/assets/home.css, linked from the page. If you did edit it, your wholemain.cssbecomessrc/custom/site/site.cssinstead, which every page loads, and there is nohome.css. Arc CMS's ownmain.cssnow styles only the body, header and footer.
Angular syntax with no plain HTML version, such as {{ … }}, (click) or @if, is left in place and listed with its line number. Replace it with plain HTML, a data-arc-t text or your own script.
What it leaves to you
- An edit to an Arc CMS file the site folder cannot replace, such as
public/assets/js/arc-search.js: the command puts Arc CMS's file back and names it. Your version is still in git history. If you need the change, ask for it in Arc CMS as an option (see Keep core untouched). - Old home components for other languages in
src/app/pages/home-i18n/: delete them and their routes insrc/app/app.routes.ts. A home page in another language is now justhome.{lang}.html. - Template overrides saved in the database by very old versions are no longer read. The templates in use are the files: Content, Templates shows them.
Run it from the newer Arc CMS, after the merge. Before the merge the command is not there yet; if you run an older checkout, it stops and asks you to merge first.
Next
Keep editing the site in its new place: Build your home page and Design templates.