Skip to content

Commit 75db0c6

Browse files
Update to 4 in STEP and README.md
1 parent cc37aaa commit 75db0c6

File tree

2 files changed

+35
-12
lines changed

2 files changed

+35
-12
lines changed

.github/steps/-step.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3
1+
4

README.md

+34-11
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,48 @@ _Create a site or blog from your GitHub repositories with GitHub Pages._
1414
</header>
1515

1616
<!--
17-
<<< Author notes: Step 3 >>>
17+
<<< Author notes: Step 4 >>>
1818
Start this step by acknowledging the previous step.
1919
Define terms and link to docs.github.com.
20-
Historic note: previous version checked the homepage content was not empty.
20+
Historic note: previous version checked the file path. Previous version checked the front matter formatting.
2121
-->
2222

23-
## Step 3: Customize your homepage
23+
## Step 4: Create a blog post
2424

25-
_Nice work setting the theme! :sparkles:_
25+
_Your home page is looking great! :cowboy_hat_face:_
2626

27-
You can customize your homepage by adding content to either an `index.md` file or the `README.md` file. GitHub Pages first looks for an `index.md` file. Your repository has an `index.md` file so we can update it to include your personalized content.
27+
GitHub Pages uses Jekyll. In Jekyll, we can create a blog by using specially named files and frontmatter. The files must be named `_posts/YYYY-MM-DD-title.md`. You must also include `title` and `date` in your frontmatter.
2828

29-
### :keyboard: Activity: Create your homepage
29+
**What is _frontmatter_?**: The syntax Jekyll files use is called YAML frontmatter. It goes at the top of your file and looks something like this:
3030

31-
1. Browse to the `index.md` file in the `my-pages` branch.
32-
1. In the upper right corner, open the file editor.
33-
1. Type the content you want on your homepage. You can use Markdown formatting on this page.
34-
1. (optional) You can also modify `title:` or just ignore it for now. We'll discuss it in the next step.
35-
1. Commit your changes to the `my-pages` branch.
31+
```yml
32+
---
33+
title: "Welcome to my blog"
34+
date: 2019-01-20
35+
---
36+
```
37+
38+
For more information about configuring front matter, see the [Jekyll frontmatter documentation](https://jekyllrb.com/docs/frontmatter/).
39+
40+
### :keyboard: Activity: Create a blog post
41+
42+
1. Browse to the `my-pages` branch.
43+
1. Click the `Add file` dropdown menu and then on `Create new file`.
44+
1. Name the file `_posts/YYYY-MM-DD-title.md`.
45+
1. Replace the `YYYY-MM-DD` with today's date, and change the `title` of your first blog post if you'd like.
46+
> If you do edit the title, make sure there are hyphens between your words.
47+
> If your blog post date doesn't follow the correct date convention, you'll receive an error and your site won't build. For more information, see "[Page build failed: Invalid post date](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/troubleshooting-jekyll-build-errors-for-github-pages-sites)".
48+
1. Type the following content at the top of your blog post:
49+
```yaml
50+
---
51+
title: "YOUR-TITLE"
52+
date: YYYY-MM-DD
53+
---
54+
```
55+
1. Replace `YOUR-TITLE` with the title for your blog post.
56+
1. Replace `YYYY-MM-DD` with today's date.
57+
1. Type a quick draft of your blog post. Remember, you can always edit it later.
58+
1. Commit your changes to your branch.
3659
1. Wait about 20 seconds then refresh this page (the one you're following instructions from). [GitHub Actions](https://docs.github.com/en/actions) will automatically update to the next step.
3760

3861
<footer>

0 commit comments

Comments
 (0)