Build this website with blocks
Try another way to build: snap together HTML, CSS and behavior blocks, change their fields, and watch your website update. Start with this lesson’s project or try a code example below.
Want to keep what you build? Web Studio holds a drawing, blocks and code in one project that you can share on the class site and publish as your own website.
Publish and maintain your website
Your site works on your laptop. That is not the same as working on the web. In this lesson you save your work in Git, put the folder online with GitHub Pages, and repair the four faults that only appear once a real server is serving your files.
Publishing is a decision, not just a step. Once a page is public, other people — and machines you will never meet — can read it, copy it, and keep a copy. Read the safety section before you press publish, not after.
Before you start
- A finished project folder from the studio lesson that opens correctly from your own hard drive.
- A file named
index.htmlat the top level of that folder. - Git installed, and a GitHub account. If your account needs adult permission, ask first.
- Your test notes from the testing lesson.
Publishing is free on GitHub Pages for a public repository. A custom domain name is optional and costs money every year — skip it for now.
Version control is a safety net, not a ceremony
Git is often taught as a set of rituals you perform because professionals do. That is the wrong reason. The real reason is simpler: Git lets you make a bold change to your site knowing you can get the working version back. Without it, "undo" ends when you close the editor.
A commit is a saved snapshot of your whole folder at one moment, with your name, the time, and a short message attached. The snapshot is complete: every file as it stood. You can return to any commit later, compare two of them, or look at the message to remember why you made a change.
The message matters because you are writing it for a future person who has forgotten everything — usually you, three weeks from now. update and stuff tell that person nothing. Fix image case so photos load on the server tells them exactly what happened and why.
Start tracking a folder
Open a terminal in your project folder and run these once:
cd my-site
git init
git add .
git commit -m "First working version of my portfolio site" git init creates the hidden history. git add . stages every file in the folder for the next snapshot. git commit writes the snapshot with your message.
Connect it to GitHub and push
Create an empty repository on GitHub first — do not let it add a README, because your folder already has files. Then run these, replacing the placeholder parts with your own:
git branch -M main
git remote add origin https://github.com/YOUR-USERNAME/YOUR-REPO.git
git push -u origin main push copies your commits to GitHub. Nothing you have not committed gets pushed, so a file you forgot to add simply will not be there.
The everyday loop
From now on, every time you finish a change that works:
git add .
git commit -m "Add Orbit study project card and fix the contact link"
git push Commit small and often. A commit that changes one thing is easy to undo; a commit that changes forty things is not.
This is the short version. Branches, pull requests, and working with other people are covered properly in GitHub collaboration. You do not need any of that to publish — you need add, commit, push.
Publish with GitHub Pages
GitHub Pages takes the files in your repository and serves them as a website. It runs no code of your own on the server: your HTML, CSS, JavaScript, and images are handed to visitors exactly as they are. That is all a static site needs.
- Make the repository public. On a free account, Pages publishes from public repositories. If the repository is private, anyone who can reach the site still cannot read the source, but the free plan may not publish it at all.
- Check that
index.htmlis at the top level. Not insidemy-site/my-site/. Whatever sits next toindex.htmlis the root of your published site. - Push your commits with the commands above, and confirm on GitHub that you can see your files in the browser.
- Open the repository's Settings → Pages. GitHub redesigns this page from time to time, so look for "Pages" in the Settings sidebar rather than memorising where the button sits today.
- Choose to deploy from a branch, select
mainand the root folder (/), and save. - Wait. The first deploy commonly takes a few minutes; later ones are usually faster. Reload the Pages settings screen until it shows your address.
- Open your URL. It normally looks like
https://YOUR-USERNAME.github.io/YOUR-REPO/. Try it on a phone as well as your laptop.
Check: the page loads at that address, with your CSS applied, your images visible, and your buttons working — from a device that is not the one you built it on.
Repair: a 404 page usually means index.html is not at the root, or Pages is pointed at the wrong branch. A page that loads as plain black text on white means the CSS file was requested and not found — go to the next section. Nothing at all after ten minutes: check the repository's Actions or Pages status for a failed build.
This site keeps its own hosting walkthrough with screenshots at the website publishing guide. Read it alongside this lesson if you get stuck on the GitHub interface itself.
Built it in Web Studio? Two ways to publish
Web Studio gives you two routes, and you can take both.
The class site first
Choose Download my submission file and hand it in. Your teacher imports it, reads your code, and publishes it at mrscandrett.github.io/apps/your-name-project/ in the class showcase. You get a real link to share without making an account.
Your own site, no terminal
Choose Download my website (ZIP). On GitHub, create a repository, choose Add file → Upload files, drag in everything inside the unzipped folder, and commit. Then turn on Pages exactly as in the steps above. Each time you change the site, upload the changed files again. That is a commit, made in the browser.
Uploading by hand works, but it gets slow once you change files every day. The Git route above records each change with a message and lets you undo. Move to it when you are ready. The four faults below apply to both routes.
The four faults that only appear on a real host
Your laptop is a forgiving reader of your files because its desktop operating system masks differences that web servers strictly enforce. These four differences cause almost every "but it worked at home" report, and all four are quick to fix once you understand the underlying mechanism.
| Fault | Why your laptop hid it | What you see online | The fix |
|---|---|---|---|
| Filename case | Most Windows and macOS filesystems (NTFS and default APFS) are case-insensitive; therefore, requesting Photo.PNG successfully loads photo.png on your laptop because the operating system driver ignores capitalization differences. However, Linux web servers in production datacenters use case-sensitive filesystems (such as ext4); this means the server treats them as two completely distinct files, and because only one exists on disk, the server returns an HTTP 404. | Missing images, an unstyled page, a script that never runs. The browser console shows 404 for a file you can plainly see in your folder. | Rename every file to lowercase with hyphens and no spaces, then make each href and src match character for character. Commit the rename and push. |
| Absolute paths | A local development server starts serving directly from your project folder, so /style.css reaches your stylesheet. On GitHub Pages, however, your project lives inside a repository sub-path (your-name.github.io/my-site/); therefore, a leading slash /style.css instructs the browser to request the root of the entire domain (your-name.github.io/style.css), which climbs outside your repository and fails. As a result, only relative paths work universally across local drives, subfolders, and production servers. | The page arrives with no design and no behaviour, even though the files are in the repository. | Use relative paths only: style.css, images/logo.png, ../index.html. Search your HTML for href="/, src="/, file:// and C:\ and replace each one. |
No index.html at the root | You have been double-clicking home.html, so the name never mattered. | A 404 page at your site address, even though clicking through to the file on GitHub shows it exists. | Rename your entry page to exactly index.html and put it at the top level of the repository. Every folder that should have a landing page needs its own index.html. |
| Browser cache | Locally you reload a file that is already on disk. Online, your browser keeps a copy of the CSS and JavaScript it downloaded earlier and reuses it to save time. | Your fix is live for other people but you still see the old version — or the layout is new and the script is old, which looks like a brand new bug. | Hard reload: Ctrl+Shift+R on Windows and Linux, Cmd+Shift+R on macOS. If that fails, open the URL in a private window. Give the deploy a minute before deciding it failed. |
One tool finds all four faster than guessing: open your published site, press F12, and read the Console and Network panels. A red 404 line names the exact file the browser asked for. Compare that name — including its capital letters and its folder — against what is actually in your repository. The difference between those two strings is your bug.
Lab — Will it survive the server?
This lab plays both readers at once. On the left is the HTML of a site that works perfectly on its maker's laptop. On the right is what is actually in the repository. Run it and see which requests a real host would answer with a 404 — then repair them. You may edit the HTML, rename files in the list, or both, exactly as you would in VS Code.
Laptop versus GitHub Pages
| Reference | Laptop | GitHub Pages | Why |
|---|
Check: the feedback line says Ready to commit and push, and every row in the GitHub Pages column says Loads. External links such as MDN are skipped — they are someone else's server.
Repair: notice that most rows say Loads on the laptop. That is the whole trap: nothing looked wrong until the server read the files. The quickest repairs are lowercase names with hyphens instead of spaces (images/team-photo.jpg), and paths that start from this page rather than from your drive or the top of the domain.
Pre-flight checklist
Run this list before you send the link to anybody. It takes about five minutes and saves you sending a second, embarrassed message.
These boxes are for this session only. The saved checkpoints for the lesson are at the bottom of the page.
What "public" actually means
Take this section slowly. You are about to publish for real, and the web does not have a reliable undo.
A published page can be read by anyone who finds the address — no account, no invitation, no link from you. Search engines index public pages automatically. Archiving services keep copies. Other people can screenshot, download, or repost anything you show. Removing a page later does not remove the copies. Plan for the version you publish today to still exist somewhere years from now.
Keep these off the site
- Your home address, your phone number, your full date of birth. A first name, or a handle, is enough identity for a school project.
- Your school schedule, or anything that says where you will be at a given time. This one surprises people; it is the most useful information a stranger could take from a student site.
- Photos of other people without their permission — and for classmates, that means their permission and their family's. "They were in my photo already" is not permission.
- Passwords, API keys, and tokens. JavaScript that ships to the browser is readable by every visitor: View Source shows it, and a minified file is still readable. There is no way to hide a secret in front-end code. If a service gives you a key, it does not belong in this project.
- Other people's images, music, and code unless the licence allows it and you credit them.
Two extra points that catch people out. First, a public repository publishes your source as well as your site — including files you never linked to. Second, Git history keeps deleted files: removing a file in a later commit does not erase it from the earlier commits that are already pushed. If something sensitive gets committed and pushed, deleting it is not enough; tell your teacher or another trusted adult, because the repository itself may need attention.
If a contact form on your static site appears to send mail, check what it really does. A plain HTML page in a browser cannot send email or store a message on its own. Without a third-party form service, your form collects a message and then drops it. Say so on the page rather than letting a visitor believe they reached you.
Maintaining a live site
Keep a changelog
Add a file called CHANGELOG.md at the root and write one line per change, newest at the top. It takes ten seconds and it turns "I think I broke it on Tuesday" into a fact you can check against your commits.
# Changelog
## 2026-03-04
- Renamed images/Header.png to header.png so it loads on the server.
- Added the Orbit study project card.
## 2026-02-27
- First public version. Fix a broken link
Links rot. Your own pages move when you rename a file; other people's pages disappear entirely. Once a month, click every link on your site — internal ones first, then external. When one fails, decide: update the href to the new location, replace it with a working source, or remove it and say what used to be there. A dead link that stays on the page for a year tells visitors nobody is looking after the site.
Taking something down
To remove one page: delete the file, commit, push. To take the whole site offline: turn Pages off in the repository's Settings → Pages, or make the repository private.
Then be honest with yourself about what that achieved. The live address stops serving the file, and that is genuinely worth doing. But caches, archives, search results, and other people's screenshots are outside your control, and removal is not guaranteed to be retroactive. Some archives accept removal requests; they are requests, not commands.
If something personal about you or someone else has gone public, do not try to handle it silently. Ask a trusted adult for help the same day.
Growing later
A custom domain (yourname.com) is optional, costs money every year, and changes nothing about how your files work. Get the free github.io address right first.