Revert "Add support for ads.txt redirect"

This reverts commit f6c7c2d1af.

Ads.txt redirection can be done directly in core, in admin/customize/permalinks.
This commit is contained in:
Penar Musaraj 2019-01-29 16:02:02 -05:00
parent 4aa6da8913
commit 9172a8f405
3 changed files with 76 additions and 97 deletions

View File

@ -51,7 +51,6 @@ en:
adsense_post_bottom_ad_sizes: "Choose your ad size"
adsense_mobile_post_bottom_ad_size: "Choose your ad size"
adsense_nth_post_code: "Show an ad after every N posts, where N is this value."
adsense_ads_txt_url: "URL of ads.txt file."
amazon_through_trust_level: "Show your ads to users based on trust levels. Users with trust level higher than this value will not see ads."
amazon_topic_list_top_src_code: "Enter src code to display at topic list top location"

View File

@ -1,20 +1,20 @@
adsense_plugin:
adsense_publisher_code:
client: true
default: ""
default: ''
regex: '^[\d]*$'
adsense_through_trust_level:
client: true
default: 2
enum: "TrustLevelSetting"
enum: 'TrustLevelSetting'
adsense_topic_list_top_code:
client: true
default: ""
default: ''
max: 50
regex: '^[\d]*$'
adsense_topic_list_top_ad_sizes:
client: true
default: "728*90 - leaderboard"
default: '728*90 - leaderboard'
type: enum
choices: &adsense_choices
- responsive
@ -36,97 +36,94 @@ adsense_plugin:
- 690*250
adsense_mobile_topic_list_top_code:
client: true
default: ""
default: ''
max: 50
regex: '^[\d]*$'
adsense_mobile_topic_list_top_ad_size:
client: true
default: "responsive"
default: 'responsive'
type: enum
choices: *adsense_choices
adsense_topic_above_post_stream_code:
client: true
default: ""
default: ''
max: 50
regex: '^[\d]*$'
adsense_topic_above_post_stream_ad_sizes:
client: true
default: "728*90 - leaderboard"
default: '728*90 - leaderboard'
type: enum
choices: *adsense_choices
adsense_mobile_topic_above_post_stream_code:
client: true
default: ""
default: ''
max: 50
regex: '^[\d]*$'
adsense_mobile_topic_above_post_stream_ad_size:
client: true
default: "responsive"
default: 'responsive'
type: enum
choices: *adsense_choices
adsense_topic_above_suggested_code:
client: true
default: ""
default: ''
max: 50
regex: '^[\d]*$'
adsense_topic_above_suggested_ad_sizes:
client: true
default: "728*90 - leaderboard"
default: '728*90 - leaderboard'
type: enum
choices: *adsense_choices
adsense_mobile_topic_above_suggested_code:
client: true
default: ""
default: ''
max: 50
regex: '^[\d]*$'
adsense_mobile_topic_above_suggested_ad_size:
client: true
default: "responsive"
default: 'responsive'
type: enum
choices: *adsense_choices
adsense_post_bottom_code:
client: true
default: ""
default: ''
max: 50
regex: '^[\d]*$'
adsense_post_bottom_ad_sizes:
client: true
default: "728*90 - leaderboard"
default: '728*90 - leaderboard'
type: enum
choices: *adsense_choices
adsense_mobile_post_bottom_code:
client: true
default: ""
default: ''
max: 50
regex: '^[\d]*$'
adsense_mobile_post_bottom_ad_size:
client: true
default: "responsive"
default: 'responsive'
type: enum
choices: *adsense_choices
adsense_nth_post_code:
client: true
default: ""
default: ''
min: 1
adsense_ads_txt_url:
client: false
default: ""
dfp_plugin:
dfp_publisher_id:
client: true
default: ""
default: ''
dfp_through_trust_level:
client: true
default: 2
enum: "TrustLevelSetting"
enum: 'TrustLevelSetting'
dfp_topic_list_top_code:
client: true
default: ""
default: ''
max: 50
dfp_topic_list_top_ad_sizes:
client: true
default: "728*90 - leaderboard"
default: '728*90 - leaderboard'
type: enum
choices: &dfp_choices
- 728*90 - leaderboard
@ -164,102 +161,102 @@ dfp_plugin:
- 168*28
dfp_mobile_topic_list_top_code:
client: true
default: ""
default: ''
max: 50
dfp_mobile_topic_list_top_ad_sizes:
client: true
default: "320*50 - mobile leaderboard"
default: '320*50 - mobile leaderboard'
type: enum
choices: *dfp_choices
dfp_target_topic_list_top_key_code:
default: ""
default: ''
type: value_list
client: true
dfp_target_topic_list_top_value_code:
default: ""
default: ''
type: value_list
client: true
dfp_topic_above_post_stream_code:
client: true
default: ""
default: ''
max: 50
dfp_topic_above_post_stream_ad_sizes:
client: true
default: "728*90 - leaderboard"
default: '728*90 - leaderboard'
type: enum
choices: *dfp_choices
dfp_mobile_topic_above_post_stream_code:
client: true
default: ""
default: ''
max: 50
dfp_mobile_topic_above_post_stream_ad_sizes:
client: true
default: "320*50 - mobile leaderboard"
default: '320*50 - mobile leaderboard'
type: enum
choices: *dfp_choices
dfp_target_topic_above_post_stream_key_code:
default: ""
default: ''
type: value_list
client: true
dfp_target_topic_above_post_stream_value_code:
default: ""
default: ''
type: value_list
client: true
dfp_topic_above_suggested_code:
client: true
default: ""
default: ''
max: 50
dfp_topic_above_suggested_ad_sizes:
client: true
default: "728*90 - leaderboard"
default: '728*90 - leaderboard'
type: enum
choices: *dfp_choices
dfp_mobile_topic_above_suggested_code:
client: true
default: ""
default: ''
max: 50
dfp_mobile_topic_above_suggested_ad_sizes:
client: true
default: "320*50 - mobile leaderboard"
default: '320*50 - mobile leaderboard'
type: enum
choices: *dfp_choices
dfp_target_topic_above_suggested_key_code:
default: ""
default: ''
type: value_list
client: true
dfp_target_topic_above_suggested_value_code:
default: ""
default: ''
type: value_list
client: true
max: 50
dfp_nth_post_code:
client: true
default: ""
default: ''
min: 1
dfp_post_bottom_code:
client: true
default: ""
default: ''
max: 50
dfp_post_bottom_ad_sizes:
client: true
default: "728*90 - leaderboard"
default: '728*90 - leaderboard'
type: enum
choices: *dfp_choices
dfp_mobile_post_bottom_code:
client: true
default: ""
default: ''
max: 50
dfp_mobile_post_bottom_ad_sizes:
client: true
default: "320*50 - mobile leaderboard"
default: '320*50 - mobile leaderboard'
type: enum
choices: *dfp_choices
dfp_target_post_bottom_key_code:
default: ""
default: ''
type: value_list
client: true
dfp_target_post_bottom_value_code:
default: ""
default: ''
type: value_list
client: true
@ -267,98 +264,98 @@ amazon_plugin:
amazon_through_trust_level:
client: true
default: 2
enum: "TrustLevelSetting"
enum: 'TrustLevelSetting'
amazon_topic_list_top_src_code:
client: true
default: ""
default: ''
amazon_topic_list_top_ad_width_code:
client: true
default: ""
default: ''
amazon_topic_list_top_ad_height_code:
client: true
default: ""
default: ''
amazon_mobile_topic_list_top_src_code:
client: true
default: ""
default: ''
amazon_mobile_topic_list_top_ad_width_code:
client: true
default: ""
default: ''
amazon_mobile_topic_list_top_ad_height_code:
client: true
default: ""
default: ''
amazon_topic_above_post_stream_src_code:
client: true
default: ""
default: ''
amazon_topic_above_post_stream_ad_width_code:
client: true
default: ""
default: ''
amazon_topic_above_post_stream_ad_height_code:
client: true
default: ""
default: ''
amazon_mobile_topic_above_post_stream_src_code:
client: true
default: ""
default: ''
amazon_mobile_topic_above_post_stream_ad_width_code:
client: true
default: ""
default: ''
amazon_mobile_topic_above_post_stream_ad_height_code:
client: true
default: ""
default: ''
amazon_topic_above_suggested_src_code:
client: true
default: ""
default: ''
amazon_topic_above_suggested_ad_width_code:
client: true
default: ""
default: ''
amazon_topic_above_suggested_ad_height_code:
client: true
default: ""
default: ''
amazon_mobile_topic_above_suggested_src_code:
client: true
default: ""
default: ''
amazon_mobile_topic_above_suggested_ad_width_code:
client: true
default: ""
default: ''
amazon_mobile_topic_above_suggested_ad_height_code:
client: true
default: ""
default: ''
amazon_post_bottom_src_code:
client: true
default: ""
default: ''
amazon_nth_post_code:
client: true
default: ""
default: ''
min: 1
amazon_post_bottom_ad_width_code:
client: true
default: ""
default: ''
amazon_post_bottom_ad_height_code:
client: true
default: ""
default: ''
amazon_mobile_post_bottom_src_code:
client: true
default: ""
default: ''
amazon_mobile_post_bottom_ad_width_code:
client: true
default: ""
default: ''
amazon_mobile_post_bottom_ad_height_code:
client: true
default: ""
default: ''
codefund_plugin:
codefund_property_id:
client: true
default: ""
default: ''
codefund_advertiser_label:
client: true
default: "Advertiser"
default: 'Advertiser'
codefund_advertiser_short_label:
client: true
default: "Ad"
default: 'Ad'
codefund_through_trust_level:
client: true
default: 2
enum: "TrustLevelSetting"
enum: 'TrustLevelSetting'
codefund_nth_post:
client: true
default: 4

View File

@ -176,20 +176,3 @@ and (max-width : 775px) {
}
CSS
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_url.present?
redirect_to SiteSetting.adsense_ads_txt_url
end
end
Discourse::Application.routes.append do
get '/ads.txt' => "adstxt#index"
end
end