Using GitHub to make a webpage
[«PREVIOUS: -Cloning and collaborating: managing contributions»] [Table of Contents] - [NEXT: More advanced things to think about»]
Still not convinced that GitHub is something you should be using? There’s another great feature: They make it relatively straightforward to create a website for free, using markdown and GitHub pages. This site is written entirely in Markdown and hosted in GitHub - you can browse the code yourself, and even fork it or make pull requests.
Markdown provides formatting on GitHub
You can use it in readme files, tickets, and even to generate websites.
Some of the formatting options
bold text: **bold**
Italic text: _Italic_
~Strikethrough~ text: ~Strikethrough~
Quoted text:
>Quoted text:
Heading 1
Heading 2
Heading 3
# Heading 1
## Heading 2
### Heading 3
Code blocks
``` Code blocks ```
- unordered
- bullet
- points
- unordered
- bullet
- points
- Numbered
- Bullets
1. Numbered
2. Bullets
Link to another page: [Link to another page](http://www.google.com)
For a full list, visit GitHub’s Formatting Guide
Exercise: Add markdown to your Repository
- On your computer, create a file in your repository called
index.md
. index is always the entry point to any website - the “Default” webpage. - Add some content - perhaps this could be your to-do list or a “Welcome to my homepage” page if you like. Save it and commit it to your repository, then push to GitHub.
Enabling the website component
Now you need to enable GitHub Pages in order to see it turn into a live website.
- On your GitHub repository, go to the settings (top rightish tab with a cog icon).
- Scroll down to the
GitHub pages
section. UnderSource
, selectMaster branch
and press save. - You can also select a theme if you like!
- Once this is done, you should see a green message saying “Your site is published at some-link.github.io”. Click on it - and ta-da! You have a website.
[«PREVIOUS: -Cloning and collaborating: managing contributions»] [Table of Contents] - [NEXT: More advanced things to think about»]