static-site-builder 0.1.4 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ec7765f3cc618a791a6d655fed75fe39f43a09d9c697cc71135d17160dbd27f
4
- data.tar.gz: 74ace48bd713ba712607509baf63a80095cd610395be622b59c3e552336f10df
3
+ metadata.gz: b04601a6add58d7ee3a23a48d6456f16fd6fb09a486d1834604803b21cd2ca75
4
+ data.tar.gz: 717cfe27a34a388acea7a1f91a37b655040dc7ca1b97d4d6fe86c01c59d10f17
5
5
  SHA512:
6
- metadata.gz: 358643b7c2cb4bd56693c18fa4f57114da85b519a1423e319a55d1b4d7ee0d3190768985225539e6c65f9eed044d96fced689d5464d39fb0db85238dbcb4e6d4
7
- data.tar.gz: a8ab43edfdac947a34e0222c181037213120eb1f9dea91c924f218e974908c51491135ce475aadde6552bedd65698cf05a54e18af60b73669b6c6fe7134cb84a
6
+ metadata.gz: 28c976044449130ad0da918875dfdfdbc32b09126f46f4ed2516b3d72fd0107ed8f63a6891c09414f37d13acee61f1c573ed1e40ad6c81f87a49628013037fdf
7
+ data.tar.gz: 6ae711f3f6fb8de54c2b2ec4f9b8c3bfbd2d4b6d8848ff078f95e3c0174523e0e9542779d1b331b0541c6c8fdcca6241bfd35b16d1d31cbfae29568d262592a4
data/CHANGELOG.md CHANGED
@@ -1,96 +1,29 @@
1
1
  # Changelog
2
2
 
3
- All notable changes to this project will be documented in this file.
3
+ ## 1.0.0 (Current) - 2025-12-13
4
4
 
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
+ First stable release of Static Site Builder.
7
6
 
8
- ## [0.1.4] - 2025-11-22
7
+ ### Features
9
8
 
10
- ### Added
11
- - Generator now automatically creates `lib/page_helpers.rb` with `PageHelpers::PAGES` structure for page metadata
12
- - Generator now automatically creates `config/sitemap.rb` for sitemap generation
13
- - `sitemap_generator` gem is now automatically included in generated Gemfiles
14
- - `build:sitemap` task is automatically added to generated Rakefiles
15
- - Sitemap generation is integrated into `build:all` task
9
+ - Generate static HTML sites from ERB templates
10
+ - Development server with auto-rebuild and live reload
11
+ - Sitemap generation from pages
12
+ - Simple and flexible - add your own JavaScript bundling and CSS processing
16
13
 
17
- ### Changed
18
- - Page metadata is now managed via `PageHelpers::PAGES` hash instead of frontmatter
19
- - README updated to reflect `PageHelpers::PAGES` approach (frontmatter example removed)
20
- - ActionView requirement changed from `>= 8.0` to `~> 7.1` for Ruby 3.1 compatibility
21
- - Generated layouts now use `@title` and `@js_modules` instance variables instead of frontmatter
14
+ ### What Gets Generated
22
15
 
23
- ### Fixed
24
- - Fixed `js_modules` variable reference in generated layouts (now uses `@js_modules`)
25
- - Fixed PageHelpers metadata loading to occur before page content rendering, allowing partials to access `@title`, `@description`, etc.
26
- - Removed all frontmatter parsing code and references
27
- - Updated all specs to use `PageHelpers::PAGES` instead of frontmatter
16
+ - Clean project structure with `app/views/`, `app/javascript/`, `app/assets/stylesheets/`
17
+ - Self-contained build code in `lib/site_builder.rb` (no runtime dependency on this gem), using ActionView for Rails-like templates/partials/helpers
18
+ - Rakefile with build tasks (`bundle exec rake build:all`, `bundle exec rake build:html`, `bundle exec rake build:css`, `bundle exec rake build:sitemap`)
19
+ - `build:all` cleans `dist/` first, then builds assets + HTML + CSS + sitemap
20
+ - Development server (`bundle exec rake dev:server`) with live reload
21
+ - Example pages and layouts
22
+ - Sitemap configuration
28
23
 
29
- ## [0.1.3] - 2025-11-22
24
+ ### Requirements
30
25
 
