Make a new site and preview it on a phone
For builders who have set up ws.
It covers making a new site on the Website Strategy platform, the hosting service that builds and serves it, the starter files it comes with, and opening it on a phone through a private preview link. It takes about two minutes.
From here on the guide follows Jordan Bell, a builder at Website Strategy, through a site for Saltmere Marina.
1. Make the site
Section titled “1. Make the site”ws new "Saltmere Marina"You are not signed in. Opening https://outport.app in your browser to sign in.Signed in as Jordan Bell.
Made the site "Saltmere Marina". Subdomain: saltmere-marina Language: English (en) Time zone: America/Halifax Folder: ./saltmere-marina (a Git clone, 6 files)
Next: cd saltmere-marina && ws previewIf you are not signed in yet, ws opens your browser so you can sign in with your Outport staff account. After that it stays signed in.
ws new gives the site two names:
- The display name is “Saltmere Marina”. It is the name people read, and it can hold any text. Pages print it with
{{ site.name }}. - The subdomain is
saltmere-marina. It starts the site’s web addresses on our preview domain,sitepeek.page.wsmakes it from the display name. It uses lowercase letters, numbers and single hyphens, and no two sites can share one. To choose it yourself, add--subdomain saltmere.
The site’s language and time zone come from your computer. Change them with --languages en,fr or --time-zone America/St_Johns. You choose the languages: set them to every language of the website the business has now, and the time zone to the business’s own. ws does not look them up. For a business with a French site too, you would run ws new "Saltmere Marina" --languages en,fr. This guide adds French later, in part 5, to show each step.
The folder is a Git clone of the site’s repository on the platform, with one commit holding the starter files. It is named after the subdomain, but its name does not matter: you can rename or move it, and ws still knows which site it is. Part 6, What is saved where, lists what lives in the folder and what lives on the platform.
2. Look at the starter files
Section titled “2. Look at the starter files”cd saltmere-marinals -A.git .gitignore .ws AGENTS.md _includes _layouts index.html styles.css| File | What it is |
|---|---|
index.html |
The home page, at /. |
_layouts/default.html |
The HTML around every page: the head, the header and the footer. |
_includes/header.html and _includes/footer.html |
The header and footer, kept in one place so every page shares them. |
styles.css |
The site’s style sheet, published at /styles.css. |
AGENTS.md |
Notes for coding agents on how this folder works. It is not published. |
.git/ |
The repository. Git already ignores .ws/ in this clone. |
.gitignore |
The files a site leaves out: dot files and node_modules. Commit it, and add anything else that stays on your computer. |
.ws/ |
ws keeps the site’s ID here, and which version of the site the folder holds. A version is the numbered copy of the site saved each time someone publishes it. Leave it alone. |
The layouts and includes folders hold the parts of pages, and are never published themselves.
This is the whole home page:
---layout: defaulttitle: Home---<h1>{{ site.name }}</h1><p>Welcome. This page is index.html.</p>The lines between the two --- lines are the page’s front matter: settings for this page. layout: default wraps the page in _layouts/default.html. title is the page’s title.
And this is the layout that wraps it:
<!doctype html><html lang="{{ page.lang }}"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>{{ page.title }} · {{ site.name }}</title> <link rel="stylesheet" href="/styles.css"></head><body> {% render 'header.html' %} <main>{{ content }}</main> {% render 'footer.html' %}</body></html>{{ content }} is where the page goes. {% render 'header.html' %} puts in the header file. {{ page.lang }} is the page’s language, English here. The tags in curly braces are Liquid, the template language Shopify made. Everything else is plain HTML. A page with no Liquid and no front matter is fine too: the platform serves it as it is.
3. Open a preview on your phone
Section titled “3. Open a preview on your phone”ws previewBuilt 1 page.
Private preview, open to anyone with this link until November 20:https://saltmere-marina--k7f3.sitepeek.page/?key=Hn4pX7rKq2Lw9TzB3mVc8d
█▀▀▀▀▀█ ▄▀ ▄█ █▀▀▀▀▀█ █ ███ █ ██▀▄▀ █ ███ █ █ ▀▀▀ █ ▄▀█▀▄ █ ▀▀▀ █ ▀▀▀▀▀▀▀ █ ▀ █ ▀▀▀▀▀▀▀Scan the code with your phone's camera to open the preview.The QR code prints only when ws writes to a terminal window, so it never fills a log or another program’s input; the link is always there.
ws preview sends the folder to the platform. The platform builds every page and serves them at a web address for this folder alone: the subdomain, then -- and a short code. You never run the platform on your own computer.
The link works on any phone or computer. The key at the end of the link signs that browser in to this one preview, then is removed from the address. Without the key, the address shows only “This preview is private”. When the link expires, or you replace it with ws preview --new-link, every browser it signed in loses access. Search engines are told not to list it.
Change a file and run ws preview again. You get the same link, open for 7 more days, and any page you have open reloads itself. ws site --preview-expires 14d changes how long a preview link lasts for this site, and ws site --expires 60d how long its sample link lasts once you publish it in part 6. For a sample made only to try things out, ws site --expires 1d ends its link, and deletes it, a day after its last publish.
4. Keep the preview up to date as you work
Section titled “4. Keep the preview up to date as you work”To skip running ws preview after every change, leave it watching the folder:
ws preview --watchBuilt 1 page.Private preview: https://saltmere-marina--k7f3.sitepeek.page/?key=Hn4pX7rKq2Lw9TzB3mVc8dWatching this folder. Press Ctrl+C to stop.10:14:03 styles.css changed. Swapped the style sheet on 2 open pages.10:14:20 index.html changed. Rebuilt 1 page and reloaded it on 2 open pages.Each time you save a file, ws sends only the files that changed. The platform rebuilds the pages they affect and tells every browser that has the preview open, including your phone. A changed style sheet is swapped in place; any other change reloads the page at the same scroll position. Shopify’s shopify theme dev works the same way. The Reference page has the details.
If a page has a mistake
Section titled “If a page has a mistake”The platform stops at the first mistake and names the file, the line and a fix:
ws previewindex.html line 5: there is no "site.titel". Did you mean "site.name"?Nothing changed: the preview still shows the last build that worked.