craze 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 94e68fef0baff4d7a0beb5f0b9c5a87a57e0baff7bf270fcf981f69b5a60f746
4
+ data.tar.gz: a9e5013474fc014555bc26e09b4e102a606648d395a8f29ad15613f770748764
5
+ SHA512:
6
+ metadata.gz: 5249fa6020e4a2e08f7ad14077c4546c2277e4c8db1ab1a54e189368768f5de9e30da18cf6556fd84a9045be14e43992c2fa5e012d79b6669a5e37c38254da4f
7
+ data.tar.gz: 98d91b1662b2fd11ff9326e8f577933b19c9c64e222dcc00e01254d68d386a840f8f2c708745b0bd3a3326d07f1510d94909475a77a99b4f938236868b1b58b4
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 0.1.0 - 2026-01-16
6
+
7
+ - Initial release.
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Yudai Takada
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,206 @@
1
+ <p align="center">
2
+ <img src="assets/logo-header.svg" alt="craze header logo">
3
+ <p align="center">
4
+ <strong>A modern static site generator for Ruby with Vite/Tailwind integration</strong>
5
+ </p>
6
+ <p align="center">
7
+ <a href="https://rubygems.org/gems/craze"><img src="https://img.shields.io/gem/v/craze.svg?colorB=319e8c" alt="Gem Version"></a>
8
+ <a href="https://rubygems.org/gems/craze"><img src="https://img.shields.io/gem/dt/craze.svg" alt="Downloads"></a>
9
+ <img src="https://img.shields.io/badge/ruby-%3E%3D%203.2-ruby.svg" alt="Ruby Version">
10
+ <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License">
11
+ </p>
12
+ </p>
13
+
14
+ <p align="center">
15
+ <a href="#features">Features</a> ·
16
+ <a href="#installation">Installation</a> ·
17
+ <a href="#quick-start">Quick Start</a> ·
18
+ <a href="#configuration">Configuration</a> ·
19
+ <a href="#how-it-works">How It Works</a> ·
20
+ <a href="#integrations">Integrations</a>
21
+ </p>
22
+
23
+ ---
24
+
25
+ Craze is a static site generator that compiles Markdown content with YAML front matter into a static website using ERB templates. It features incremental builds, live reload during development, and seamless integration with modern frontend tools like Vite and Tailwind CSS.
26
+
27
+ ## Features
28
+
29
+ <a name="features"></a>
30
+
31
+ - Markdown content with YAML front matter
32
+ - ERB templates with layouts and partials
33
+ - Collections (posts, pages, etc.) with custom permalinks
34
+ - Incremental builds with file watching
35
+ - Live reload during development
36
+ - Vite + Tailwind CSS integration
37
+ - Extensible integrations (RSS, Sitemap, Search Index)
38
+
39
+ ## Installation
40
+
41
+ <a name="installation"></a>
42
+
43
+ Add to your Gemfile:
44
+
45
+ ```ruby
46
+ gem 'craze'
47
+ ```
48
+
49
+ Then install:
50
+
51
+ ```bash
52
+ bundle install
53
+ ```
54
+
55
+ ### Requirements
56
+
57
+ <a name="requirements"></a>
58
+
59
+ - Ruby 3.2+
60
+ - Node.js 18+ (for Vite integration)
61
+
62
+ ## Quick Start
63
+
64
+ <a name="quick-start"></a>
65
+
66
+ Create a new project:
67
+
68
+ ```bash
69
+ craze init mysite
70
+ cd mysite
71
+ craze dev
72
+ ```
73
+
74
+ With Vite + Tailwind:
75
+
76
+ ```bash
77
+ craze init mysite --with-vite
78
+ cd mysite
79
+ cd frontend && npm install && cd ..
80
+ craze dev
81
+ ```
82
+
83
+ Build for production:
84
+
85
+ ```bash
86
+ craze build
87
+ ```
88
+
89
+ ## Integrations
90
+
91
+ <a name="integrations"></a>
92
+
93
+ ### Sitemap
94
+
95
+ Generates `sitemap.xml` with all pages.
96
+
97
+ ### RSS
98
+
99
+ Generates `feed.xml` for posts collection.
100
+
101
+ ### Search Index
102
+
103
+ Generates `search.json` for client-side search.
104
+
105
+ ### Vite Assets
106
+
107
+ Copies Vite build output to dist directory and provides template helpers.
108
+
109
+ ## Configuration
110
+
111
+ <a name="configuration"></a>
112
+
113
+ Create `craze.yml` in your project root:
114
+
115
+ | Option | Type | Default | Description |
116
+ |--------|------|---------|-------------|
117
+ | `site.title` | String | `"My Site"` | Site title |
118
+ | `site.url` | String | `"https://example.com"` | Site URL |
119
+ | `site.language` | String | `"en"` | Site language |
120
+ | `build.out_dir` | String | `"dist"` | Output directory |
121
+ | `build.base_path` | String | `"/"` | Base path for URLs |
122
+ | `build.clean` | Boolean | `true` | Clean output before build |
123
+ | `content.dir` | String | `"content"` | Content directory |
124
+ | `templates.dir` | String | `"templates"` | Templates directory |
125
+ | `assets.dir` | String | `"assets"` | Assets directory |
126
+ | `integrations` | Array | `[]` | Enabled integrations |
127
+
128
+ ### Example Configuration
129
+
130
+ ```yaml
131
+ site:
132
+ title: "My Blog"
133
+ url: "https://example.com"
134
+ language: "en"
135
+
136
+ build:
137
+ out_dir: "dist"
138
+ base_path: "/"
139
+ clean: true
140
+
141
+ content:
142
+ dir: "content"
143
+ collections:
144
+ posts:
145
+ pattern: "posts//*.md"
146
+ permalink: "/posts/:slug/"
147
+
148
+ templates:
149
+ dir: "templates"
150
+
151
+ integrations:
152
+ - sitemap
153
+ - rss
154
+ - search_index
155
+ ```
156
+
157
+ ## How It Works
158
+
159
+ <a name="how-it-works"></a>
160
+
161
+ 1. Content Discovery scans `content/` for Markdown files
162
+ 2. Front Matter Parsing extracts YAML metadata from each file
163
+ 3. Markdown Rendering converts Markdown to HTML using CommonMark
164
+ 4. Template Rendering applies ERB layouts with page data
165
+ 5. Integration Execution runs sitemap, RSS, search index generators
166
+ 6. Output Writing writes HTML files to `dist/`
167
+
168
+ ### Template Helpers
169
+
170
+ | Helper | Description |
171
+ |--------|-------------|
172
+ | `url_for(path)` | Generate URL with base path |
173
+ | `asset_path(name)` | Generate asset URL |
174
+ | `escape_html(text)` | HTML escape |
175
+ | `format_date(date, format)` | Format date |
176
+
177
+ ### Vite Helpers
178
+
179
+ | Helper | Description |
180
+ |--------|-------------|
181
+ | `vite_client_tag` | Vite HMR client (dev only) |
182
+ | `vite_js_tag(entry)` | JavaScript entry point |
183
+ | `vite_css_tag(entry)` | CSS entry point |
184
+ | `vite_asset_path(entry)` | Get asset path from manifest |
185
+
186
+ ## Development
187
+
188
+ <a name="development"></a>
189
+
190
+ ```bash
191
+ bundle install
192
+ bundle exec rake test
193
+ bundle exec rubocop
194
+ ```
195
+
196
+ ## Contributing
197
+
198
+ <a name="contributing"></a>
199
+
200
+ Bug reports and pull requests are welcome at https://github.com/ydah/craze.
201
+
202
+ ## License
203
+
204
+ <a name="license"></a>
205
+
206
+ Released under the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rake/testtask'
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << 'test'
8
+ t.libs << 'lib'
9
+ t.test_files = FileList['test/**/*_test.rb']
10
+ end
11
+
12
+ task default: %i[test]