31
- ### Added
32
- - Integrated ActionView 8+ for proper Rails-style partial rendering
33
- - Support for Rails-style render syntax: `render 'shared/header'` and `render partial: 'shared/header'`
34
- - Support for passing locals to partials: `render partial: 'shared/header', locals: { title: 'Hello' }`
35
- - Nested partial support (partials can render other partials)
36
- - Multiple partials on the same page now work correctly
26
+ - Ruby 3.0+
27
+ - Bundler
37
28
 
38
- ### Changed
39
- - Replaced raw ERB implementation with ActionView::Base for template rendering
40
- - Render method now uses ActionView's rendering system, matching Rails behaviour exactly
41
- - Partials automatically receive page variables (@js_modules, importmap_json, current_page)
42
- - Improved error messages for missing partials (converted from ActionView format for backwards compatibility)
43
- - Template annotations now preserve both page and layout annotations correctly
44
-
45
- ### Fixed
46
- - Fixed issue where nested partials (partials rendering other partials) would fail or produce incorrect output
47
- - Fixed issue where multiple partials on the same page would only render the last one
48
- - Fixed template annotations being stripped when layout annotations were added
49
-
50
- ## [0.1.2] - 2025-11-22
51
-
52
- ### Fixed
53
- - CSS directory is now always created when Tailwind handles CSS compilation, preventing 404 errors for stylesheets
54
- - Build process now updates files in place instead of cleaning and recreating the dist directory, preventing 404 errors during rebuilds in development mode
55
- - Fixed race condition where pages would return 404 when code changes triggered rebuilds
56
-
57
- ## [0.1.1] - 2025-11-21
58
-
59
- ### Added
60
- - `render` helper method for ERB templates to include partials
61
- - Support for rendering partials from `app/views/shared/` directory
62
- - Partial files should be named with `_` prefix (e.g., `_header.html.erb`)
63
- - Partials have access to page variables (@js_modules, etc.)
64
-
65
- ### Changed
66
- - Improved ERB compilation to support partial rendering
67
-
68
- ## [0.0.1] - 2025-11-21
69
-
70
- ### Added
71
- - Initial release of static-site-builder gem
72
- - Generator for creating new static site projects
73
- - Builder for compiling ERB templates to static HTML
74
- - Support for multiple template engines (ERB, Phlex)
75
- - Support for multiple JavaScript bundlers (Importmap, ESBuild, Webpack, Vite, None)
76
- - Support for multiple CSS frameworks (TailwindCSS, shadcn/ui, Plain CSS)
77
- - Support for multiple JavaScript frameworks (Stimulus, React, Vue, Alpine.js, Vanilla)
78
- - Page metadata via `PageHelpers::PAGES` hash
79
- - Layout support with nested layouts
80
- - Importmap JSON generation
81
- - Asset copying (JavaScript, CSS, vendor files, static files)
82
- - Comprehensive test suite
83
- - YARD documentation
84
- - CI/CD setup (GitHub Actions)
85
-
86
- ### Changed
87
- - Vendor JavaScript files are automatically copied directly from `node_modules` to `dist/assets/javascripts/` during build
88
- - Removed requirement for `vendor/javascript/` folder - vendor files are copied automatically based on importmap configuration
89
- - Generator no longer creates vendor files during project generation
90
-
91
- ### Fixed
92
- - Added warning messages when vendor files cannot be found in `node_modules`
93
- - Updated base64 dependency comments to clarify requirement for Ruby 3.4+
94
-
95
- [0.0.1]: https://github.com/Ancez/static-site-builder/releases/tag/v0.0.1
96
29
 
data/README.md CHANGED
@@ -1,15 +1,28 @@
1
1
  # Static Site Builder
2
2
 
3
- A Ruby-based generator and builder for creating static HTML sites with working JavaScript. **No backend required** - just compile your templates to static HTML and deploy anywhere.
3
+ > **⚠️ Active Development**: This project is currently in active development.
4
4
 
