BM: Baca dalam Bahasa Melayu
World 9: Power Tools
GitHub Pages
You will learn: how to turn your repo into a website.
The problem
Your diary site works on your laptop. Your friend in Kuching wants to see it. Do you send a zip file?
Pick one answer.
Watch
Tap each point on the timeline.
GitHub Pages: Hosting that turns plain files in your repo (HTML, CSS, JavaScript) into a website. turns files in your repo into a website. It hosts plain files only: HTML, CSS and JavaScript. No server code, no database.
Try it
Switch Pages on. Put the steps in order.
First step at the top. Put these in order. Use the arrows, or drag.
- Click Save, then wait a few minutes
- Go to Settings, then Pages
- Open your repo on GitHub
- Choose main and the root folder
- Pick Deploy from a branch
Hint
You can’t pick a branch before you open the Pages settings.Predict
Your username is aina-codes. The repo is diary. Where does the site live?
Pick one answer.
Try it
Pages can use a Markdown file as your home page. Write one. Add a title and a link.
Add a # title line and a link.
Preview
Hi! This is my diary.
0 of 2 goals done
Hint
Try# My Diary on the first line.Check
Can Pages host it? Sort each one.
Drag a card into a box. Or tap the card, then tap the box.
Try it
Real mission: switch on Pages for your diary repo. Pages sites are public, so keep secrets out. Then check it here.
Check it on GitHub
- Your diary repo is publicNot checked yet
- GitHub Pages is onNot checked yet
Hint
Settings, then Pages. Deploy from a branch: main, root folder.You did it!
You can now publish a website from your repo.
Go deeper (optional)
Name a repo your-name.github.io, and it becomes your main site, at the root. Pages looks for index.html, index.md or README.md first. You can also publish with a GitHub Actions workflow. Custom domains work too. Changes can take up to 10 minutes to show.
Bahasa Melayu
Laman web diari anda jalan elok di laptop. Kawan anda di Kuching mahu tengok. Patutkah anda hantar fail zip?
GitHub Pages jadikan fail dalam repo anda sebuah laman web. Ia hos fail biasa sahaja: HTML, CSS dan JavaScript. Tiada kod pelayan, tiada pangkalan data.
Hidupkan Pages. Susun langkahnya ikut urutan.
Nama pengguna anda aina-codes. Repo itu diary. Di mana laman web itu tinggal?
Pages boleh guna fail Markdown sebagai halaman utama. Tulis satu. Tambah tajuk dan pautan.
# Diari Saya di baris pertama.Boleh Pages hos ini? Susun setiap satu.
Misi sebenar: hidupkan Pages untuk repo diary anda. Laman Pages terbuka kepada umum, jadi jauhkan rahsia. Kemudian semak di sini.
Kini anda boleh terbitkan laman web dari repo anda.
You finished this before. Practice is always welcome!
Official docs: What is GitHub Pages? · Creating a GitHub Pages site · Configuring a publishing source
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?