2015-07-24 00:01:47 -04:00
|
|
|
# name: discourse-adplugin
|
2015-08-31 20:28:47 -04:00
|
|
|
# about: Ad Plugin for Discourse
|
2019-04-07 09:55:55 -04:00
|
|
|
# version: 1.1.0
|
2015-08-31 20:28:47 -04:00
|
|
|
# authors: Vi and Sarah (@ladydanger and @cyberkoi)
|
2017-04-26 00:43:04 -04:00
|
|
|
# url: https://github.com/discourse/discourse-adplugin
|
2015-07-24 00:01:47 -04:00
|
|
|
|
2019-02-01 13:46:11 -05:00
|
|
|
register_asset "stylesheets/adplugin.scss"
|
2019-02-04 16:14:43 -05:00
|
|
|
|
|
|
|
after_initialize do
|
|
|
|
require_dependency 'application_controller'
|
|
|
|
class ::AdstxtController < ::ApplicationController
|
|
|
|
skip_before_action :check_xhr
|
|
|
|
|
|
|
|
def index
|
|
|
|
raise Discourse::NotFound unless SiteSetting.adsense_ads_txt.present?
|
|
|
|
|
|
|
|
render plain: SiteSetting.adsense_ads_txt
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Discourse::Application.routes.append do
|
|
|
|
get '/ads.txt' => "adstxt#index"
|
|
|
|
end
|
|
|
|
end
|