5
- ## Main Objective
5
+ A Ruby-based generator and builder for creating static HTML sites with working JavaScript. **No backend required** - just compile your ERB files to static HTML and deploy anywhere.
6
+
7
+ 📖 **Learn more**: [Demo](https://lukaszczapiewski.com) | [Project Overview](https://lukaszczapiewski.com/projects/static-site-builder) | [Getting Started Guide](https://lukaszczapiewski.com/blog/getting-started-with-static-site-builders)
8
+
9
+ ## Why This Exists
10
+
11
+ Generates standalone static sites from ERB templates, with a working dev server, file watching, and live reload. Generated projects are **self-contained**: the build code lives in the generated repo (`lib/site_builder.rb`).
12
+
13
+ ## Why Choose This Over Other Approaches
14
+
15
+ **Better SEO & Search Rankings**: Unlike Single Page Applications (SPAs) that rely on client-side JS rendering, static HTML is immediately crawlable by search engines. Your content is fully indexed from the first request, leading to better search rankings and significantly faster page loads.
6
16
 
7
- Generate static HTML pages with JavaScript files that work. Choose your own stack:
17
+ **Simplicity Over Complexity**: No need for complex JavaScript frameworks, hydration, or server-side rendering setups. Create .html.erb files that compile to clean, static HTML. Add JavaScript only where you need interactivity, not as a requirement for rendering.
8
18
 
9
- - **Template Engine**: ERB or Phlex
10
- - **JavaScript Bundler**: Importmap, ESBuild, Webpack, Vite, or none
11
- - **CSS Framework**: TailwindCSS, shadcn/ui, or plain CSS
12
- - **JavaScript Framework**: Stimulus, React, Vue, Alpine.js, or vanilla JS
19
+ **Developer Experience**: Work with familiar Rails patterns (layouts, pages, partials) without a full Rails application, allowing you to host it for free directly on Cloudflare CDNs and other static hosting services.
20
+
21
+ **Version Control & Mobile Editing**: Your entire site is code in a Git repository. Track changes, collaborate, and edit from anywhere - even your phone with tools like Cursor Agents. No database migrations or CMS interfaces needed. Lightning fast.
22
+
23
+ ## Main Objective
24
+
25
+ Generate static HTML pages using ERB files. Simple and flexible - add your own JavaScript bundling and CSS processing as needed.
13
26
 
14
27
  ## Installation
15
28
 
@@ -37,10 +50,9 @@ bundle install
37
50
  ruby bin/generate my-site
38
51
  ```
39
52
 
40
- You'll be prompted to choose your stack using an interactive menu with arrow key navigation. Generated sites use:
41
- - `static-site-builder` gem for compilation
42
- - Standard gems (importmap-rails, phlex-rails, etc.) for functionality
43
- - npm packages for JS bundlers and frameworks
53
+ Generated sites use:
54
+ - ERB templates for HTML generation
55
+ - local build code in `lib/site_builder.rb` (no runtime dependency on this gem)
44
56
 
45
57
  ## What Gets Generated
46
58
 
@@ -48,231 +60,130 @@ A clean project structure that depends on gems:
48
60
 
49
61
  ```
50
62
  my-site/
51
- ├── Gemfile # Dependencies (static-site-builder, sitemap_generator, etc.)
52
- ├── package.json # JS dependencies (if needed)
53
- ├── Rakefile # Build tasks (includes sitemap generation)
63
+ ├── Gemfile # Dependencies (rake, webrick, sitemap_generator, etc.)
64
+ ├── Rakefile # Build tasks (assets, HTML, CSS, sitemap, dev server)
54
65
  ├── config/
55
- │ ├── importmap.rb # Importmap config (if using importmap)
56
66
  │ └── sitemap.rb # Sitemap generation config
57
67
  ├── app/
58
68
  │ ├── views/
59
69
  │ │ ├── layouts/
60
70
  │ │ ├── pages/
61
- │ │ └── components/ # Reusable components/partials
62
71
  │ ├── javascript/
63
72
  │ └── assets/
73
+ │ └── stylesheets/
64
74
  └── lib/
65
- ├── site_builder.rb # Compiles your site
66
- └── page_helpers.rb # Page metadata (title, description, etc.)
75
+ └── site_builder.rb # Compiles your site
67
76
  ```
68
77
 
69
78
  ## How It Works
70
79
 
71
- 1. **Generator** (`static-site-generator`) - Creates the project structure
72
- 2. **Builder Gem** (`static-site-builder`) - Handles ERB/Phlex compilation
73
- 3. **Standard Gems** - importmap-rails, phlex-rails, etc. for functionality
74
- 4. **Build Tools** - Rake tasks that use the builder gem
80
+ 1. **Generator** (`static-site-builder new ...`) - Creates the project structure
81
+ 2. **Generated build code** (`lib/site_builder.rb`) - Compiles pages/layouts and provides WebSocket live reload
82
+ 3. **Build tools** (`Rakefile`) - Defines `build:*` tasks and `dev:server`
83
+ 4. **Your tools** - Add Tailwind, bundlers, etc, and wire them via `package.json` scripts
75
84
 
76
85
  ## Features
77
86
 
78
87
  - 🎯 **Static HTML output** - No server-side rendering needed
79
- - 🔧 **Flexible stack** - Choose what works for you
80
- - 📦 **Gem-based** - Uses existing Ruby gems, not custom code
88
+ - 🔧 **Simple & flexible** - ERB files, add your own tools
89
+ - 📦 **Self-contained generated sites** - No runtime dependency on this gem
81
90
  - 🚀 **Fast builds** - Compile once, deploy everywhere
82
- - 🎨 **Component support** - ERB or Phlex components
83
- - 📱 **Modern JS** - ES modules, importmaps, or bundlers
84
-
85
- ## Supported Stacks
86
-
87
- ### Template Engines
88
- - **ERB** - Ruby's embedded Ruby templates
89
- - **Phlex** - Ruby component library (via phlex-rails gem)
91
+ - 🔄 **Live reload** - Rebuild and refresh on changes in development
90
92
 
91
- ### JavaScript Bundlers
92
- - **Importmap** - No bundling, use ES modules directly (via importmap-rails gem)
93
- - **ESBuild** - Fast JavaScript bundler
94
- - **Webpack** - Powerful bundler with plugins
95
- - **Vite** - Next-generation frontend tooling
96
- - **None** - Vanilla JavaScript, no bundling
97
-
98
- ### CSS Frameworks
99
- - **TailwindCSS** - Utility-first CSS framework
100
- - **shadcn/ui** - Re-usable components built with Tailwind
101
- - **Plain CSS** - Write your own styles
102
-
103
- ### JavaScript Frameworks
104
- - **Stimulus** - Modest JavaScript framework
105
- - **React** - Popular UI library
106
- - **Vue** - Progressive JavaScript framework
107
- - **Alpine.js** - Minimal framework for HTML
108
- - **Vanilla JS** - No framework
109
-
110
- ## Building Powerful Websites
111
-
112
- ### Using ERB Templates
113
-
114
- Create pages in `app/views/pages/`:
115
-
116
- ```erb
117
- <h1><%= @title %></h1>
118
- <p><%= @description %></p>
119
- ```
120
-
121
- Page metadata is automatically configured in `lib/page_helpers.rb` (generated automatically):
122
-
123
- ```ruby
124
- module PageHelpers
125
- PAGES = {
126
- '/' => {
127
- title: 'My Page',
128
- description: 'A great page',
129
- url: 'https://example.com',
130
- image: 'https://example.com/image.jpg',
131
- priority: 1.0,
132
- changefreq: 'weekly'
133
- }
134
- }.freeze
135
- end
136
- ```
93
+ ## Templates
137
94
 
138
- The builder automatically loads metadata from `PageHelpers::PAGES` and sets `@title`, `@description`, `@url`, and `@image` instance variables for use in your templates. This metadata is also used by the `sitemap_generator` gem for generating sitemaps.
95
+ Generated sites use **ActionView** for Rails-like templates, helpers, layouts, and partials.
139
96
 
140
- Use layouts in `app/views/layouts/application.html.erb`:
97
+ Create a layout in `app/views/layouts/application.html.erb`:
141
98
 
142
99
  ```erb
143
100
  <!DOCTYPE html>
144
- <html>
101
+ <html lang="en">
145
102
  <head>
146
- <title><%= @title || "My Site" %></title>
103
+ <meta charset="UTF-8">
104
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
105
+ <link rel="stylesheet" href="/assets/stylesheets/application.css">
147
106
  </head>
148
107
  <body>
149
- <%= yield %>
108
+ <main>
109
+ <%= yield %>
110
+ </main>
111
+
112
+ <% if content_for?(:javascript) %>
113
+ <%= yield(:javascript) %>
114
+ <% end %>
150
115
  </body>
151
116
  </html>
152
117
  ```
153
118
 
154
- ### Using Phlex Components
155
-
156
- Create reusable components in `app/views/components/`:
157
-
158
- ```ruby
159
- class Button < Phlex::HTML
160
- def initialize(text:, href:, variant: "primary")
161
- @text = text
162
- @href = href
163
- @variant = variant
164
- end
165
-
166
- def template
167
- a(href: @href, class: "btn btn-#{@variant}") { @text }
168
- end
169
- end
170
- ```
171
-
172
- Use in pages:
119
+ `yield` outputs the page content. Use `content_for(:javascript)` to push scripts into the layout.
173
120
 
174
- ```ruby
175
- class HomePage < Phlex::HTML
176
- def template
177
- div do
178
- h1 { "Welcome" }
179
- render Button.new(text: "Get Started", href: "/about")
180
- end
181
- end
182
- end
183
- ```
184
-
185
- ### JavaScript with Importmap
121
+ ### Partials
186
122
 
187
- No bundling needed - use ES modules directly:
123
+ Partials work like Rails, including `locals:`:
188
124
 
189
- ```javascript
190
- // app/javascript/application.js
191
- import { Application } from "@hotwired/stimulus"
192
- import HelloController from "./controllers/hello_controller"
193
-
194
- window.Stimulus = Application.start()
195
- Stimulus.register("hello", HelloController)
125
+ ```erb
126
+ <%= render partial: 'shared/header', locals: { title: 'Home' } %>
196
127
  ```
197
128
 
198
- ### JavaScript with Bundlers
199
-
200
- Use ESBuild, Webpack, or Vite for modern tooling:
129
+ ### Adding JavaScript
201
130
 
202
- ```javascript
203
- // app/javascript/index.js
204
- import React from 'react'
205
- import { createRoot } from 'react-dom/client'
131
+ Include JavaScript files in your pages:
206
132
 
207
- function App() {
208
- return <h1>Hello from React!</h1>
209
- }
210
-
211
- const root = createRoot(document.getElementById('app'))
212
- root.render(<App />)
133
+ ```erb
134
+ <% content_for(:javascript) do %>
135
+ <script src="/assets/javascripts/application.js"></script>
136
+ <% end %>
213
137
  ```
214
138
 
215
- ### CSS with TailwindCSS
216
-
217
- Use utility classes directly in templates:
139
+ If you add a `package.json` with a `scripts.build`, `rake build:assets` will run `npm run build`. If you do not, it copies `app/javascript/` into `dist/assets/javascripts/`.
218
140
 
219
- ```erb
220
- <div class="container mx-auto px-4">
221
- <h1 class="text-4xl font-bold text-gray-900">Hello World</h1>
222
- </div>
223
- ```
141
+ Set up your own bundler if needed and output to `dist/assets/javascripts/`. See setup guides:
142
+ - [ESBuild](guides/setup-esbuild.md)
143
+ - [Webpack](https://webpack.js.org/) - see webpack documentation
144
+ - [Vite](https://github.com/ElMassimo/vite_ruby) - see vite-plugin-ruby
224
145
 
225
- ### CSS with shadcn/ui
146
+ ### Adding CSS
226
147
 
227
- Install components and use them in your templates:
148
+ Write CSS in `app/assets/stylesheets/application.css`. Use any CSS tool you prefer:
228
149
 
229
- ```bash
230
- npx shadcn-ui@latest add button
231
- ```
150
+ - [Tailwind CSS](guides/setup-tailwind.md)
151
+ - PostCSS, Sass, Less, or any other CSS processor - just compile your CSS files to `dist/assets/stylesheets/` before building HTML.
232
152
 
233
153
  ### Generating Sitemaps
234
154
 
235
155
  Sitemap generation is automatically configured when you generate a new site. The `sitemap_generator` gem is included in the Gemfile, and `config/sitemap.rb` is automatically created.
236
156
 
237
- The sitemap is generated from your `PageHelpers::PAGES` metadata during `rake build:all`. Update `config/sitemap.rb` to set your domain:
157
+ The sitemap is automatically generated from all pages in `app/views/pages/` during `rake build:all`. Update `config/sitemap.rb` to set your domain:
238
158
 
239
159
  ```ruby
240
160
  SitemapGenerator::Sitemap.default_host = 'https://yourdomain.com'
241
161
  ```
242
162
 
243
- The sitemap will be generated in `dist/sitemaps/sitemap.xml.gz` during the build process.
163
+ You can customize priority, changefreq, and lastmod in `config/sitemap.rb`. The sitemap will be generated in `dist/sitemaps/sitemap.xml.gz` during the build process.
244
164
 
245
165
  ## Examples
246
166
 
247
- ### ERB + Importmap + Stimulus + TailwindCSS
167
+ ### Basic ERB Site
248
168
  ```bash
249
169
  static-site-builder new my-site
250
- # Choose: ERB, Importmap, TailwindCSS, Stimulus
251
170
  ```
252
171
 
253
- ### Phlex + ESBuild + React + shadcn
254
- ```bash
255
- static-site-builder new my-site
256
- # Choose: Phlex, ESBuild, shadcn/ui, React
257
- ```
172
+ ## Notable Projects
258
173
 
259
- ## Requirements
174
+ Sites built with Static Site Builder:
260
175
 
261
- ### For Importmap Projects
176
+ - **[lukaszczapiewski.com](https://lukaszczapiewski.com)** - Personal portfolio and blog
262
177
 
263
- When using **Importmap** as your JavaScript bundler:
178
+ **Your website?** Built with Static Site Builder? [Submit a PR](https://github.com/Ancez/static-site-builder) to add it here!
264
179
 
265
- 1. **Install npm dependencies**:
266
- ```bash
267
- npm install
268
- ```
180
+ ## Requirements
269
181
 
270
- 2. **Build your site** - vendor files are automatically copied from `node_modules` to `dist/assets/javascripts/` during the build:
271
- ```bash
272
- rake build:all
273
- ```
182
+ - Ruby 3.0+
183
+ - Bundler
274
184
 
275
- The build process automatically copies required vendor JavaScript files directly from `node_modules` to `dist/assets/javascripts/` based on your importmap configuration. No intermediate `vendor/javascript/` folder is needed.
185
+ Optional (if you want to use Tailwind CSS or JavaScript bundlers):
186
+ - Node.js and npm
276
187
 
277
188
  ## Development
278
189
 
@@ -283,7 +194,6 @@ After generating a site, you can run it locally with auto-rebuild and live reloa
283
194
  ```bash
284
195
  cd my-site
285
196
  bundle install
286
- npm install # Required for importmap projects and JS frameworks
287
197
 
288
198
  # Start development server (auto-rebuilds on file changes)
289
199
  rake dev:server
@@ -316,142 +226,12 @@ rake build:html
316
226
 
317
227
  The `dist/` directory contains your complete static site and can be deployed to any static hosting provider.
318
228
 
319
- ### Cloudflare Pages
320
-
321
- 1. **Connect your repository** to Cloudflare Pages in the Cloudflare dashboard
322
-
323
- 2. **Build settings**:
324
- - **Build command**: `bundle install && npm install && bundle exec rake build:all`
325
- - **Build output directory**: `dist`
326
- - **Root directory**: (leave empty or set to repository root)
327
-
328
- 3. **Environment variables** (if needed):
329
- - `RUBY_VERSION`: Set to your Ruby version (e.g., `3.4`)
330
- - `NODE_VERSION`: Set to your Node.js version (e.g., `24`)
331
-
332
- 4. **Deploy**: Cloudflare Pages will automatically build and deploy on every push to your main branch
333
-
334
- **Note**: Cloudflare Pages supports Ruby and Node.js builds. Ensure your `Gemfile` and `package.json` are properly configured.
335
-
336
- ### Vercel
337
-
338
- 1. **Install Vercel CLI** (optional):
339
- ```bash
340
- npm i -g vercel
341
- ```
342
-
343
- 2. **Deploy**:
344
- ```bash
345
- # Build locally first
346
- bundle install && npm install && bundle exec rake build:all
347
-
348
- # Deploy
349
- vercel --prod
350
- ```
351
-
352
- Or connect your repository in the Vercel dashboard with these settings:
353
- - **Build Command**: `bundle install && npm install && bundle exec rake build:all`
354
- - **Output Directory**: `dist`
355
- - **Install Command**: `bundle install && npm install`
356
-
357
- 3. **Configuration file** (optional `vercel.json`):
358
- ```json
359
- {
360
- "buildCommand": "bundle install && npm install && bundle exec rake build:all",
361
- "outputDirectory": "dist",
362
- "installCommand": "bundle install && npm install"
363
- }
364
- ```
365
-
366
- ### Netlify
367
-
368
- 1. **Create `netlify.toml`** in your project root:
369
- ```toml
370
- [build]
371
- command = "bundle install && npm install && bundle exec rake build:all"
372
- publish = "dist"
373
-
374
- [build.environment]
375
- RUBY_VERSION = "3.4"
376
- NODE_VERSION = "24"
377
- ```
378
-
379
- 2. **Deploy**:
380
- - Connect your repository in Netlify dashboard
381
- - Netlify will automatically detect `netlify.toml` and use those settings
382
- - Or use Netlify CLI: `netlify deploy --prod`
383
-
384
- ### GitHub Pages
385
-
386
- 1. **Using GitHub Actions** (recommended):
387
-
388
- Create `.github/workflows/deploy.yml`:
389
- ```yaml
390
- name: Deploy to GitHub Pages
391
-
392
- on:
393
- push:
394
- branches: [ main ]
395
-
396
- jobs:
397
- deploy:
398
- runs-on: ubuntu-latest
399
- steps:
400
- - uses: actions/checkout@v4
401
-
402
- - name: Set up Ruby
403
- uses: ruby/setup-ruby@v1
404
- with:
405
- ruby-version: 3.4
406
- bundler-cache: true
407
-
408
- - name: Set up Node.js
409
- uses: actions/setup-node@v4
410
- with:
411
- node-version: '24'
412
- cache: 'npm'
413
-
414
- - name: Install dependencies
415
- run: |
416
- bundle install
417
- npm install
418
-
419
- - name: Build site
420
- run: bundle exec rake build:all
421
- # Note: Vendor files will be automatically copied from node_modules during build
422
-
423
- - name: Deploy to GitHub Pages
424
- uses: peaceiris/actions-gh-pages@v4
425
- with:
426
- github_token: ${{ secrets.GITHUB_TOKEN }}
427
- publish_dir: ./dist
428
- ```
429
-
430
- 2. **Enable GitHub Pages** in your repository settings:
431
- - Go to Settings → Pages
432
- - Source: GitHub Actions
433
-
434
- ### Other Static Hosts
435
-
436
- For any static hosting provider (AWS S3, Azure Static Web Apps, etc.):
437
-
438
- 1. **Build locally**:
439
- ```bash
440
- bundle install
441
- npm install
442
- bundle exec rake build:all
443
- ```
444
-
445
- 2. **Upload `dist/` directory** to your hosting provider
446
-
447
- 3. **Configure** your host to serve from the `dist` directory
448
-
449
- ### CI/CD Considerations
450
-
451
- - **Vendor files**: Vendor files are automatically copied from `node_modules` to `dist/` during build - no vendor folder needed
452
- - **Dependencies**: Both Ruby (`Gemfile`) and Node.js (`package.json`) dependencies are needed for the build
453
- - **Build order**: Install dependencies → Build assets → Build HTML
454
- - **Ruby/Node versions**: Specify versions in your CI/CD configuration to ensure consistent builds
229
+ See deployment guides for specific platforms:
230
+ - [Cloudflare Pages](guides/deployment-cloudflare.md)
231
+ - [Vercel](guides/deployment-vercel.md)
232
+ - [Netlify](guides/deployment-netlify.md)
233
+ - [GitHub Pages](guides/deployment-github-pages.md)
234
+ - [Other Static Hosts](guides/deployment-other.md)
455
235
 
456
236
  ### Generator Development
457
237
 
@@ -500,10 +280,8 @@ This generator follows the Rails pattern:
500
280
  ## Contributing
501
281
 
502
282
  Contributions welcome! Especially:
503
- - New template engine support
504
- - New bundler integrations
505
- - New CSS framework setups
506
283
  - Documentation improvements
284
+ - New features and improvements
507
285
 
508
286
  ## License
509
287