discourse/plugins/styleguide/plugin.rb
Jarek Radosz 624c684d51
DEV: Transpile all plugin js by default (#17175)
Goodbye `# transpile_js: true`? 🙂
2022-06-21 22:07:10 +02:00

22 lines
536 B
Ruby

# 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 do
mount ::Styleguide::Engine, at: '/styleguide'
end
after_initialize do
register_asset_filter do |type, request, opts|
(opts[:path] || '').start_with?("#{Discourse.base_path}/styleguide")
end
end