jekyll-theme-zer0 0.15.0 β 0.16.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +84 -0
- data/README.md +56 -24
- data/_data/README.md +419 -17
- data/_data/generate_statistics.rb +216 -9
- data/_data/generate_statistics.sh +106 -0
- data/_data/github-actions-example.yml +210 -0
- data/_data/navigation/quickstart.yml +11 -3
- data/_data/posts_organization.yml +153 -0
- data/_data/prerequisites.yml +112 -0
- data/_data/statistics_config.yml +203 -0
- data/_data/ui-text.yml +321 -0
- data/_data/update_statistics.sh +126 -0
- data/_includes/components/preview-image.html +20 -3
- data/_includes/content/intro.html +15 -6
- data/_includes/content/seo.html +12 -1
- data/_layouts/notebook.html +3 -3
- data/_plugins/preview_image_generator.rb +29 -8
- data/assets/images/previews/site-personalization-configuration.png +0 -0
- data/scripts/README.md +11 -1
- data/scripts/lib/changelog.sh +89 -57
- data/scripts/lib/preview_generator.py +164 -8
- data/scripts/test/lib/run_tests.sh +1 -2
- data/scripts/update-preview-paths.sh +145 -0
- metadata +11 -2
data/_data/README.md
CHANGED
|
@@ -1,31 +1,433 @@
|
|
|
1
|
-
|
|
1
|
+
# π Zer0-Mistakes Data Directory
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This directory contains YAML data files that power the Zer0-Mistakes Jekyll theme's dynamic features, including navigation, content statistics, internationalization, and content organization.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## π Directory Contents
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
| File | Purpose | Auto-Generated |
|
|
8
|
+
|------|---------|----------------|
|
|
9
|
+
| `navigation/` | Site navigation menus | No |
|
|
10
|
+
| `authors.yml` | Author profile information | No |
|
|
11
|
+
| `content_statistics.yml` | Site content analytics | **Yes** |
|
|
12
|
+
| `statistics_config.yml` | Statistics generation config | No |
|
|
13
|
+
| `ui-text.yml` | Multilingual UI text labels | No |
|
|
14
|
+
| `prerequisites.yml` | Educational prerequisites | No |
|
|
15
|
+
| `posts_organization.yml` | Post section mappings | No |
|
|
16
|
+
| `generate_statistics.rb` | Statistics generator script | No |
|
|
17
|
+
| `generate_statistics.sh` | Bash wrapper script | No |
|
|
18
|
+
| `update_statistics.sh` | CI/CD automation script | No |
|
|
19
|
+
| `github-actions-example.yml` | Example workflow | No |
|
|
8
20
|
|
|
9
|
-
|
|
21
|
+
---
|
|
10
22
|
|
|
11
|
-
|
|
23
|
+
## π Navigation
|
|
12
24
|
|
|
13
|
-
|
|
25
|
+
### `navigation/`
|
|
14
26
|
|
|
15
|
-
|
|
27
|
+
Contains YAML files for site navigation menus (sidebar, header, footer).
|
|
16
28
|
|
|
17
|
-
|
|
29
|
+
**Example structure:**
|
|
30
|
+
```yaml
|
|
31
|
+
# navigation/main.yml
|
|
32
|
+
- title: Home
|
|
33
|
+
url: /
|
|
34
|
+
icon: bi-house
|
|
35
|
+
- title: Documentation
|
|
36
|
+
url: /docs/
|
|
37
|
+
icon: bi-book
|
|
38
|
+
children:
|
|
39
|
+
- title: Getting Started
|
|
40
|
+
url: /docs/getting-started/
|
|
41
|
+
```
|
|
18
42
|
|
|
19
|
-
|
|
43
|
+
---
|
|
20
44
|
|
|
21
|
-
|
|
45
|
+
## π€ Authors
|
|
22
46
|
|
|
23
|
-
|
|
47
|
+
### `authors.yml`
|
|
24
48
|
|
|
25
|
-
|
|
49
|
+
Defines author profiles for multi-author sites.
|
|
26
50
|
|
|
27
|
-
|
|
51
|
+
**Structure:**
|
|
52
|
+
```yaml
|
|
53
|
+
john_doe:
|
|
54
|
+
name: "John Doe"
|
|
55
|
+
bio: "Senior Developer and Technical Writer"
|
|
56
|
+
avatar: /assets/images/authors/john.jpg
|
|
57
|
+
email: john@example.com
|
|
58
|
+
twitter: johndoe
|
|
59
|
+
github: johndoe
|
|
60
|
+
website: https://johndoe.dev
|
|
61
|
+
```
|
|
28
62
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
63
|
+
**Usage in posts:**
|
|
64
|
+
```yaml
|
|
65
|
+
---
|
|
66
|
+
author: john_doe
|
|
67
|
+
---
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## π Content Statistics
|
|
73
|
+
|
|
74
|
+
### `content_statistics.yml` β‘ *Auto-Generated*
|
|
75
|
+
|
|
76
|
+
Contains computed statistics about site content. **Do not edit manually** - this file is regenerated by `generate_statistics.rb`.
|
|
77
|
+
|
|
78
|
+
**Generated metrics:**
|
|
79
|
+
- `total_posts`: Total number of posts
|
|
80
|
+
- `published`: Published posts count
|
|
81
|
+
- `drafts`: Draft posts count
|
|
82
|
+
- `categories`: Posts per category
|
|
83
|
+
- `category_count`: Total unique categories
|
|
84
|
+
- `tags`: Posts per tag
|
|
85
|
+
- `tag_count`: Total unique tags
|
|
86
|
+
- `focus_areas`: Content by focus area (DevOps, Frontend, etc.)
|
|
87
|
+
- `skill_levels`: Content by difficulty level
|
|
88
|
+
- `content_types`: Content by type (tutorial, guide, etc.)
|
|
89
|
+
- `authors`: Posts per author
|
|
90
|
+
- `content_freshness`: Age distribution of content
|
|
91
|
+
- `date_range`: Earliest and latest post dates
|
|
92
|
+
- `derived_stats`: Calculated averages and insights
|
|
93
|
+
- `generated_at`: Timestamp of generation
|
|
94
|
+
|
|
95
|
+
**Accessing in templates:**
|
|
96
|
+
```liquid
|
|
97
|
+
{% assign stats = site.data.content_statistics %}
|
|
98
|
+
<p>Total posts: {{ stats.total_posts }}</p>
|
|
99
|
+
<p>Most posts in: {{ stats.derived_stats.most_common_category }}</p>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### `statistics_config.yml`
|
|
103
|
+
|
|
104
|
+
Configuration for the statistics generator. Defines keyword mappings for content analysis.
|
|
105
|
+
|
|
106
|
+
**Sections:**
|
|
107
|
+
```yaml
|
|
108
|
+
# Focus area detection keywords
|
|
109
|
+
focus_areas:
|
|
110
|
+
devops: [docker, kubernetes, ci/cd, jenkins, terraform]
|
|
111
|
+
frontend: [javascript, react, vue, css, html]
|
|
112
|
+
backend: [python, node, api, database, sql]
|
|
113
|
+
# ... more areas
|
|
114
|
+
|
|
115
|
+
# Skill level detection
|
|
116
|
+
skill_levels:
|
|
117
|
+
beginner: [introduction, basics, getting started, 101]
|
|
118
|
+
intermediate: [advanced basics, building, implementing]
|
|
119
|
+
advanced: [optimization, architecture, scaling]
|
|
120
|
+
expert: [mastering, deep dive, internals]
|
|
121
|
+
|
|
122
|
+
# Content type detection
|
|
123
|
+
content_types:
|
|
124
|
+
tutorial: [tutorial, how-to, step-by-step, walkthrough]
|
|
125
|
+
guide: [guide, handbook, manual, reference]
|
|
126
|
+
# ... more types
|
|
127
|
+
|
|
128
|
+
# Display preferences
|
|
129
|
+
display:
|
|
130
|
+
top_categories: 10
|
|
131
|
+
top_tags: 20
|
|
132
|
+
top_focus_areas: 8
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## π§ Statistics Scripts
|
|
138
|
+
|
|
139
|
+
### `generate_statistics.rb`
|
|
140
|
+
|
|
141
|
+
Ruby script that analyzes site content and generates `content_statistics.yml`.
|
|
142
|
+
|
|
143
|
+
**Usage:**
|
|
144
|
+
```bash
|
|
145
|
+
# Direct execution
|
|
146
|
+
ruby _data/generate_statistics.rb
|
|
147
|
+
|
|
148
|
+
# Via wrapper script
|
|
149
|
+
bash _data/generate_statistics.sh
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Features:**
|
|
153
|
+
- Front matter parsing
|
|
154
|
+
- Category and tag analysis
|
|
155
|
+
- Focus area detection (via keywords)
|
|
156
|
+
- Skill level classification
|
|
157
|
+
- Content freshness calculation
|
|
158
|
+
- Author statistics
|
|
159
|
+
- Derived metrics computation
|
|
160
|
+
|
|
161
|
+
### `generate_statistics.sh`
|
|
162
|
+
|
|
163
|
+
Bash wrapper script for statistics generation with validation and preview.
|
|
164
|
+
|
|
165
|
+
**Usage:**
|
|
166
|
+
```bash
|
|
167
|
+
# Generate statistics
|
|
168
|
+
./generate_statistics.sh
|
|
169
|
+
|
|
170
|
+
# Preview output (requires yq)
|
|
171
|
+
./generate_statistics.sh --preview
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Features:**
|
|
175
|
+
- Ruby availability check
|
|
176
|
+
- Configuration file validation
|
|
177
|
+
- Content directory verification
|
|
178
|
+
- Color-coded output
|
|
179
|
+
- Optional preview with yq
|
|
180
|
+
|
|
181
|
+
### `update_statistics.sh`
|
|
182
|
+
|
|
183
|
+
CI/CD automation script for running statistics updates in pipelines.
|
|
184
|
+
|
|
185
|
+
**Environment Variables:**
|
|
186
|
+
```bash
|
|
187
|
+
CI=true # Indicates CI environment
|
|
188
|
+
AUTO_PUSH=true # Auto-commit and push changes
|
|
189
|
+
FORCE_UPDATE=true # Skip hash comparison
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Features:**
|
|
193
|
+
- CI environment detection
|
|
194
|
+
- Hash-based change detection
|
|
195
|
+
- Automatic git commit/push
|
|
196
|
+
- Skip unchanged content
|
|
197
|
+
- Detailed logging
|
|
198
|
+
|
|
199
|
+
### `github-actions-example.yml`
|
|
200
|
+
|
|
201
|
+
Example GitHub Actions workflow for automated statistics updates.
|
|
202
|
+
|
|
203
|
+
**Copy to `.github/workflows/update-statistics.yml` to enable.**
|
|
204
|
+
|
|
205
|
+
**Triggers:**
|
|
206
|
+
- Push to `pages/_posts/**`, `pages/_docs/**`, `_data/statistics_config.yml`
|
|
207
|
+
- Manual workflow_dispatch with options
|
|
208
|
+
- Weekly schedule (Monday 6 AM UTC)
|
|
209
|
+
|
|
210
|
+
**Workflow Options:**
|
|
211
|
+
- `force_update`: Update even if no changes detected
|
|
212
|
+
- `skip_push`: Generate but don't commit
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## π Internationalization (i18n)
|
|
217
|
+
|
|
218
|
+
### `ui-text.yml`
|
|
219
|
+
|
|
220
|
+
Multilingual UI text labels for theme components.
|
|
221
|
+
|
|
222
|
+
**Supported Languages:**
|
|
223
|
+
- `en` - English (default)
|
|
224
|
+
- `es` - Spanish
|
|
225
|
+
- `fr` - French
|
|
226
|
+
- `de` - German
|
|
227
|
+
- `ar` - Arabic (RTL)
|
|
228
|
+
|
|
229
|
+
**Structure:**
|
|
230
|
+
```yaml
|
|
231
|
+
en:
|
|
232
|
+
# Navigation
|
|
233
|
+
skip_links: "Skip to main content"
|
|
234
|
+
menu_label: "Menu"
|
|
235
|
+
search_label: "Search"
|
|
236
|
+
|
|
237
|
+
# Content
|
|
238
|
+
read_more: "Read more"
|
|
239
|
+
table_of_contents: "Table of Contents"
|
|
240
|
+
|
|
241
|
+
# Statistics
|
|
242
|
+
stats_total_posts: "Total Posts"
|
|
243
|
+
stats_published: "Published"
|
|
244
|
+
# ... more labels
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
**Usage in templates:**
|
|
248
|
+
```liquid
|
|
249
|
+
{% assign ui = site.data.ui-text[site.lang | default: 'en'] %}
|
|
250
|
+
<span>{{ ui.read_more }}</span>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## π Educational Content
|
|
256
|
+
|
|
257
|
+
### `prerequisites.yml`
|
|
258
|
+
|
|
259
|
+
Defines prerequisites for tutorials and educational content.
|
|
260
|
+
|
|
261
|
+
**Structure:**
|
|
262
|
+
```yaml
|
|
263
|
+
- id: git-basics
|
|
264
|
+
title: "Git Version Control Basics"
|
|
265
|
+
description: "Understanding commits, branches, and basic git workflow"
|
|
266
|
+
level: beginner
|
|
267
|
+
category: version-control
|
|
268
|
+
|
|
269
|
+
- id: docker-fundamentals
|
|
270
|
+
title: "Docker Container Fundamentals"
|
|
271
|
+
description: "Understanding containers, images, and Docker CLI"
|
|
272
|
+
level: intermediate
|
|
273
|
+
category: devops
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
**Usage in post front matter:**
|
|
277
|
+
```yaml
|
|
278
|
+
---
|
|
279
|
+
prerequisites:
|
|
280
|
+
- git-basics
|
|
281
|
+
- docker-fundamentals
|
|
282
|
+
---
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
**Usage in templates:**
|
|
286
|
+
```liquid
|
|
287
|
+
{% if page.prerequisites %}
|
|
288
|
+
<div class="prerequisites">
|
|
289
|
+
<h4>Prerequisites</h4>
|
|
290
|
+
<ul>
|
|
291
|
+
{% for prereq_id in page.prerequisites %}
|
|
292
|
+
{% assign prereq = site.data.prerequisites | where: "id", prereq_id | first %}
|
|
293
|
+
<li>{{ prereq.title }} - {{ prereq.description }}</li>
|
|
294
|
+
{% endfor %}
|
|
295
|
+
</ul>
|
|
296
|
+
</div>
|
|
297
|
+
{% endif %}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## π Post Organization
|
|
303
|
+
|
|
304
|
+
### `posts_organization.yml`
|
|
305
|
+
|
|
306
|
+
Configuration for post section mappings and URL patterns.
|
|
307
|
+
|
|
308
|
+
**Sections:**
|
|
309
|
+
```yaml
|
|
310
|
+
sections:
|
|
311
|
+
- id: ai-machine-learning
|
|
312
|
+
title: "AI & Machine Learning"
|
|
313
|
+
directory: "pages/_posts/ai & machine learning"
|
|
314
|
+
icon: "bi-robot"
|
|
315
|
+
color: "#8B5CF6"
|
|
316
|
+
description: "Artificial intelligence, ML models, and data science"
|
|
317
|
+
aliases: ["ai", "ml", "machine-learning", "artificial-intelligence"]
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
**Category to Section Mapping:**
|
|
321
|
+
```yaml
|
|
322
|
+
category_to_section:
|
|
323
|
+
"ai & machine learning": ai-machine-learning
|
|
324
|
+
"artificial intelligence": ai-machine-learning
|
|
325
|
+
"devops": devops
|
|
326
|
+
"docker": devops
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
**URL Pattern:**
|
|
330
|
+
```yaml
|
|
331
|
+
url_pattern: "/:categories/:year/:month/:day/:title/"
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## π Automation Workflows
|
|
337
|
+
|
|
338
|
+
### Setting Up Automated Statistics
|
|
339
|
+
|
|
340
|
+
1. **Copy the workflow file:**
|
|
341
|
+
```bash
|
|
342
|
+
cp _data/github-actions-example.yml .github/workflows/update-statistics.yml
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
2. **Ensure scripts are executable:**
|
|
346
|
+
```bash
|
|
347
|
+
chmod +x _data/generate_statistics.sh
|
|
348
|
+
chmod +x _data/update_statistics.sh
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
3. **Customize triggers** in the workflow file as needed.
|
|
352
|
+
|
|
353
|
+
4. **Push to main branch** to enable the workflow.
|
|
354
|
+
|
|
355
|
+
### Manual Statistics Update
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
# From repository root
|
|
359
|
+
cd _data
|
|
360
|
+
ruby generate_statistics.rb
|
|
361
|
+
|
|
362
|
+
# Or using the wrapper
|
|
363
|
+
bash generate_statistics.sh
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## π οΈ Customization
|
|
369
|
+
|
|
370
|
+
### Adding New Focus Areas
|
|
371
|
+
|
|
372
|
+
Edit `statistics_config.yml`:
|
|
373
|
+
```yaml
|
|
374
|
+
focus_areas:
|
|
375
|
+
my_new_area:
|
|
376
|
+
- keyword1
|
|
377
|
+
- keyword2
|
|
378
|
+
- keyword3
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
### Adding New Languages
|
|
382
|
+
|
|
383
|
+
Add a new language block to `ui-text.yml`:
|
|
384
|
+
```yaml
|
|
385
|
+
ja: # Japanese
|
|
386
|
+
skip_links: "γ‘γ€γ³γ³γ³γγ³γγΈγΉγγγ"
|
|
387
|
+
menu_label: "γ‘γγ₯γΌ"
|
|
388
|
+
# ... translate all labels
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
### Adding New Prerequisites
|
|
392
|
+
|
|
393
|
+
Edit `prerequisites.yml`:
|
|
394
|
+
```yaml
|
|
395
|
+
- id: my-prerequisite
|
|
396
|
+
title: "My New Prerequisite"
|
|
397
|
+
description: "Description of what this covers"
|
|
398
|
+
level: beginner # beginner|intermediate|advanced|expert
|
|
399
|
+
category: my-category
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
---
|
|
403
|
+
|
|
404
|
+
## π Best Practices
|
|
405
|
+
|
|
406
|
+
1. **Never edit `content_statistics.yml` manually** - it will be overwritten
|
|
407
|
+
2. **Keep `statistics_config.yml` updated** when adding new content types
|
|
408
|
+
3. **Test configuration changes locally** before pushing
|
|
409
|
+
4. **Use consistent language codes** in `ui-text.yml`
|
|
410
|
+
5. **Keep prerequisite IDs kebab-case** for URL friendliness
|
|
411
|
+
6. **Validate YAML syntax** before committing:
|
|
412
|
+
```bash
|
|
413
|
+
ruby -ryaml -e "YAML.load_file('_data/your-file.yml')"
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
## π€ Contributing
|
|
419
|
+
|
|
420
|
+
When modifying data files:
|
|
421
|
+
|
|
422
|
+
1. Follow existing YAML formatting conventions
|
|
423
|
+
2. Test changes locally with `bundle exec jekyll serve`
|
|
424
|
+
3. Run statistics generation to verify no errors
|
|
425
|
+
4. Update this README if adding new files or features
|
|
426
|
+
|
|
427
|
+
See [CONTRIBUTING.md](../CONTRIBUTING.md) for full guidelines.
|
|
428
|
+
|
|
429
|
+
---
|
|
430
|
+
|
|
431
|
+
## π License
|
|
432
|
+
|
|
433
|
+
This project is licensed under the MIT License - see the [LICENSE](../LICENSE) file for details.
|