2020-10-07 20:48:38 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# name: styleguide
|
|
|
|
# about: Preview how Widgets are Styled in Discourse
|
|
|
|
# version: 0.2
|
|
|
|
# author: Robin Ward
|
|
|
|
|
|
|
|
register_asset "stylesheets/styleguide.scss"
|
|
|
|
enabled_site_setting :styleguide_enabled
|
|
|
|
|
|
|
|
load File.expand_path("../lib/styleguide/engine.rb", __FILE__)
|
|
|
|
|
|
|
|
Discourse::Application.routes.append { mount ::Styleguide::Engine, at: "/styleguide" }
|
2020-10-14 22:29:40 +08:00
|
|
|
|
|
|
|
after_initialize do
|
2021-04-23 22:24:42 +08:00
|
|
|
register_asset_filter do |type, request, opts|
|
2021-05-09 08:08:12 +08:00
|
|
|
(opts[:path] || "").start_with?("#{Discourse.base_path}/styleguide")
|
2020-10-14 22:29:40 +08:00
|
|
|
end
|
|
|
|
end
|