Sha256: 45f453232fb2a5b2d97abe331cc076def27f049923b75fca60fff121831e86c5
Contents?: true
Size: 729 Bytes
Versions: 2
Compression:
Stored size: 729 Bytes
Contents
# frozen_string_literal: true require 'sinatra/base' module Trifle module Docs class App < Sinatra::Base configure do set :bind, '0.0.0.0' set :views, proc { Trifle::Docs.default.templates } end get '/*' do url = params['splat'].first.chomp('/') meta = Trifle::Docs.meta(url: url) if meta['type'] == 'file' send_file meta['path'] else erb (meta['template'] || 'page').to_sym, {}, { sitemap: Trifle::Docs.sitemap, collection: Trifle::Docs.collection(url: url), content: Trifle::Docs.content(url: url), meta: meta, url: url } end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
trifle-docs-0.1.1 | lib/trifle/docs/app.rb |
trifle-docs-0.1.0 | lib/trifle/docs/app.rb |