Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

sinatra-static

> 编程语言
Open source

Turn your sinatra app into a static website

100 stars0 likes1 views
WebsiteGitHub

About

Turn your sinatra app into a static website

= sinatra-static

export your sinatra app to a directory of static files. requires "sinatra-advanced-routes". get requests and response-status 200 only (no redirects). you also have to copy the public-dir yourself (if you're using it).

== usage

require 'sinatra_static'

builder = SinatraStatic.new(MySinatraApp) builder.build!('/Users/paul/my_static_site')

= example

this simple app:

require 'sinatra' require "sinatra/advanced_routes" require 'sinatra_static'

class MyApp::App "my homepage" ~/my_static_site/blog/index.html -> "blog index" ~/my_static_site/blog/ajax.html -> "blog index w/o layout" ~/my_static_site/blog/page1/index.html -> "blog page: page1" ~/my_static_site/blog/page2/index.html -> "blog page: page2" ~/my_static_site/blog/page3/index.html -> "blog page: page3" ~/my_static_site/dynamic.js -> "my generated javascript" ~/my_static_site/data.json -> "my generated json"

= installation

gem install sinatra-static

or in your Gemfile

gem 'sinatra-static', '>= 0.1.1'

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Ruby

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言