Code websites
Convert a Smileline website to code that Smileline still builds, checks and hosts, change it with AI, and open a draft link for every build before you publish.
A code website is a Smileline website that runs on its own code: an Astro project, the same one Download makes. Smileline keeps that code for you, builds every change into a draft you can open, checks it, and puts it live when you click Publish. Your forms, practice details, articles, patient stories, call tracking and ads stay connected. To change the code in Claude Code or another tool, or through Claude and ChatGPT, see Edit a code website with Claude Code or another tool.
Code websites are for practices in the United Kingdom and the United States, like every Smileline website. If Convert to code isn't in a website's menu, code websites aren't switched on for your practice yet.
Who can do what
| To do this | You need |
|---|---|
| See the Code tab, its builds and patient stories | View ads, captured leads & results |
| Convert a website, retry a conversion, make a draft link, rebuild or retry a build | Connect providers, manage lead forms & draft campaigns |
| Publish or restore a build | Set campaigns live & change ad spend |
| Stop converting, remove a patient story | Connect providers, manage lead forms & draft campaigns |
| Ask the AI to change the code, approve its changes, retry, continue, stop or discard a request | Connect providers, manage lead forms & draft campaigns and Use AI assist |
Converting, stopping, retrying a conversion or a change to the code, making a draft link and asking the AI to change the code are done by a person signed in to Smileline: Claude, ChatGPT and other AI agents, API keys and the AI assistant can't do them. They can't read the Patient stories list or the AI's requests either.
Convert a website to code
Open the website in Ads → Websites, open its ⋯ menu and choose Convert to code. A website must be live and online to convert, and can't convert while an A/B test runs on it, an update is going live or an import is running. Landing-pages sites can be converted too.
Read what changes, then click Convert to code.
The website opens on its Code tab, which says Converting… while Smileline saves the website as code. It takes a few minutes: you can leave the page.
Converting is one-way. Once it has finished, the website's pages are changed in its code, not in the page editor. Its versions from before stay in Versions, marked Read-only. From the moment it starts converting, the website's pages, design and share previews can be opened but not changed.
What converting does:
- Visitors keep seeing the website as it is until you publish the code version for the first time. Meanwhile its opening hours and articles keep updating as before.
- It turns on Share practice details with website code (Settings → Website → Tracking), as a download does, so the code can show your opening hours, phone numbers and reviews. Only someone who can change website tracking can turn it on: if it's off and you can't, ask an owner or a manager, then convert again. See Practice details for website code.
- Forms keep their addresses and keep sending enquiries to Smileline.
- Testimonials and before-and-after pictures stay with Smileline and are never put in the code (see Patient stories).
While it's converting, Stop converting puts the website back exactly as it was, to be edited in the page editor again; the code saved so far is deleted. If something stops the conversion, the Code tab shows Couldn't finish converting with the reason: Retry starts it again (from a fresh copy of the website if the first one is more than a day old), or Stop converting. If you convert again straight after stopping, you're asked to wait a few minutes while the last conversion is removed.
Once converted, the website opens on its Code tab.
Builds
Every change to the code is built into a draft: a fresh, private build with no internet access, which is thrown away when it's done. The first one is the conversion itself. The Code tab lists the builds, newest first, each with what changed, who made it, when, and where it is:
| Status | What it means |
|---|---|
| Waiting | Waiting for its turn to build. Builds are never dropped for waiting. |
| Building | Being built. |
| Checking | Built; Smileline is reading every page for the website check. |
| Ready | Ready to open with a draft link and to publish. |
| Failed | The code didn't build, with the reason. Rebuild builds it again. |
| Stopped | Smileline couldn't finish it, with the reason. Retry starts it again. |
| Replaced | An automatic build a newer change replaced. |
| Expired | More than 3 days old and no longer needed, so its files were cleaned up. Rebuild makes it again. |
The build visitors see is marked Live. A build you've just published shows Going live… until it is; if it stops on the way, it shows Stopped with the reason, and Retry is in Versions. A ready build shows how many website warnings its check found.
Smileline also builds by itself when something the website shows changes. These builds are labelled:
- New practice details: your opening hours, addresses, phone numbers or other practice details changed.
- Articles updated: a blog article was published, changed or taken down.
- Patient story removed: someone removed a patient story.
Changes pushed from outside Smileline
When someone changes the code with Claude Code or another git tool through a clone link, every push to the main branch becomes a new build within seconds, labelled Pushed with the name the commit was made under (for example Pushed · Giulio). Nothing goes live until someone publishes it, and Smileline's automatic builds for new practice details and articles keep building the version that's live, never a pushed one.
- Only
mainis built. Pushing other branches or tags is fine, and nothing is built from them until they're merged intomain. - If several pushes arrive close together, only the newest version is built; the others show Replaced.
- If the AI or a connected AI tool was saving a change at the same moment, nobody's work is lost: Smileline checks whether that change made it into what was pushed. If it didn't, the AI's request saves it again on top of the new version (if both changed the same file, the request names it, with Retry). A connected AI tool is told the code changed and reads it again; a change of its that was still waiting to be saved stays in the review queue.
- If
mainis deleted, the Code tab says The code changed outside Smileline with "The main branch was deleted outside Smileline - push it again". Pushmainagain and the website carries on from there. - If Smileline couldn't read a pushed version, the Code tab says so with Retry.
Smileline also checks each website that has a write link once an hour, so a push is picked up even if its notice was lost.
Draft links
Draft link on a Ready build makes a private link to it: copy it straight away, it's shown only this once. Anyone with the link can see that build for 3 days, as visitors would see it once published. Drafts are hidden from search engines, carry no tracking, and their forms don't send enquiries. A draft link stops working if a patient story is removed after its build was made.
Publish and the tick
Publish on a Ready build puts exactly that build live. The dialog names the version that's live now, which publishing replaces (it stays in Versions).
Before it goes live, every page of the build was read by the website check, the same check as for any Smileline website: every visible word, header and footer included. It also flags things in the code itself:
- a form the code doesn't declare in
smileline.forms.json, a form field it doesn't map, a treatment or location the practice doesn't have, or a file upload field (see Forms in the code); - a page a campaign sends people to that the build no longer has;
- an article whose page didn't build;
- a page whose text was too long to check all of it;
- a
_headersfile, which isn't used: Smileline sets the website's headers.
The warnings are grouped by page. None of them stops you: tick I've checked these to publish. A build the check found nothing in publishes straight away.
If the build changes a file that AI tools follow or that a computer runs, compared with the live version (for example AGENTS.md, CLAUDE.md, package.json, .envrc or astro.config.mjs), the dialog lists those files and asks you to tick I've checked the changes to these files too. Changes pushed from outside Smileline, and changes an AI agent makes through Smileline, can touch them, so check what changed before you publish. An AI agent's Smileline prompt to publish lists the same files, and accepting it is that tick.
When Claude, ChatGPT or another AI agent publishes, Smileline asks you first in a prompt that shows the same warnings and files, and accepting it is the tick. API keys and the AI assistant can't tick for you: when a build has warnings or changed files like these, they're asked to publish it in Smileline.
Sometimes a build has to be built again before it can go live. The dialog says why and offers Rebuild, which builds the same code with everything as it is now:
- the build is more than 3 days old;
- the website rules changed since it was checked;
- your articles changed since it was made;
- a patient story was removed since it was made;
- Share practice details with website code was turned off since it was made.
If a website update is still finishing, publish again in a minute. If another version went live since you opened the dialog, check it, then publish again.
Restore an older build
Restore on a ready build older than the live one publishes it again, with the same dialog and the same tick. A build older than 3 days, or one made before an article changed or a patient story was removed, needs Rebuild first.
Changing your website with AI
Change with AI, on a code website's Code tab above Builds, changes the code for you. Say what to change in your own words, for example "add a short quiz above the contact form": the AI reads the website's code, changes the files it needs and saves the result as one new version, which builds into a draft like any other change. Nothing goes live until someone publishes it.
Type what to change, or start from one of the suggestions, and click Ask the AI.
While it works, the request shows each step it takes, such as "Reading src/pages/index.astro" or "Editing src/pages/index.astro", and updates by itself. Stop lets the step in progress finish, then stops. It also works while the change waits to be saved; once saving has begun, the change is saved.
When it's done, the request says in the AI's words what it changed, lists the files it added (+), changed (~) or deleted (−), and follows the new version's build. Once the build is Ready, open its Draft link to check it, then Publish it with the tick as usual. If you Rebuild it, the request follows the new build. If the newest build fails, Ask the AI to fix it fills in a request about its error: check it and click Ask the AI to send it.
The build is also listed in Builds as Changed with AI, titled by the first line of your request. Requests for one website run one at a time, in the order they were asked: one asked while another works shows Waiting. Each request starts from the newest version of the code, and the AI is shown your last few requests and the latest build's errors or warnings, so a follow-up can simply be a new request.
The AI never sees your patient stories, and never reads, searches or writes files named like password and key files: .env and .env. files (except .env.example), .dev.vars files, .npmrc, .netrc, .git-credentials, files ending .pem, .key, .p12 or .pfx, and files starting id_rsa or id_ed25519. It can read a password or key typed into any other file, so keep them only in files like those. It can't build, publish or go on the internet. It can make mistakes: always open the draft before you publish.
Like code websites, changing them with AI is for practices in the United Kingdom and the United States. Asking needs Connect providers, manage lead forms & draft campaigns and Use AI assist (see Who can do what). Where code websites are switched off, nobody can ask, but a request already made can still be stopped or discarded.
Approving changes to AI instruction files
Some files tell AI tools how to work on the project, or make a developer's computer run something when the project is installed or opened:
AGENTS.md,CLAUDE.md,CLAUDE.local.md,GEMINI.md,.mcp.json,.cursorrulesand.github/copilot-instructions.md, and anything in a.claude,.cursoror.agentsfolder;package.json, its lock files (package-lock.json,npm-shrinkwrap.json,yarn.lock,pnpm-lock.yaml,bun.lock),bunfig.toml,.gitmodulesand.gitattributes, and anything in a.vscode,.devcontaineror.huskyfolder.
When the AI wants to change one of them, nothing is saved yet: the request shows Needs approval with each of those files' whole new text, which only people who can change the website with AI see. Read it, then choose:
- Approve and save saves the whole change exactly as shown.
- Save without these files saves the rest of the change and leaves those files as they are.
- Discard throws the whole change away.
A file too long to show in full can't be approved here: save without it, or discard the change. Nor can a file holding characters a page can't show, such as zero-width spaces or right-to-left marks, which can hide instructions from you that AI tools still read: each one is written as its code (for example U+200B), with a warning. If the files change before you approve, you're asked to check them again.
Retry and Continue
A request that can't finish pauses. It says why and lists the files it has changed so far. Retry or Continue starts a new request that keeps those files; Discard throws them away. The AI never starts again by itself.
| It says | What to do |
|---|---|
| Paused after 30 steps | Continue lets the AI carry on. |
| The AI has read as much as one request can hold | Continue carries on afresh. |
| The AI's answer couldn't be used (it was cut off, too large for one step or couldn't be read), or the AI couldn't be reached | Retry asks again with the same words. |
| The AI service turned the request down | Retry; if it happens again, contact Smileline support. |
| The AI declined the request | Retry, or ask in other words. |
| Files changed while the AI worked | Retry redoes those files on the newest version. |
| Stopped, ran for more than a day, stopped making progress, or Smileline updated the AI | Continue carries on. |
| The practice's subscription had lapsed, or the person who asked could no longer change the website with AI | Someone who can change the website with AI clicks Continue. |
If someone changes the same files while the AI works, nobody's work is overwritten. Nothing is saved, the request names the files that clashed, and Retry redoes only those on the newest version, keeping the AI's other changes.
If saving the new version doesn't finish, the Code tab says a change to the code couldn't be saved, with Retry.
What it costs
Changing your website with AI is billed by use on pay-as-you-go, as AI calls: each step the AI takes is one, so a bigger change takes more steps and costs more. One request never costs more than £88.56 ($98.40 in the US, plus tax), because the AI pauses after 30 steps; Continue then starts a new request, billed the same way. A step that gets no answer isn't billed, and Stop lets the step in progress finish, which is billed. On the older price list it isn't billed.
Practice details, articles and reviews
You don't rebuild for these: Smileline does.
- Practice details. When your opening hours, addresses, phone numbers or other details change, Smileline builds the live code again with them. If the check reads every page in full and finds nothing that wasn't already on the live website, it publishes by itself. Otherwise it waits as a ready build and the Code tab says that new practice details are ready to check and publish. This needs Share practice details with website code: while it's off, the website keeps the details it had when it was converted.
- Articles. When you publish, change or take down a blog article, the live code is built again with it and published straight away, with no tick. If your practice details changed at the same time, the article goes first. If that brings website warnings nobody has ticked, the Code tab says the live website was updated by itself and has warnings: open them from its build.
- Reviews. Your Google reviews show where the code's Reviews sections ask for them, by the rating and number each section sets, and only while Share practice details with website code is on.
Patient stories
Testimonials and before-and-after pictures are never put in the code, so nobody who reads the code, and no AI tool, ever holds them. Smileline adds them to the pages each time the website builds.
The Patient stories card on the Code tab lists them, each with its name or caption, the start of its words and its picture. Remove takes one off the website for good: it can't be added back, and no build made before it can be published, restored or opened with a draft link. Smileline rebuilds the live website without it and publishes by itself, unless that brings up a new website warning: then the card says the story stays on the website until you publish the new build, with Publish.
If the website visitors see is still the one from before converting, removing a story takes it out of the code website only: to take it off, Rebuild the code website (builds made before the removal can't be published), then publish it.
Forms in the code
Forms connect themselves when you publish. The code declares each form in smileline.forms.json, at the root of the project:
{
"$schema": "./node_modules/@smileline/astro/smileline.forms.schema.json",
"forms": {
"contact": {
"kind": "form",
"name": "Contact form",
"treatment": "dental-implants",
"fields": {
"first_name": { "target": "firstName" },
"email": { "target": "email" },
"phone": { "target": "phoneMobile" },
"how_did_you_hear": { "target": "extra", "label": "How did you hear about us" }
}
}
}
}- Each form has a key (lowercase letters, numbers and hyphens, up to 64 characters), which its page names with
data-sl-form-key. Forms from before the conversion already have theirs. - kind is
form,quizorcallback. A form's kind never changes: a build that changes it fails, so give a call-back form its own name. - name is how the form is listed on the website's Forms tab; treatment (a treatment's slug) and location are where its enquiries are filed.
- fields maps each input's name to a patient detail, or keeps it as an extra on the enquiry (up to 20). Two inputs can't fill the same detail.
- File upload fields aren't sent: the website check flags them.
An enquiry from a form the code doesn't declare isn't lost. It waits in Settings → Review queue, under Couldn't be processed: choose File under… and pick the website form it belongs to, and it becomes a lead with that form's fields. While it's open you can change your choice with Change form, for example if it had no email address or phone number under the first form. Filing it twice never makes two leads. On a day with more of these than anyone could file, the rest become leads straight away. See Review queue.
What the code can use
A build uses only these packages, which Smileline installs; nothing is downloaded while it builds:
@astrojs/react, @fontsource-variable/dm-sans, @fontsource-variable/fraunces, @fontsource-variable/inter, @fontsource-variable/manrope, @fontsource/dm-serif-display, @smileline/astro, @smileline/site-blocks, @tailwindcss/vite, astro, react, react-dom, tailwindcss, @types/react, @types/react-dom and typescript.
A package.json that names any other package fails the build, naming it. The scripts in package.json never run: Smileline runs the Astro build itself.
Campaigns and landing pages
Campaigns that sent people to a page of the website keep sending them to the same address after its first code publish. They no longer move with the page: if the code moves a page, change the campaign's landing page. If a campaign's page disappears from a build, the website check says so.
When your main website is code, new landing pages made from a template go on your landing site. If your landing site is code too, pages are added in its code instead: enter the address the ads should open.
Download your website
Download a live website as an Astro project that a developer or an AI coding tool can change and put online anywhere.
Edit a code website with Claude Code or another tool
Clone a code website's code with a link you make in Smileline, or let Claude or ChatGPT change its files through the Smileline connector, and publish when you're happy.