@@ -34,64 +34,33 @@ communicate endlessly back and forwards about what changes need to be made, or h
3434'issues' (things that need discussing or fixing), list things to do in the future, and allow other people visiting your
3535website to quickly suggest, and help implement changes through pull requests.
3636
37- ### Setting up a site
38-
39- Now we're all persuaded of how awesome GitHub Pages is (or you've identified some fatal flaws in my reasoning), it
40- would be useful to try playing around with some things we can do with it. This will help us cement what we
41- have learned in the previous hour and may help spark discussion for the last section of this session.
42-
43- There are various options for setting up a GitHub Pages site. Let's run through a few of them now.
44-
45- ### The gh-pages branch
46-
47- GitHub Pages uses a special branch in your GitHub repository to look for website content,
48- and by default this is the branch with the name 'gh-pages'.
49- You can actually change this, under repository settings, to use for instance the main branch instead,
50- but let's stick with the default for now.
51-
52- It's possible to create a new branch directly on GitHub, but we will use the command line now.
53- So we will move back to the command line and type
54-
55- ~~~
56- $ git checkout -b gh-pages
57- $ git push
58- ~~~
59- {: .language-bash }
60- ~~~
61- fatal: The current branch gh-pages has no upstream branch.
62- To push the current branch and set the remote as upstream, use
63-
64- git push --set-upstream origin gh-pages
65- ~~~
66- {: .output}
67-
68- Ouch, that didn't go as we wanted, we got a fatal error!
69- Let's see what Git tells us.
70- It says that it doesn't know where it should push the changes.
71- But it's also friendly enough to tell us what we most likely want to do,
72- which is to push to the ` gh-pages ` branch at "origin"
73- (remember that "origin" in our case is just a nickname for our GitHub repository).
74-
75- So let's do that:
76-
77- ~~~
78- $ git push --set-upstream origin gh-pages
79- ~~~
80- {: .language-bash }
81- ~~~
82- Total 0 (delta 0), reused 0 (delta 0)
83- To https://github.com/danmichaelo/hello-world.git
84- * [new branch] gh-pages -> gh-pages
85- Branch gh-pages set up to track remote branch gh-pages from origin.
86- ~~~
87- {: .output}
88-
89- You might remember from earlier that we did ` git push -u origin main ` to
90- set up the main branch. The ` -u ` is a shorthand for ` --set-upstream ` , so
91- above you could also have typed ` git push -u origin gh-pages ` .
92-
93- And remember, we only have to do this the first time we push to a new branch.
94- The next time we can just do ` git push ` .
37+ ### Enable GitHub Pages
38+
39+ GitHub Pages is turned off by default for all new repositories, and can be turned on in the settings menu for any repository.
40+
41+ Let's set up a new site by enabling GitHub Pages for our project.
42+
43+ Go to the Pages section of your repository's Settings:
44+
45+ ![ GitHub repository's Pages settings] ( ../fig/github-repo-settings-pages.png )
46+
47+ #### Source branch (required)
48+
49+ Pages needs to know the branch in your repository from which you want to serve your site. This can be any branch, including ` main ` .
50+
51+ Select then save the source branch:
52+
53+ ![ GitHub Pages source branch menu] ( ../fig/github-repo-settings-pages-branch.png )
54+
55+ ![ GitHub Pages source branch save] ( ../fig/github-repo-settings-pages-save.png )
56+
57+ #### Theme (optional)
58+
59+ GitHub Pages provides different themes to visually style and organize your site's content. Choosing a theme is optional, and themes can be interchanged quickly.
60+
61+ ![ GitHub Pages choose theme] ( ../fig/github-repo-settings-pages-theme.png )
62+
63+ See the [ GitHub Pages documentation] ( https://docs.github.com/en/pages/getting-started-with-github-pages/adding-a-theme-to-your-github-pages-site-with-the-theme-chooser ) for further information on using themes.
9564
9665### View your site
9766
0 commit comments