Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit 7054fdb

Browse files
authored
Merge pull request #18 from githubtraining/edits
Edit course to work on GHE also
2 parents 55aa42c + 9ce8b9d commit 7054fdb

25 files changed

+147
-252
lines changed

config.yml

Lines changed: 41 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,27 @@ template:
88
name: github-pages-with-jekyll
99
repo: github-pages-with-jekyll-template
1010
before:
11-
- type: updateBranchProtection
1211
- type: createIssue
1312
title: Welcome
14-
body: 01_class-introduction-issue.md
13+
body: 00_class-introduction-issue.md
14+
1515
steps:
16-
- title: Enable GitHub Pages
17-
description: Turn on GitHub Pages in your repository.
18-
event: deployment_status
16+
- title: Generate a GitHub Pages site
17+
description: Generate a GitHub Pages site with the automatic page generator.
18+
event: page_build
1919
link: '{{ repoUrl }}/issues/1'
2020
actions:
21-
- type: gate
22-
left: '%payload.deployment_status.state%'
23-
operator: ===
24-
right: success
25-
- type: gate
26-
left: '%payload.deployment.environment%'
27-
operator: ===
28-
right: github-pages
21+
- type: octokit
22+
method: repos.getPages
23+
owner: '%payload.repository.owner.login%'
24+
repo: '%payload.repository.name%'
25+
action_id: pagesUrl
2926
- type: respond
3027
issue: 1
31-
with: 02_update-index.md
28+
with: 01_update-index.md
3229
data:
33-
url: 'https://%user.username%.github.io/%payload.repository.name%'
30+
deploymentUrl: '%actions.pagesUrl.data.html_url%'
31+
- type: updateBranchProtection
3432

3533
- title: Customize your homepage
3634
description: Open a pull request with changes to the homepage.
@@ -42,23 +40,17 @@ steps:
4240
required: false
4341
else:
4442
type: respond
45-
with: 06a_pull-request-blank.md
43+
with: 02_pull-request-blank.md
4644
- type: getTree
4745
action_id: tree
4846
sha: '%payload.pull_request.head.sha%'
49-
- type: gate
50-
gates:
51-
- left: '%actions.tree.data.tree%'
52-
operator: includes
53-
right: 'path:index.html'
54-
- left: '%actions.tree.data.tree%'
55-
operator: includes
56-
right: 'path:index.md'
5747
- type: createReview
58-
body: 02r_merge-pr.md
48+
body: 02_merge-pr.md
5949
event: APPROVE
6050
data:
6151
branch: '%payload.pull_request.head.ref%'
52+
- type: closeIssue
53+
issue: Welcome
6254

6355
- title: Merge your pull request
6456
description: Merge the pull request that customizes your homepage.
@@ -71,56 +63,22 @@ steps:
7163
left: '%payload.pull_request.base.ref%'
7264
operator: ===
7365
right: 'master'
74-
- type: getTree
75-
action_id: tree
76-
sha: '%payload.pull_request.head.sha%'
77-
- type: gate
78-
gates:
79-
- left: '%actions.tree.data.tree%'
80-
operator: includes
81-
right: 'path:index.html'
82-
- left: '%actions.tree.data.tree%'
83-
operator: includes
84-
right: 'path:index.md'
85-
else:
86-
type: respond
87-
with: 02_wrong-file-updated.md
88-
- type: createIssue
89-
action_id: issue
90-
title: Adding a Theme
91-
body: 03_add-a-theme.md
92-
- type: closeIssue
93-
issue: Welcome
94-
- type: removeBranchProtection
95-
- type: respond
96-
with: 04_moving-on-pr.md
97-
data:
98-
url: '%actions.issue.data.html_url%'
99-
100-
- title: Add a theme
101-
description: Using the theme chooser, select a theme for your site.
102-
event: push
103-
link: '{{ repoUrl }}/issues'
104-
actions:
105-
- type: getFileContents
106-
action_id: fileContents
107-
filename: _config.yml
108-
- type: gate
109-
left: '/^theme:/m'
110-
operator: test
111-
right: '%actions.fileContents%'
11266
- type: updateBranchProtection
67+
- type: octokit
68+
method: repos.getPages
69+
owner: '%payload.repository.owner.login%'
70+
repo: '%payload.repository.name%'
71+
action_id: pagesUrl
11372
- type: createIssue
11473
action_id: issue
11574
title: Getting ready to blog
116-
body: 05_change-theme.md
75+
body: 03_change-theme.md
76+
data:
77+
deploymentUrl: '%actions.pagesUrl.data.html_url%'
11778
- type: respond
118-
with: 04_moving-on.md
119-
issue: Adding a Theme
79+
with: 03_merged-pr.md
12080
data:
12181
url: '%actions.issue.data.html_url%'
122-
- type: closeIssue
123-
issue: Adding a Theme
12482

