Module: Roda::RodaPlugins::BridgetownRoutes
- Defined in:
- bridgetown-routes/lib/roda/plugins/bridgetown_routes.rb
Defined Under Namespace
Modules: InstanceMethods, RequestMethods, ResponseMethods
Class Method Summary
collapse
Class Method Details
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'bridgetown-routes/lib/roda/plugins/bridgetown_routes.rb', line 11
def self.configure(app, _opts = {})
app.root_hook do
routes_dir = File.expand_path(
bridgetown_site.config.routes.source_paths.first,
bridgetown_site.config.source
)
file = routes_manifest.glob_routes(routes_dir, "index").first
next unless file
run_file_route(file, slug: "index")
end
if app.opts[:bridgetown_site]
app.opts[:routes_manifest] ||=
Bridgetown::Routes::Manifest.new(app.opts[:bridgetown_site])
return
end
raise "Roda app failure: the bridgetown_ssr plugin must be registered before " \
"bridgetown_routes"
end
|
.load_dependencies(app) ⇒ Object
6
7
8
9
|
# File 'bridgetown-routes/lib/roda/plugins/bridgetown_routes.rb', line 6
def self.load_dependencies(app)
app.plugin :slash_path_empty app.plugin :placeholder_string_matchers
end
|