jekyll-notion-cms 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,371 @@
1
+ # Examples & Configuration Reference
2
+
3
+ This document provides detailed examples and configuration reference for jekyll-notion-cms.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Examples](#examples)
8
+ - [Projects Database](#projects-database)
9
+ - [Services Database](#services-database)
10
+ - [Testimonials Database](#testimonials-database)
11
+ - [Skills Database](#skills-database)
12
+ - [Configuration Reference](#configuration-reference)
13
+ - [Collection Options](#collection-options)
14
+ - [Organizer Types](#organizer-types)
15
+ - [Property Types](#property-types)
16
+ - [Property Configuration](#property-configuration)
17
+
18
+ ---
19
+
20
+ ## Examples
21
+
22
+ ### Projects Database
23
+
24
+ Perfect for portfolios and case studies.
25
+
26
+ **Notion Database Structure:**
27
+
28
+ | Property | Type | Description |
29
+ |----------|------|-------------|
30
+ | Name | Title | Project name |
31
+ | Description | Rich text | Project description |
32
+ | Image | Files | Cover image |
33
+ | Tags | Multi-select | Technologies used |
34
+ | URL | URL | Live project link |
35
+ | GitHub | URL | Repository link |
36
+ | Featured | Checkbox | Show on homepage |
37
+ | Order | Number | Display order |
38
+
39
+ **Configuration:**
40
+
41
+ ```yaml
42
+ notion:
43
+ collections:
44
+ projects:
45
+ database_env: NOTION_PROJECTS_DB
46
+ data_file: notion_projects.yml
47
+ organizer: simple_list
48
+ sort_by: order
49
+ properties:
50
+ - { name: Name, type: title }
51
+ - { name: Description, type: rich_text }
52
+ - { name: Image, type: files }
53
+ - { name: Tags, type: multi_select }
54
+ - { name: URL, type: url }
55
+ - { name: GitHub, type: url, key: github_url }
56
+ - { name: Featured, type: checkbox }
57
+ - { name: Order, type: number }
58
+ ```
59
+
60
+ **Template Usage:**
61
+
62
+ ```liquid
63
+ {% for project in site.data.notion_projects %}
64
+ {% if project.featured %}
65
+ <article class="project-card">
66
+ {% if project.image.first %}
67
+ <img src="{{ project.image.first.url }}" alt="{{ project.title }}" />
68
+ {% endif %}
69
+ <h3>{{ project.title }}</h3>
70
+ <p>{{ project.description }}</p>
71
+ <div class="tags">
72
+ {% for tag in project.tags %}
73
+ <span class="tag">{{ tag }}</span>
74
+ {% endfor %}
75
+ </div>
76
+ <div class="links">
77
+ {% if project.url %}<a href="{{ project.url }}">View Project</a>{% endif %}
78
+ {% if project.github_url %}<a href="{{ project.github_url }}">GitHub</a>{% endif %}
79
+ </div>
80
+ </article>
81
+ {% endif %}
82
+ {% endfor %}
83
+ ```
84
+
85
+ ---
86
+
87
+ ### Services Database
88
+
89
+ Ideal for freelancers and agencies.
90
+
91
+ **Notion Database Structure:**
92
+
93
+ | Property | Type | Description |
94
+ |----------|------|-------------|
95
+ | Name | Title | Service name |
96
+ | Description | Rich text | Service description |
97
+ | Icon | Select | Icon identifier (e.g., "code", "design") |
98
+ | Price | Rich text | Pricing information |
99
+ | Features | Rich text | Key features (bullet points) |
100
+ | Category | Select | Service category |
101
+ | Order | Number | Display order |
102
+
103
+ **Configuration:**
104
+
105
+ ```yaml
106
+ notion:
107
+ collections:
108
+ services:
109
+ database_env: NOTION_SERVICES_DB
110
+ data_file: notion_services.yml
111
+ organizer: grouped_by
112
+ group_by: category
113
+ sort_by: order
114
+ properties:
115
+ - { name: Name, type: title }
116
+ - { name: Description, type: rich_text }
117
+ - { name: Icon, type: select }
118
+ - { name: Price, type: rich_text }
119
+ - { name: Features, type: rich_text }
120
+ - { name: Category, type: select }
121
+ - { name: Order, type: number }
122
+ ```
123
+
124
+ **Template Usage:**
125
+
126
+ ```liquid
127
+ {% for category in site.data.notion_services %}
128
+ <section class="service-category">
129
+ <h2>{{ category[0] }}</h2>
130
+ {% for service in category[1] %}
131
+ <div class="service-card">
132
+ <i class="icon-{{ service.icon }}"></i>
133
+ <h3>{{ service.title }}</h3>
134
+ <p>{{ service.description }}</p>
135
+ <p class="price">{{ service.price }}</p>
136
+ </div>
137
+ {% endfor %}
138
+ </section>
139
+ {% endfor %}
140
+ ```
141
+
142
+ ---
143
+
144
+ ### Testimonials Database
145
+
146
+ Build trust with client testimonials.
147
+
148
+ **Notion Database Structure:**
149
+
150
+ | Property | Type | Description |
151
+ |----------|------|-------------|
152
+ | Quote | Title | Testimonial text |
153
+ | Author | Rich text | Client name |
154
+ | Role | Rich text | Client's job title |
155
+ | Company | Rich text | Client's company |
156
+ | Avatar | Files | Client photo |
157
+ | Rating | Number | Star rating (1-5) |
158
+ | Featured | Checkbox | Show on homepage |
159
+ | Date | Date | Testimonial date |
160
+
161
+ **Configuration:**
162
+
163
+ ```yaml
164
+ notion:
165
+ collections:
166
+ testimonials:
167
+ database_env: NOTION_TESTIMONIALS_DB
168
+ data_file: notion_testimonials.yml
169
+ organizer: simple_list
170
+ sort_by: date
171
+ sort_order: desc
172
+ properties:
173
+ - { name: Quote, type: title }
174
+ - { name: Author, type: rich_text }
175
+ - { name: Role, type: rich_text }
176
+ - { name: Company, type: rich_text }
177
+ - { name: Avatar, type: files }
178
+ - { name: Rating, type: number }
179
+ - { name: Featured, type: checkbox }
180
+ - { name: Date, type: date }
181
+ ```
182
+
183
+ **Template Usage:**
184
+
185
+ ```liquid
186
+ <section class="testimonials">
187
+ {% for testimonial in site.data.notion_testimonials %}
188
+ {% if testimonial.featured %}
189
+ <blockquote class="testimonial">
190
+ <div class="stars">
191
+ {% for i in (1..testimonial.rating) %}
192
+ <span class="star">★</span>
193
+ {% endfor %}
194
+ </div>
195
+ <p>"{{ testimonial.title }}"</p>
196
+ <footer>
197
+ {% if testimonial.avatar.first %}
198
+ <img src="{{ testimonial.avatar.first.url }}" alt="{{ testimonial.author }}" class="avatar" />
199
+ {% endif %}
200
+ <cite>
201
+ <strong>{{ testimonial.author }}</strong>
202
+ <span>{{ testimonial.role }}, {{ testimonial.company }}</span>
203
+ </cite>
204
+ </footer>
205
+ </blockquote>
206
+ {% endif %}
207
+ {% endfor %}
208
+ </section>
209
+ ```
210
+
211
+ ---
212
+
213
+ ### Skills Database
214
+
215
+ Showcase your technical expertise.
216
+
217
+ **Notion Database Structure:**
218
+
219
+ | Property | Type | Description |
220
+ |----------|------|-------------|
221
+ | Name | Title | Skill name |
222
+ | Category | Select | Skill category (Backend, Frontend, etc.) |
223
+ | Level | Select/Number | Proficiency level |
224
+ | Icon | Rich text | Icon class or URL |
225
+ | Years | Number | Years of experience |
226
+ | Order | Number | Display order within category |
227
+
228
+ **Configuration:**
229
+
230
+ ```yaml
231
+ notion:
232
+ collections:
233
+ skills:
234
+ database_env: NOTION_SKILLS_DB
235
+ data_file: notion_skills.yml
236
+ organizer: items_by_category
237
+ properties:
238
+ - { name: Name, type: title }
239
+ - { name: Category, type: rollup }
240
+ - { name: Level, type: number }
241
+ - { name: Icon, type: rich_text }
242
+ - { name: Years, type: number }
243
+ - { name: Order, type: number }
244
+ - { name: Category Icon, type: rollup, key: category_icon }
245
+ - { name: Category Order, type: rollup, key: category_order }
246
+ ```
247
+
248
+ **Template Usage:**
249
+
250
+ ```liquid
251
+ {% for category in site.data.notion_skills %}
252
+ <section class="skill-category">
253
+ <h3>
254
+ <i class="{{ category[1].icon }}"></i>
255
+ {{ category[1].title }}
256
+ </h3>
257
+ <div class="skills-grid">
258
+ {% for item in category[1].items %}
259
+ <div class="skill">
260
+ <span class="skill-name">{{ item.name }}</span>
261
+ <div class="skill-bar">
262
+ <div class="skill-level" style="width: {{ item.level }}%"></div>
263
+ </div>
264
+ <span class="skill-years">{{ item.years }} years</span>
265
+ </div>
266
+ {% endfor %}
267
+ </div>
268
+ </section>
269
+ {% endfor %}
270
+ ```
271
+
272
+ ---
273
+
274
+ ## Configuration Reference
275
+
276
+ ### Collection Options
277
+
278
+ | Option | Type | Required | Description |
279
+ |--------|------|----------|-------------|
280
+ | `database_env` | String | Yes | Environment variable containing the Notion database ID |
281
+ | `data_file` | String | Yes | Output filename in `_data/` directory |
282
+ | `organizer` | String | No | Data organization method (default: `simple_list`) |
283
+ | `sort_by` | String | No | Property key to sort by |
284
+ | `sort_order` | String | No | `asc` (default) or `desc` |
285
+ | `group_by` | String | No | Field to group by (for `grouped_by` organizer) |
286
+ | `properties` | Array | Yes | Property mapping configuration |
287
+
288
+ ### Organizer Types
289
+
290
+ #### `simple_list` (default)
291
+
292
+ Returns an array of items sorted by the specified field.
293
+
294
+ ```yaml
295
+ organizer: simple_list
296
+ sort_by: order
297
+ sort_order: asc
298
+ ```
299
+
300
+ #### `items_by_category`
301
+
302
+ Groups items by their category. Useful for skills, products, team members, or any categorized content.
303
+
304
+ ```yaml
305
+ organizer: items_by_category
306
+ ```
307
+
308
+ Output structure:
309
+ ```yaml
310
+ Backend:
311
+ title: Backend
312
+ icon: code
313
+ order: 1
314
+ items:
315
+ - name: Ruby
316
+ level: 90
317
+ years: 10
318
+ ```
319
+
320
+ #### `grouped_by`
321
+
322
+ Groups items by a specified field.
323
+
324
+ ```yaml
325
+ organizer: grouped_by
326
+ group_by: category
327
+ sort_by: order
328
+ ```
329
+
330
+ #### `nested`
331
+
332
+ Creates a hierarchical tree structure based on parent-child relationships.
333
+
334
+ ```yaml
335
+ organizer: nested
336
+ parent_field: parent_id
337
+ sort_by: order
338
+ ```
339
+
340
+ ### Property Types
341
+
342
+ | Type | Notion Property | Output |
343
+ |------|-----------------|--------|
344
+ | `title` | Title | String |
345
+ | `rich_text` | Rich text, Text | String |
346
+ | `number` | Number | Integer/Float |
347
+ | `checkbox` | Checkbox | Boolean |
348
+ | `date` | Date | Hash with `start`, `end`, `time_zone` |
349
+ | `select` | Select | String |
350
+ | `multi_select` | Multi-select | Array of strings |
351
+ | `url` | URL | String |
352
+ | `email` | Email | String |
353
+ | `phone_number` | Phone | String |
354
+ | `files` | Files & media | Array of file objects |
355
+ | `rollup` | Rollup | Value from related database |
356
+ | `formula` | Formula | Computed value |
357
+ | `formula_array` | Formula (array) | Array of values |
358
+ | `relation` | Relation | Array of page IDs |
359
+ | `people` | Person | Array of user objects |
360
+ | `status` | Status | String |
361
+ | `created_time` | Created time | ISO timestamp |
362
+ | `last_edited_time` | Last edited | ISO timestamp |
363
+
364
+ ### Property Configuration
365
+
366
+ ```yaml
367
+ properties:
368
+ - name: "Property Name" # Name in Notion (required)
369
+ type: rich_text # Property type (required)
370
+ key: custom_key # Output key (optional, defaults to snake_case)
371
+ ```