Skip to content

Commit a43c08d

Browse files
committed
defining the collection section 1
1 parent 8abb786 commit a43c08d

File tree

2 files changed

+64
-15
lines changed

2 files changed

+64
-15
lines changed

_jekyll4fun/5_custom_collections.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ In this next section, we're going to add a custom collection for holding all the
2222
notes your going to capture at Connect Tech. Then we will build an index page
2323
that lists all your notes for easy reference.
2424

25+
Goal: Rather than flood your new blog site with individual entries for all
26+
the talks you attend at Connect.tech. Use a collection to hold individual entries
27+
and provide your readers with a succinct listing of events you attended.
28+
2529
Features of Jekyll Covered:
2630

2731
* How to define a collection

_jekyll4fun/6_defining_your_collection.md

Lines changed: 60 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,78 @@ title: Add a Custom Collection
33
slug: add-a-new-collection
44
chapter: 6
55
---
6-
Goal: Rather than flood your new blog site with individual entries for all
7-
the talks you attend at Connect.tech. Use a collection to hold individual entries
8-
and provide your readers with a succinct listing of events you attended.
96

107
## Step 1: Create the collection's directory
11-
Under your project root, create a folder named "_connecttech2018", the prefix
12-
underscore is important, why?
13-
Hint: How does Jekyll know what to copy to _site?
8+
Under your project root, create a folder named "_connecttech2018"
9+
and add an index file
10+
11+
```
12+
> mkdir _connecttech2018
13+
> touch index.md
14+
```
15+
<details>
16+
<summary><strong>Quiz:</strong>the prefix underscore is important, why?</summary>
17+
Indicates to Jekyll this is a file it needs to process.
18+
</details>
19+
20+
<details>
21+
<summary>Working Directly On Github?</summary>
22+
Github will not let you create an empty directory, however if you add
23+
the directory to the filename, it will be created.
24+
</details>
1425

1526

1627
## Step 2: Tell Jekyll about your Collection
1728
* Open up _config.yml
1829
* Add a new object called "collections"
1930
* Add a child to collections called "connecttech2018"
2031
* Add a property "output: true" to your connecttech2018 collection.
21-
* Restart jekyll
22-
Note: we'll talk more about defining collections in a bit
2332

33+
```yaml
34+
collections:
35+
connecttech2018:
36+
output: true
37+
```
38+
39+
<details>
40+
<summary>Working with Jekyll locally?</summary>
41+
Restart Jekyll Server. _config.yml is the one file Jekyll doesn't watch for changes
42+
</details>
2443
25-
## Step 3: Add a new file as first item
44+
## Step 3: Add Some Content
2645
27-
* create file "note1.md"
46+
* create file "_connecttech2018/jekyll-4-fun.md"
2847
* add an empty jekyll front matter
29-
* use md or html for the content body
48+
* Add text into the body.
49+
50+
```
51+
---
52+
---
53+
Learning To Rock Jekyll at Connect Tech!
54+
```
55+
## Save and Commit your changes
56+
57+
## Step 4: Test your collection.
58+
59+
* https://<yoursite>.github.io/connecttech2018/
60+
* https://<yoursite>.github.io/connecttech2018/jekyll-4-fun/
61+
62+
<strong>Explore! How does Jekyll handle?</strong>
63+
64+
<details>
65+
<summary>The layout for your index & item page?</summary>
66+
There is none! Why not?
67+
</details>
3068

31-
## Test your collection:
69+
<details>
70+
<summary>The title for the index and item page?</summary>
71+
Uses the filename.
72+
</details>
3273

33-
* Browse to yoursite/connecttech2018
34-
* What does Jekyll use when no properties define layout, title or permalink?
35-
* How does the note one look?
74+
<details>
75+
<summary>Where are files output?</summary>
76+
_site/ <br/>
77+
&nbsp;&nbsp;connecttech2018.html <br/>
78+
&nbsp;&nbsp;connecttech2018/ <br/>
79+
&nbsp;&nbsp;&nbsp;&nbsp;jekyll-4-fun.html <br/>
80+
</details>

0 commit comments

Comments
 (0)