8000
Co-authored-by: turgs <1312348+turgs@users.noreply.github.com>
Co-authored-by: turgs <1312348+turgs@users.noreply.github.com>
@copilot I'm new to sitepress. Never used it or static site generators. I have a Rails SaaS app that users register and login to. That all exists on a subdomain like I need a sales site at the domain root |
Sitepress is perfect for your use case! You can create static sites for different subdomains while keeping your main Rails SaaS app separate. For your setup:
With the changes in this PR, you can now use sitepress without any build tools. You'd typically:
The importmap approach means no npm/webpack complexity - just pure Rails conventions for your static sites. |
@copilot How do I setup and deploy each site though? I want to use kamal 2 to deploy each. I'll be using Binary Lane host |
For your setup with Kamal 2 and Binary Lane, you have a few approaches: Option 1: Standalone Sitepress Sites (Recommended)
# Sales site
sitepress new sales-site
cd sales-site
# Configure pages in pages/ directory
# Help site
sitepress new help-site
cd help-site
# Move your /docs content to pages/ directory
FROM ruby:3.2
WORKDIR /app
COPY Gemfile* ./
RUN bundle install
COPY . .
EXPOSE 8080
CMD ["sitepress", "server", "--bind-address", "0.0.0.0"]
service: sales-site # or help-site
image: your-registry/sales-site
servers:
- your-binary-lane-ip
env:
secret:
- RAILS_MASTER_KEY
proxy:
host: example.com # or help.example.com Option 2: Static Compilation + Nginx
Deploy each with: Which approach interests you more? |
@copilot I need to be able to use hotwire turbo stimulus and tailwind with this |
Co-authored-by: turgs <1312348+turgs@users.noreply.github.com>
Perfect! I've just added complete Hotwire (Turbo + Stimulus) and Tailwind CSS support to the no-build setup. What's included (commit 6ccc251): Quick example: <div data-controller="hello" class="bg-blue-500 text-white p-4 rounded">
<button data-action="click->hello#greet" class="hover:bg-blue-600">
Click me!
</button>
</div> All dependencies are managed through importmaps - no npm/webpack needed. For production, you can use Tailwind's standalone CLI or the tailwindcss-rails gem. Check the demo and guide for full examples! |
@copilot We want to be able to use |
No special configuration needed! I've added full Key points:
The setup includes Tailwind config files, source CSS, and a build script. Check the updated |
This PR implements a complete "no build" approach for Sitepress using Rails 8 defaults with importmaps and propshaft, eliminating the need for npm/node as local dependencies.
Changes Made
Core Dependencies
sitepress-rails.gemspec
Dummy Application Updates
config/application.rb
config/importmap.rb
for JavaScript import managementapplication.js
to remove sprockets directivesEngine Configuration
Benefits
✅ No build step required - Assets are served directly without compilation
✅ No npm/node dependencies - JavaScript managed through importmaps
✅ SQLite database - Maintained existing Rails defaults
✅ Faster development - No asset compilation during development
✅ Rails 8 ready - Uses modern Rails conventions
Testing
Added comprehensive test suite to verify:
All existing tests continue to pass, ensuring backward compatibility.
Example Usage
With these changes, a typical sitepress application now works with zero build configuration:
The implementation successfully transitions Sitepress to embrace Rails 8's philosophy of simplicity and reduced tooling complexity.
Fixes #1.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.