12583
- title: Customize site details
12684
description: Edit the configuration file to display your information.
@@ -148,7 +106,7 @@ steps:
148106
left: '%payload.pull_request.body%'
149107
else:
150108
type: respond
151-
with: 06a_pull-request-blank.md
109+
with: 02_pull-request-blank.md
152110
- type: getFileContents
153111
filename: _config.yml
154112
action_id: file
@@ -159,10 +117,10 @@ steps:
159117
else:
160118
type: createReview
161119
event: REQUEST_CHANGES
162-
body: 05r_wrong-theme.md
120+
body: 04_wrong-theme.md
163121
- type: createReview
164122
event: COMMENT
165-
body: 07_create-blog-post.md
123+
body: 04_create-blog-post.md
166124
data:
167125
branch: '%payload.pull_request.head.ref%'
168126
date: '%payload.pull_request.created_at%'
@@ -216,7 +174,7 @@ steps:
216174
- left: '%actions.filename%'
217175
else:
218176
- type: createReview
219-
body: 07b_incorrect-post.md
177+
body: 05_incorrect-post.md
220178
event: REQUEST_CHANGES
221179
data:
222180
directory: '%actions.directory%'
@@ -225,7 +183,7 @@ steps:
225183
extension: '%actions.extension%'
226184
filename: '%actions.filename%'
227185
- type: createReview
228-
body: 08_add-front-matter.md
186+
body: 05_add-front-matter.md
229187
event: COMMENT
230188

231189
- title: Add blog post metadata
@@ -270,24 +228,30 @@ steps:
270228
- left: '%actions.date%'
271229
else:
272230
- type: createReview
273-
body: 08r_incorrect-front-matter.md
231+
body: 06_incorrect-front-matter.md
274232
event: REQUEST_CHANGES
275233
data:
276234
date: '%actions.date%'
277235
title: '%actions.title%'
278236
dashes: '%actions.dashes%'
237+
- type: removeBranchProtection
279238
- type: createReview
280-
body: 09_merge-and-celebrate.md
239+
body: 06_merge-and-celebrate.md
281240
event: APPROVE
282241

283242
- title: Merge your first post
284243
description: Merge the pull request so your blog post will appear on your GitHub Pages site.
285244
event: pull_request.closed
286245
link: '{{ repoUrl }}/pulls'
287246
actions:
247+
- type: octokit
248+
method: repos.getPages
249+
owner: '%payload.repository.owner.login%'
250+
repo: '%payload.repository.name%'
251+
action_id: pagesUrl
288252
- type: gate
289253
left: '%payload.pull_request.merged%'
290254
- type: respond
291-
with: 10_next-steps.md
255+
with: 07_next-steps.md
292256
data:
293-
url: 'https://%user.username%.github.io/%payload.repository.name%'
257+
deploymentUrl: '%actions.pagesUrl.data.html_url%'
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Welcome to GitHub Pages and Jekyll :tada:!
44

