2020-10-07 14:48:38 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# name: styleguide
|
|
|
|
# about: Preview how Widgets are Styled in Discourse
|
2023-11-21 09:37:11 +10:00
|
|
|
# meta_topic_id: 167293
|
2020-10-07 14:48:38 +02:00
|
|
|
# version: 0.2
|
|
|
|
# author: Robin Ward
|
|
|
|
|
|
|
|
register_asset "stylesheets/styleguide.scss"
|
|
|
|
enabled_site_setting :styleguide_enabled
|
2023-08-31 10:01:01 +10:00
|
|
|
hide_plugin
|
2020-10-07 14:48:38 +02:00
|
|
|
|
2024-02-01 17:28:10 +01:00
|
|
|
require_relative "lib/styleguide/engine"
|
2020-10-07 14:48:38 +02:00
|
|
|
|
|
|
|
Discourse::Application.routes.append { mount ::Styleguide::Engine, at: "/styleguide" }
|
2020-10-14 16:29:40 +02:00
|
|
|
|
|
|
|
after_initialize do
|
2021-04-23 10:24:42 -04:00
|
|
|
register_asset_filter do |type, request, opts|
|
2021-05-08 14:08:12 -10:00
|
|
|
(opts[:path] || "").start_with?("#{Discourse.base_path}/styleguide")
|
2020-10-14 16:29:40 +02:00
|
|
|
end
|
|
|
|
end
|