mirror of
https://github.com/discourse/discourse.git
synced 2024-12-24 12:46:30 +08:00
f7d7092a7a
The lastest version of rubocop-discourse enables rules regarding plugins.
22 lines
545 B
Ruby
22 lines
545 B
Ruby
# frozen_string_literal: true
|
|
|
|
# name: styleguide
|
|
# about: Preview how Widgets are Styled in Discourse
|
|
# meta_topic_id: 167293
|
|
# version: 0.2
|
|
# author: Robin Ward
|
|
|
|
register_asset "stylesheets/styleguide.scss"
|
|
enabled_site_setting :styleguide_enabled
|
|
hide_plugin
|
|
|
|
require_relative "lib/styleguide/engine"
|
|
|
|
Discourse::Application.routes.append { mount ::Styleguide::Engine, at: "/styleguide" }
|
|
|
|
after_initialize do
|
|
register_asset_filter do |type, request, opts|
|
|
(opts[:path] || "").start_with?("#{Discourse.base_path}/styleguide")
|
|
end
|
|
end
|