jackdaw 1.0.0 → 1.0.2
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/.DS_Store +0 -0
- data/.rubocop.yml +1 -1
- data/lib/jackdaw/commands/new.rb +1 -1
- data/lib/jackdaw/server.rb +1 -1
- data/lib/jackdaw/version.rb +1 -1
- data/usejackdaw.com.site/.gitignore +2 -0
- data/usejackdaw.com.site/site/assets/css/style.css +242 -0
- data/usejackdaw.com.site/site/assets/favicon/android-icon-144x144.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/android-icon-192x192.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/android-icon-36x36.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/android-icon-48x48.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/android-icon-72x72.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/android-icon-96x96.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/apple-icon-114x114.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/apple-icon-120x120.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/apple-icon-144x144.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/apple-icon-152x152.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/apple-icon-180x180.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/apple-icon-57x57.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/apple-icon-60x60.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/apple-icon-72x72.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/apple-icon-76x76.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/apple-icon-precomposed.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/apple-icon.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/browserconfig.xml +2 -0
- data/usejackdaw.com.site/site/assets/favicon/favicon-16x16.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/favicon-32x32.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/favicon-96x96.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/favicon.ico +0 -0
- data/usejackdaw.com.site/site/assets/favicon/manifest.json +41 -0
- data/usejackdaw.com.site/site/assets/favicon/ms-icon-144x144.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/ms-icon-150x150.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/ms-icon-310x310.png +0 -0
- data/usejackdaw.com.site/site/assets/favicon/ms-icon-70x70.png +0 -0
- data/usejackdaw.com.site/site/assets/jackdaw.png +0 -0
- data/usejackdaw.com.site/site/assets/squawk.png +0 -0
- data/usejackdaw.com.site/site/src/blog/2026-01-06-hello-world.blog.md +9 -0
- data/usejackdaw.com.site/site/src/commands.page.md +185 -0
- data/usejackdaw.com.site/site/src/content.page.md +300 -0
- data/usejackdaw.com.site/site/src/deployment.page.md +306 -0
- data/usejackdaw.com.site/site/src/getting-started.page.md +180 -0
- data/usejackdaw.com.site/site/src/index.page.md +86 -0
- data/usejackdaw.com.site/site/src/installation.page.md +63 -0
- data/usejackdaw.com.site/site/src/templates.page.md +294 -0
- data/usejackdaw.com.site/site/templates/_footer.html.erb +12 -0
- data/usejackdaw.com.site/site/templates/_nav.html.erb +19 -0
- data/usejackdaw.com.site/site/templates/blog.html.erb +7 -0
- data/usejackdaw.com.site/site/templates/layout.html.erb +18 -0
- data/usejackdaw.com.site/site/templates/page.html.erb +5 -0
- metadata +47 -2
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Getting Started
|
|
2
|
+
|
|
3
|
+
Get your first site up and running in 5 minutes.
|
|
4
|
+
|
|
5
|
+
## Create a New Site
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
jackdaw new my-blog
|
|
9
|
+
cd my-blog.site
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
This creates a new directory with the following structure:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
my-blog.site/
|
|
16
|
+
├── site/
|
|
17
|
+
│ ├── src/ # Your content (Markdown files)
|
|
18
|
+
│ ├── templates/ # ERB templates
|
|
19
|
+
│ └── assets/ # Static files (CSS, images, JS)
|
|
20
|
+
└── public/ # Generated site (after build)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Project Structure
|
|
24
|
+
|
|
25
|
+
### Content (`site/src/`)
|
|
26
|
+
|
|
27
|
+
Write your content in Markdown:
|
|
28
|
+
|
|
29
|
+
```markdown
|
|
30
|
+
# Hello World
|
|
31
|
+
|
|
32
|
+
This is my first post!
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
File naming convention: `[date-]name.type.md`
|
|
36
|
+
|
|
37
|
+
- `index.page.md` → `/index.html`
|
|
38
|
+
- `about.page.md` → `/about.html`
|
|
39
|
+
- `2026-01-06-hello.blog.md` → `/2026-01-06-hello.html`
|
|
40
|
+
|
|
41
|
+
### Templates (`site/templates/`)
|
|
42
|
+
|
|
43
|
+
ERB templates with access to content:
|
|
44
|
+
|
|
45
|
+
```erb
|
|
46
|
+
<!DOCTYPE html>
|
|
47
|
+
<html>
|
|
48
|
+
<head>
|
|
49
|
+
<title><%= title %></title>
|
|
50
|
+
</head>
|
|
51
|
+
<body>
|
|
52
|
+
<h1><%= title %></h1>
|
|
53
|
+
<%= content %>
|
|
54
|
+
</body>
|
|
55
|
+
</html>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Assets (`site/assets/`)
|
|
59
|
+
|
|
60
|
+
Static files copied as-is to output:
|
|
61
|
+
|
|
62
|
+
- CSS stylesheets
|
|
63
|
+
- JavaScript files
|
|
64
|
+
- Images
|
|
65
|
+
- Fonts
|
|
66
|
+
|
|
67
|
+
## Build Your Site
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Full build
|
|
71
|
+
jackdaw build
|
|
72
|
+
|
|
73
|
+
# Clean build (remove old files first)
|
|
74
|
+
jackdaw build --clean
|
|
75
|
+
|
|
76
|
+
# Verbose output
|
|
77
|
+
jackdaw build --verbose
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Output goes to `public/` directory.
|
|
81
|
+
|
|
82
|
+
## Development Server
|
|
83
|
+
|
|
84
|
+
Start the dev server with live reload:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
jackdaw serve
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Visit http://localhost:4000 and edit your files - changes appear instantly!
|
|
91
|
+
|
|
92
|
+
Options:
|
|
93
|
+
```bash
|
|
94
|
+
jackdaw serve --port 3000 # Custom port
|
|
95
|
+
jackdaw serve --no-livereload # Disable live reload
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Create Content
|
|
99
|
+
|
|
100
|
+
Use templates to quickly create new content:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Create a blog post
|
|
104
|
+
jackdaw create blog "My First Post"
|
|
105
|
+
# → Creates: 2026-01-06-my-first-post.blog.md
|
|
106
|
+
|
|
107
|
+
# Create a page
|
|
108
|
+
jackdaw create page "About"
|
|
109
|
+
# → Creates: about.page.md
|
|
110
|
+
|
|
111
|
+
# Create in subdirectory
|
|
112
|
+
jackdaw create page "docs/installation"
|
|
113
|
+
# → Creates: docs/installation.page.md
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
List available templates:
|
|
117
|
+
```bash
|
|
118
|
+
jackdaw template list
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Your First Blog Post
|
|
122
|
+
|
|
123
|
+
Let's create a blog:
|
|
124
|
+
|
|
125
|
+
1. **Create blog template** (`site/templates/blog.html.erb`):
|
|
126
|
+
|
|
127
|
+
```erb
|
|
128
|
+
<!DOCTYPE html>
|
|
129
|
+
<html>
|
|
130
|
+
<head>
|
|
131
|
+
<title><%= title %></title>
|
|
132
|
+
<meta name="description" content="<%= excerpt %>">
|
|
133
|
+
</head>
|
|
134
|
+
<body>
|
|
135
|
+
<article>
|
|
136
|
+
<h1><%= title %></h1>
|
|
137
|
+
<time><%= date.strftime('%B %d, %Y') %></time>
|
|
138
|
+
<%= content %>
|
|
139
|
+
</article>
|
|
140
|
+
</body>
|
|
141
|
+
</html>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
2. **Create a post**:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
jackdaw create blog "Building Fast Sites"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
3. **Edit the content** (`site/src/2026-01-06-building-fast-sites.blog.md`):
|
|
151
|
+
|
|
152
|
+
```markdown
|
|
153
|
+
---
|
|
154
|
+
title: Building Fast Sites
|
|
155
|
+
excerpt: Learn how to build lightning-fast static sites
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
# Building Fast Sites
|
|
159
|
+
|
|
160
|
+
Static sites are fast, secure, and easy to deploy.
|
|
161
|
+
|
|
162
|
+
## Why Static?
|
|
163
|
+
|
|
164
|
+
- **Speed** - No database queries
|
|
165
|
+
- **Security** - No server-side code
|
|
166
|
+
- **Scalability** - Just files on a CDN
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
4. **Build and view**:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
jackdaw serve
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## What's Next?
|
|
176
|
+
|
|
177
|
+
- [Commands Reference](/commands.html) - All CLI commands
|
|
178
|
+
- [Template Guide](/templates.html) - Master templating
|
|
179
|
+
- [Content Guide](/content.html) - Organizing content
|
|
180
|
+
- [Deployment](/deployment.html) - Go live
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<div style="text-align: center; margin: 2rem 0;">
|
|
2
|
+
<img src="/jackdaw.png" alt="Jackdaw" style="max-width: 300px; height: auto;">
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
# Jackdaw ⚡️
|
|
6
|
+
|
|
7
|
+
**Lightning-fast static site generator for Ruby**
|
|
8
|
+
|
|
9
|
+
Jackdaw is a minimal, fast static site generator that emphasizes:
|
|
10
|
+
|
|
11
|
+
- **Speed** - Build 600 files in under 1 second with parallel processing
|
|
12
|
+
- **Convention over configuration** - Zero config required to get started
|
|
13
|
+
- **Developer experience** - Live reload, incremental builds, intuitive CLI
|
|
14
|
+
- **Simplicity** - Markdown + ERB templates, that's it
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Install
|
|
20
|
+
gem install jackdaw
|
|
21
|
+
|
|
22
|
+
# Create a new site
|
|
23
|
+
jackdaw new my-blog
|
|
24
|
+
cd my-blog.site
|
|
25
|
+
|
|
26
|
+
# Start developing
|
|
27
|
+
jackdaw serve
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Why Jackdaw?
|
|
31
|
+
|
|
32
|
+
### ⚡️ Blazing Fast
|
|
33
|
+
- Parallel processing for maximum speed
|
|
34
|
+
- Incremental builds - only rebuild what changed
|
|
35
|
+
- 693 files/second full build, 16,280 files/second incremental
|
|
36
|
+
|
|
37
|
+
### 🎯 Convention Over Configuration
|
|
38
|
+
- No configuration files needed
|
|
39
|
+
- Intuitive project structure
|
|
40
|
+
- Smart defaults that just work
|
|
41
|
+
|
|
42
|
+
### 🛠 Great Developer Experience
|
|
43
|
+
- Live reload development server
|
|
44
|
+
- Helpful CLI commands
|
|
45
|
+
- Clear error messages
|
|
46
|
+
- Ruby 4.0 ready
|
|
47
|
+
|
|
48
|
+
### 📦 Everything Included
|
|
49
|
+
- Markdown with GitHub-flavored syntax
|
|
50
|
+
- Syntax highlighting with Rouge
|
|
51
|
+
- Partials and layouts
|
|
52
|
+
- RSS/Atom feeds
|
|
53
|
+
- Sitemap generation
|
|
54
|
+
- SEO helpers
|
|
55
|
+
|
|
56
|
+
## Key Features
|
|
57
|
+
|
|
58
|
+
- **Markdown** - Write content in Markdown
|
|
59
|
+
- **ERB Templates** - Flexible templating with Ruby
|
|
60
|
+
- **Live Reload** - Changes appear instantly in browser
|
|
61
|
+
- **Parallel Processing** - Multi-core performance
|
|
62
|
+
- **Type-based Routing** - Automatic content organization
|
|
63
|
+
- **Incremental Builds** - Only rebuild changed files
|
|
64
|
+
- **RSS/Atom Feeds** - Automatic feed generation for blogs
|
|
65
|
+
- **Sitemap** - SEO-friendly sitemap.xml
|
|
66
|
+
- **Zero Config** - Convention over configuration
|
|
67
|
+
|
|
68
|
+
## Learn More
|
|
69
|
+
|
|
70
|
+
- [Installation](/installation.html) - Get Jackdaw up and running
|
|
71
|
+
- [Getting Started](/getting-started.html) - Your first site in 5 minutes
|
|
72
|
+
- [Commands](/commands.html) - Complete CLI reference
|
|
73
|
+
- [Templates](/templates.html) - Master templating
|
|
74
|
+
- [Content](/content.html) - Write and organize content
|
|
75
|
+
|
|
76
|
+
## Performance Benchmarks
|
|
77
|
+
|
|
78
|
+
| Operation | Time | Files/Second |
|
|
79
|
+
|-----------|------|-------------|
|
|
80
|
+
| Full build (600 files) | 0.87s | 693 |
|
|
81
|
+
| Incremental build | 0.04s | 16,280 |
|
|
82
|
+
| Cold start | 0.69s | 870 |
|
|
83
|
+
|
|
84
|
+
## Open Source
|
|
85
|
+
|
|
86
|
+
Jackdaw is MIT licensed and available on [GitHub](https://github.com/yourusername/jackdaw).
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
|
|
3
|
+
## Requirements
|
|
4
|
+
|
|
5
|
+
- Ruby 4.0 or later
|
|
6
|
+
- Bundler (recommended)
|
|
7
|
+
|
|
8
|
+
## Install from RubyGems
|
|
9
|
+
|
|
10
|
+
The easiest way to install Jackdaw:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
gem install jackdaw
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Verify the installation:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
jackdaw version
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Using Bundler
|
|
23
|
+
|
|
24
|
+
Add to your `Gemfile`:
|
|
25
|
+
|
|
26
|
+
```ruby
|
|
27
|
+
gem 'jackdaw'
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Then install:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
bundle install
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## From Source
|
|
37
|
+
|
|
38
|
+
Clone the repository and build:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
git clone https://github.com/yourusername/jackdaw.git
|
|
42
|
+
cd jackdaw
|
|
43
|
+
bundle install
|
|
44
|
+
gem build jackdaw.gemspec
|
|
45
|
+
gem install jackdaw-1.0.0.gem
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Dependencies
|
|
49
|
+
|
|
50
|
+
Jackdaw automatically installs these dependencies:
|
|
51
|
+
|
|
52
|
+
- **kramdown** (~> 2.4) - Markdown parsing
|
|
53
|
+
- **kramdown-parser-gfm** (~> 1.1) - GitHub-flavored Markdown
|
|
54
|
+
- **rouge** (~> 4.2) - Syntax highlighting
|
|
55
|
+
- **thor** (~> 1.3) - CLI framework
|
|
56
|
+
- **parallel** (~> 1.24) - Parallel processing
|
|
57
|
+
- **puma** (~> 6.4) - Development server
|
|
58
|
+
- **rack** (~> 3.0) - Web server interface
|
|
59
|
+
- **listen** (~> 3.9) - File watching
|
|
60
|
+
|
|
61
|
+
## Next Steps
|
|
62
|
+
|
|
63
|
+
Once installed, [create your first site →](/getting-started.html)
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
# Template Guide
|
|
2
|
+
|
|
3
|
+
Learn how to create powerful, flexible templates with ERB.
|
|
4
|
+
|
|
5
|
+
## Template Basics
|
|
6
|
+
|
|
7
|
+
Templates are ERB files in `site/templates/` that wrap your content.
|
|
8
|
+
|
|
9
|
+
**Basic template** (`site/templates/page.html.erb`):
|
|
10
|
+
|
|
11
|
+
```erb
|
|
12
|
+
<!DOCTYPE html>
|
|
13
|
+
<html>
|
|
14
|
+
<head>
|
|
15
|
+
<title><%= title %></title>
|
|
16
|
+
</head>
|
|
17
|
+
<body>
|
|
18
|
+
<%= content %>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Template Naming
|
|
24
|
+
|
|
25
|
+
Templates match content types:
|
|
26
|
+
|
|
27
|
+
- `page.html.erb` - Used by `*.page.md` files
|
|
28
|
+
- `blog.html.erb` - Used by `*.blog.md` files
|
|
29
|
+
- `post.html.erb` - Used by `*.post.md` files
|
|
30
|
+
|
|
31
|
+
## Available Variables
|
|
32
|
+
|
|
33
|
+
In templates, you have access to:
|
|
34
|
+
|
|
35
|
+
### Content Variables
|
|
36
|
+
|
|
37
|
+
```erb
|
|
38
|
+
<%= content %> <!-- Rendered HTML from Markdown -->
|
|
39
|
+
<%= title %> <!-- From first H1 or filename -->
|
|
40
|
+
<%= date %> <!-- Date object (if dated content) -->
|
|
41
|
+
<%= type %> <!-- Content type (page, blog, etc) -->
|
|
42
|
+
<%= excerpt %> <!-- First paragraph -->
|
|
43
|
+
<%= raw_content %> <!-- Original Markdown -->
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Layouts
|
|
47
|
+
|
|
48
|
+
Create a layout for all pages:
|
|
49
|
+
|
|
50
|
+
**`site/templates/layout.html.erb`:**
|
|
51
|
+
|
|
52
|
+
```erb
|
|
53
|
+
<!DOCTYPE html>
|
|
54
|
+
<html lang="en">
|
|
55
|
+
<head>
|
|
56
|
+
<meta charset="UTF-8">
|
|
57
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
58
|
+
<title><%= title %> - My Site</title>
|
|
59
|
+
<%= seo_tags %>
|
|
60
|
+
<link rel="stylesheet" href="/css/style.css">
|
|
61
|
+
</head>
|
|
62
|
+
<body>
|
|
63
|
+
<%= render_partial('nav') %>
|
|
64
|
+
|
|
65
|
+
<main>
|
|
66
|
+
<%= content %>
|
|
67
|
+
</main>
|
|
68
|
+
|
|
69
|
+
<%= render_partial('footer') %>
|
|
70
|
+
</body>
|
|
71
|
+
</html>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Use in page template:**
|
|
75
|
+
|
|
76
|
+
```erb
|
|
77
|
+
<%= render_layout('layout') do %>
|
|
78
|
+
<article>
|
|
79
|
+
<h1><%= title %></h1>
|
|
80
|
+
<%= content %>
|
|
81
|
+
</article>
|
|
82
|
+
<% end %>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Partials
|
|
86
|
+
|
|
87
|
+
Reusable template fragments in `site/templates/partials/`.
|
|
88
|
+
|
|
89
|
+
**Create** (`site/templates/partials/nav.html.erb`):
|
|
90
|
+
|
|
91
|
+
```erb
|
|
92
|
+
<nav>
|
|
93
|
+
<ul>
|
|
94
|
+
<li><a href="/">Home</a></li>
|
|
95
|
+
<li><a href="/about.html">About</a></li>
|
|
96
|
+
<li><a href="/blog.html">Blog</a></li>
|
|
97
|
+
</ul>
|
|
98
|
+
</nav>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Use in templates:**
|
|
102
|
+
|
|
103
|
+
```erb
|
|
104
|
+
<%= render_partial('nav') %>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
With variables:
|
|
108
|
+
|
|
109
|
+
```erb
|
|
110
|
+
<%= render_partial('card', { title: 'Hello', text: 'World' }) %>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Collections
|
|
114
|
+
|
|
115
|
+
Loop through content:
|
|
116
|
+
|
|
117
|
+
```erb
|
|
118
|
+
<h2>Recent Posts</h2>
|
|
119
|
+
<ul>
|
|
120
|
+
<% collection('blog', limit: 5).each do |post| %>
|
|
121
|
+
<li>
|
|
122
|
+
<a href="/<%= post.output_path %>">
|
|
123
|
+
<%= post.title %>
|
|
124
|
+
</a>
|
|
125
|
+
<time><%= post.date.strftime('%B %d, %Y') %></time>
|
|
126
|
+
</li>
|
|
127
|
+
<% end %>
|
|
128
|
+
</ul>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Options:**
|
|
132
|
+
- `limit: 10` - Maximum items
|
|
133
|
+
- `sort: :date` - Sort by field (default: date)
|
|
134
|
+
- `reverse: true` - Newest first (default)
|
|
135
|
+
|
|
136
|
+
**Examples:**
|
|
137
|
+
|
|
138
|
+
```erb
|
|
139
|
+
<!-- All blog posts -->
|
|
140
|
+
<% collection('blog').each do |post| %>
|
|
141
|
+
...
|
|
142
|
+
<% end %>
|
|
143
|
+
|
|
144
|
+
<!-- Latest 3 posts -->
|
|
145
|
+
<% collection('blog', limit: 3).each do |post| %>
|
|
146
|
+
...
|
|
147
|
+
<% end %>
|
|
148
|
+
|
|
149
|
+
<!-- All pages -->
|
|
150
|
+
<% collection('page').each do |page| %>
|
|
151
|
+
...
|
|
152
|
+
<% end %>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## SEO Helpers
|
|
156
|
+
|
|
157
|
+
Built-in helpers for SEO:
|
|
158
|
+
|
|
159
|
+
### Complete SEO Tags
|
|
160
|
+
|
|
161
|
+
```erb
|
|
162
|
+
<%= seo_tags %>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Generates:
|
|
166
|
+
- Open Graph tags
|
|
167
|
+
- Twitter Card tags
|
|
168
|
+
- Canonical URL
|
|
169
|
+
- Meta description
|
|
170
|
+
|
|
171
|
+
### Individual Tags
|
|
172
|
+
|
|
173
|
+
```erb
|
|
174
|
+
<%= og_tags %> <!-- Open Graph -->
|
|
175
|
+
<%= twitter_tags %> <!-- Twitter Cards -->
|
|
176
|
+
<%= canonical_tag %> <!-- Canonical URL -->
|
|
177
|
+
<%= meta_description %> <!-- Description meta tag -->
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**With custom values:**
|
|
181
|
+
|
|
182
|
+
```erb
|
|
183
|
+
<%= og_tags(
|
|
184
|
+
title: "Custom Title",
|
|
185
|
+
description: "Custom description",
|
|
186
|
+
image: "/images/og-image.png"
|
|
187
|
+
) %>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Date Formatting
|
|
191
|
+
|
|
192
|
+
```erb
|
|
193
|
+
<!-- Full date -->
|
|
194
|
+
<%= date.strftime('%B %d, %Y') %>
|
|
195
|
+
<!-- January 06, 2026 -->
|
|
196
|
+
|
|
197
|
+
<!-- Short date -->
|
|
198
|
+
<%= date.strftime('%Y-%m-%d') %>
|
|
199
|
+
<!-- 2026-01-06 -->
|
|
200
|
+
|
|
201
|
+
<!-- Custom -->
|
|
202
|
+
<%= date.strftime('%A, %b %e') %>
|
|
203
|
+
<!-- Monday, Jan 6 -->
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Conditional Content
|
|
207
|
+
|
|
208
|
+
```erb
|
|
209
|
+
<% if defined?(date) && date %>
|
|
210
|
+
<time><%= date.strftime('%B %d, %Y') %></time>
|
|
211
|
+
<% end %>
|
|
212
|
+
|
|
213
|
+
<% if type == 'blog' %>
|
|
214
|
+
<span class="blog-badge">Blog Post</span>
|
|
215
|
+
<% end %>
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Example Templates
|
|
219
|
+
|
|
220
|
+
### Blog Post Template
|
|
221
|
+
|
|
222
|
+
```erb
|
|
223
|
+
<!DOCTYPE html>
|
|
224
|
+
<html>
|
|
225
|
+
<head>
|
|
226
|
+
<title><%= title %> - My Blog</title>
|
|
227
|
+
<%= seo_tags %>
|
|
228
|
+
<link rel="stylesheet" href="/css/style.css">
|
|
229
|
+
</head>
|
|
230
|
+
<body>
|
|
231
|
+
<%= render_partial('nav') %>
|
|
232
|
+
|
|
233
|
+
<article class="blog-post">
|
|
234
|
+
<header>
|
|
235
|
+
<h1><%= title %></h1>
|
|
236
|
+
<time datetime="<%= date.iso8601 %>">
|
|
237
|
+
<%= date.strftime('%B %d, %Y') %>
|
|
238
|
+
</time>
|
|
239
|
+
</header>
|
|
240
|
+
|
|
241
|
+
<div class="content">
|
|
242
|
+
<%= content %>
|
|
243
|
+
</div>
|
|
244
|
+
</article>
|
|
245
|
+
|
|
246
|
+
<%= render_partial('footer') %>
|
|
247
|
+
</body>
|
|
248
|
+
</html>
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Blog Index Template
|
|
252
|
+
|
|
253
|
+
```erb
|
|
254
|
+
<!DOCTYPE html>
|
|
255
|
+
<html>
|
|
256
|
+
<head>
|
|
257
|
+
<title>Blog</title>
|
|
258
|
+
<link rel="stylesheet" href="/css/style.css">
|
|
259
|
+
</head>
|
|
260
|
+
<body>
|
|
261
|
+
<%= render_partial('nav') %>
|
|
262
|
+
|
|
263
|
+
<h1>Blog</h1>
|
|
264
|
+
|
|
265
|
+
<div class="posts">
|
|
266
|
+
<% collection('blog', limit: 20).each do |post| %>
|
|
267
|
+
<article class="post-preview">
|
|
268
|
+
<h2>
|
|
269
|
+
<a href="/<%= post.output_path %>">
|
|
270
|
+
<%= post.title %>
|
|
271
|
+
</a>
|
|
272
|
+
</h2>
|
|
273
|
+
<time><%= post.date.strftime('%B %d, %Y') %></time>
|
|
274
|
+
<p><%= post.excerpt %></p>
|
|
275
|
+
<a href="/<%= post.output_path %>">Read more →</a>
|
|
276
|
+
</article>
|
|
277
|
+
<% end %>
|
|
278
|
+
</div>
|
|
279
|
+
|
|
280
|
+
<%= render_partial('footer') %>
|
|
281
|
+
</body>
|
|
282
|
+
</html>
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
## Tips
|
|
286
|
+
|
|
287
|
+
1. **Keep it simple** - Start with basic templates
|
|
288
|
+
2. **Use partials** - DRY up repeated HTML
|
|
289
|
+
3. **Default values** - Use `||` for defaults:
|
|
290
|
+
```erb
|
|
291
|
+
<%= title || 'Untitled' %>
|
|
292
|
+
```
|
|
293
|
+
4. **Check existence** - Use `defined?` for optional variables
|
|
294
|
+
5. **Extract layouts** - Share structure across templates
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<footer class="footer">
|
|
2
|
+
<div class="container">
|
|
3
|
+
<p>
|
|
4
|
+
Built with <a href="https://usejackdaw.com">Jackdaw</a> ⚡️
|
|
5
|
+
• <a href="https://github.com/BillyRuffian/jackdaw">GitHub</a>
|
|
6
|
+
• <a href="/feed.xml">RSS</a>
|
|
7
|
+
</p>
|
|
8
|
+
<p class="copyright">
|
|
9
|
+
© 2026 Jackdaw. MIT License.
|
|
10
|
+
</p>
|
|
11
|
+
</div>
|
|
12
|
+
</footer>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<nav class="navbar">
|
|
2
|
+
<div class="container">
|
|
3
|
+
<div class="nav-brand">
|
|
4
|
+
<a href="/">
|
|
5
|
+
<img src="/squawk.png" alt="Jackdaw" class="logo">
|
|
6
|
+
Jackdaw
|
|
7
|
+
</a>
|
|
8
|
+
</div>
|
|
9
|
+
<ul class="nav-menu">
|
|
10
|
+
<li><a href="/installation.html">Install</a></li>
|
|
11
|
+
<li><a href="/getting-started.html">Get Started</a></li>
|
|
12
|
+
<li><a href="/commands.html">Commands</a></li>
|
|
13
|
+
<li><a href="/templates.html">Templates</a></li>
|
|
14
|
+
<li><a href="/content.html">Content</a></li>
|
|
15
|
+
<li><a href="/deployment.html">Deploy</a></li>
|
|
16
|
+
<li><a href="https://github.com/yourusername/jackdaw" class="github">GitHub</a></li>
|
|
17
|
+
</ul>
|
|
18
|
+
</div>
|
|
19
|
+
</nav>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title><%= title %> - <%= site_name %></title>
|
|
7
|
+
<% if defined?(description) && description %>
|
|
8
|
+
<meta name="description" content="<%= description %>">
|
|
9
|
+
<% end %>
|
|
10
|
+
<link rel="stylesheet" href="/css/style.css">
|
|
11
|
+
<link rel="alternate" type="application/rss+xml" title="Jackdaw RSS" href="/feed.xml">
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<%= render 'nav' %>
|
|
15
|
+
<%= content %>
|
|
16
|
+
<%= render 'footer' %>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|