
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Pluggable, portable, framework-friendly static site generator. Setting the Stage for the Ruby CMS.
sudo gem install broadway
rake test
Everything uses relative paths from the site root.
.
|-- _config.yml
|-- _layouts
|-- _posts (generated output)
|-- _site (github's place)
|-- _source (sinatra application for development)
| |-- files (blog files to-be published)
| |-- posts (blog files)
| |-- lib (sinatra helpers)
| `-- public (sinatra public directory)
|-- shared (javascripts, css, media, etc.)
|-- index.html
|-- robots.txt (what google should ignore)
`-- sitemap.xml (google's sitemap from jekyll)
If you want to use this entirely as a web server, run this at your source root:
broadway
If you want to use it inside of Sinatra or Rails, create the site manually:
site = Broadway.build!
Broadway uses Site, Post, Asset, File, Link, Slug, and Configuration to solve pretty much everything for creating a fully featured site using just Textmate.
The Site
is basically the static database.
_config.yml
file from a directory.File
objects out of the directory tree.Files
into Posts
with slugs, tags, categories, and dates if they fit the profile.Assets
from within Posts
.Links
.site = Broadway::Site.new
# dynamic finders
site.(models) #=> array of all models
site.find_(model)_by_(property)(value) #=> first model matching property value
site.find_(models)_by_(property)(value) #=> all models matching property value
site.find_(model)(attributes) #=> first model matching attributes
site.find_(models)(attributes) #=> all models matching attributes
site.(model)_roots #=> all hierarchical models without a parent
The Post
works just like the other static site generators, it is the content input.
metadata
(YAML header) which defines (nested) key-value attributes.Slug
based on the folder structure, title, date, and is customizable.tags
defined by metadata
, which can be scoped (e.g tags by "skill" vs. "favorite")categories
based on the folder structure.kind
, specifying how the post should be treated (currently post
or page
).children
if it is a page
.Assets
defined by metadata
, if desired.date
if a) its title was formatted like yyyy-mm-dd-title.extension
, or b) metadata has defined a date
attribute.post = site.posts.first #=> e.g...
post.tags #=> ["ruby", "sinatra", "rails"]
post.categories #=> ["path", "to", "post"]
post.assets #=> array of Asset objects, if defined
post.file #=> associate file object, where all calculations are based
post.slug #=> slug calculation object
post.path #=> "/path/to/post"
post.url #=> "http://site.com/path/to/post"
post.kind #=> "page" or "post" (or whatever you define)
post.children #=> array of Post objects, if it's a "page"
post.title
post.data #=> access to everything in the yaml header
The Configuration
object is defined from _config.yml
in the Broadway Site root.
c("path.to.attribute")
.There are plenty of static site generators out there: Jekyll, Webby, Nanoc, StaticMatic, Middleman, Mercury, Frank, DynamicMatic, WebGen, Pekky, Awestruct, Massimo, Toto... The problem with them is that they are completely separate frameworks from Sinatra and Rails. They're not meant to be used with either of those. It's a lot of work to integrate them.
Broadway makes Rails and Sinatra static-compatible.
Why integrate static sites with Rails and Sinatra?
Here is a Sinatra + Broadway Example App.
Below is a description on how you might setup a Sinatra app to be themeable and run via markdown files. TODO.
Create a folder called shared/themes/my-theme-name. In there, create folders for html, touch, and flash. In the html folder, you need the following
.
|-- index.haml # home page (layout.haml is somewhere else entirely)
|-- about
|-- blog
|-- features
|-- demos
|-- download
|-- support
|-- community
|-- shared
| |-- stylesheets
| |-- javascripts
| |-- images
| `-- partials
| |-- _head.haml
| `-- _header.haml
FAQs
Unknown package
We found that broadway demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.