Start a new Perron-powered site
Perron is a Rails-based static site generator—start a new site easily
Used 0 times
E
Eelco from Rails Designer
Usage
Perron is Rails-based Static Site Generator. Create static sites with the framework you love. ❤️
This template was taken from the official docs site.
Start your next site by running this command:
This template was taken from the official docs site.
Start your next site by running this command:
rails new MyNewSite --minimal -T -O -m https://railsbytes.com/script/VQLsND
Run this command in your Rails app directory in the terminal:
rails app:template LOCATION="https://railsbytes.com/script/VQLsND"
Template Source
Review the code before running this template on your machine.
gsub_file "Gemfile", /gem "sqlite3".*$/, ""
gsub_file "Gemfile", /gem "activerecord".*$/, ""
remove_file "config/database.yml"
remove_file "config/credentials.yml.enc"
remove_file "config/master.key"
run "rm -r app/views/pwa"
# Remove PWA-related lines from application layout
gsub_file "app/views/layouts/application.html.erb", /^\s*<meta name="apple-mobile-web-app-capable" content="yes">\n/, ""
gsub_file "app/views/layouts/application.html.erb", /^\s*<meta name="mobile-web-app-capable" content="yes">\n/, ""
gsub_file "app/views/layouts/application.html.erb", /^\s*<%# Enable PWA manifest for installable apps \(make sure to enable in config\/routes\.rb too!\) %>\n/, ""
gsub_file "app/views/layouts/application.html.erb", /^\s*<%#= tag\.link rel: "manifest", href: pwa_manifest_path\(format: :json\) %>\n/, ""
append_to_file ".gitignore", "/output/\n"
gem "perron"
after_bundle do
rails_command("generate perron:install")
end
remove_file "README.md"
create_file "README.md", <<~MARKDOWN
# My New Site
TBD
## Development
```
bin/dev
```
## Deploy/publish
```
RAILS_ENV=production rails perron:build
```
MARKDOWN