5-
If you're new to GitHub Pages, or you want to learn how to build and host a [GitHub Pages](https://pages.github.com) site, you're in the right place. With GitHub Pages, you can host content like [documentation](https://flight-manual.atom.io/), [resumes](https://github.com/jglovier/resume-template), or any other static content you’d like.
5+
If you're new to GitHub Pages, or you want to learn how to build and host a [GitHub Pages](https://pages.github.com) site, you're in the right place. With GitHub Pages, you can host content like [documentation](https://flight-manual.atom.io/), [resumes](https://github.com/jglovier/resume-template), or any other static content that you’d like.
66

77
In this course, you'll create a blog hosted on GitHub Pages and learn how to:
88

@@ -12,23 +12,20 @@ In this course, you'll create a blog hosted on GitHub Pages and learn how to:
1212

1313
### New to GitHub?
1414

15-
Before we can begin, you'll need to know how to create a branch on GitHub, commit changes using Git, and open a pull request on GitHub. If you need a refresher on the GitHub flow, check out the [Introduction to GitHub course]({{ host }}/courses/introduction-to-github).
15+
For this course, you'll need to know how to create a branch on GitHub, commit changes using Git, and open a pull request on GitHub. If you need a refresher on the GitHub flow, check out the [the Introduction to GitHub course]({{ host }}/courses/introduction-to-github).
1616

17-
### :keyboard: Activity: Turn on GitHub Pages
17+
### :keyboard: Activity: Generate a GitHub Pages site
1818

1919
The first step to publishing your blog to the web is to enable GitHub Pages on this repository <sup>[:book:](https://help.github.com/articles/github-glossary/#repository)</sup>. When you enable GitHub Pages on a repository, GitHub takes the content that's on the master branch and publishes a website based on its contents.
2020

21-
1. Under your repository name, click [**Settings**]({{ repoUrl }}/settings)
22-
1. In the "GitHub Pages" section, use the Select source drop-down menu to select the `master branch` as your GitHub Pages publishing source.
23-
1. Click **Save**
21+
1. Under your repository name, click [**Settings**]({{ repoUrl }}/settings).
22+
1. In the "GitHub Pages" section, in the Source drop-down, select **master branch**.
2423

25-
After GitHub Pages is enabled, we'll be ready to create some content.
26-
27-
For a printable version of the steps in this course, check out the [Quick Reference Guide]({{ host }}/public/{{ course.slug }}.pdf).
24+
After GitHub Pages is enabled and the site is started, we'll be ready to create some more content.
2825

2926
> Turning on GitHub Pages creates a deployment of your repository. I may take up to a minute to respond as I await the deployment.
3027
3128
<hr>
32-
<h3 align="center">Return to this issue for my next comment</h3>
29+
<h3 align="center">Return to this issue for my next comment.</h3>
3330

3431
> _Sometimes I respond too fast for the page to update! If you perform an expected action and don't see a response from me, wait a few seconds and refresh the page for your next steps._

responses/01_update-index.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## Step 2: Customize your homepage
2+
3+
Great job! Now that GitHub Pages is enabled, you can view your website here: {{ deploymentUrl }}
4+
5+
You can customize your homepage by adding content to either an `index` file or the `README.md` file. GitHub Pages first looks for an `index` file. If an `index` file is found, GitHub Pages uses the content in the file to create the homepage. If an `index` file isn’t found, it uses the `README.md` to create the homepage.
6+
7+
Your repository has an `index.md` file so we can update it to include your personalized content.
8+
9+
### :keyboard: Activity: Create your homepage
10+
11+
1. Navigate to the **Code** tab of this repository, and browse to the `index.md` file, or click this link [here]({{ repoUrl }}/blob/master/index.md)
12+
2. In the upper right corner, click the the icon to the right of the file to edit the `index.md` file
13+
3. Type the content you want on your homepage
14+
4. Scroll to the bottom, type a commit message, and click **Create a new branch for this commit and start a pull request**
15+
5. Open a pull request
16+
17+
> Once you have created your pull request, I will move over there to discuss next steps.
18+
19+
<hr>
20+
<h3 align="center">Look for my next response in your pull request.</h3>

responses/01r_wrong-source.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ You can merge<sup>[:book:](https://help.github.com/articles/github-glossary/#mer
44

55
### :keyboard: Activity: Merge your pull request
66

7-
1. Click **Merge pull request** below
8-
1. Click **Confirm merge**
9-
1. Click **Delete branch**
7+
1. Click **Merge pull request** below.
8+
1. Click **Confirm merge**.
9+
1. Click **Delete branch**.
1010

1111
<hr>
12-
<h3 align="center">Watch below for my response</h3>
12+
<h3 align="center">Watch below for my response.</h3>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ For example, if you type `closes #2` in your pull request description, the open
88
If you would like assistance troubleshooting the issue you are encountering, create a post on the [GitHub Community]({{ communityBoard }}) board. You might also want to search for your issue to see if other people have resolved it in the past.
99

1010
<hr>
11-
<h3 align="center">Check below for next steps</h3>
11+
<h3 align="center">Check below for next steps.</h3>

responses/02_update-index.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

responses/02r_wrong-file-updated.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

responses/03_add-a-theme.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

responses/03_change-theme.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Step 4: Customize Site Details
2+
3+
Great work! You can see your published page [here]({{ deploymentUrl }}). If you don't see your changes right away, refresh the page.
4+
5+
### Getting your page blog ready
6+
7+
Jekyll uses a file titled `_config.yml` to store settings for your site, a your theme and reusable content like your site title and GitHub handle.
8+
9+
You can check out the `_config.yml` file on the **Code** tab of your repository.
10+
11+
### :keyboard: Activity: Modify the config file
12+
13+
Let's change the `_config.yml` so it's a perfect fit for your new blog. First, we need to use a blog-ready theme. For this activity, we will use a theme named `jekyll-theme-minimal`.
14+
15+
1. Navigate to the **Code** tab of this repository, and browse to the `_config.yml` file, or click this link [here]({{ repoUrl }}/blob/master/_config.yml).
16+
2. In the upper right corner, click :pencil2: to open the file editor.
17+
3. Add a `theme:` set to **jekyll-theme-minimal** so it shows in the `_config.yml` file as below:
18+
```
19+
theme: jekyll-theme-minimal
20+
```
21+
4. Modify the other configuration variables such as `title:`, `author:`, and `description:` to customize your site.
22+
5. Click **Create a new branch for this commit and start a pull request**.
23+
6. Open a pull request.
24+
25+
<hr>
26+
<h3 align="center">Look for my next response in your pull request.</h3>

0 commit comments

Comments
 (0)