mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
fix onebox for your own site
This commit is contained in:
@@ -19,7 +19,6 @@ module Oneboxer
|
||||
result['description'] = node['content'] if node
|
||||
end
|
||||
|
||||
|
||||
result
|
||||
end
|
||||
end
|
||||
|
@@ -8,8 +8,8 @@ module Oneboxer
|
||||
attr_accessor :regexp
|
||||
attr_accessor :favicon_file
|
||||
|
||||
def matcher(regexp)
|
||||
self.regexp = regexp
|
||||
def matcher(regexp=nil,&blk)
|
||||
self.regexp = regexp || blk
|
||||
end
|
||||
|
||||
def favicon(favicon_file)
|
||||
|
@@ -5,8 +5,9 @@ module Oneboxer
|
||||
class DiscourseOnebox < BaseOnebox
|
||||
include ActionView::Helpers::DateHelper
|
||||
|
||||
# TODO: we need to remove these hardcoded urls ASAP
|
||||
matcher /^https?\:\/\/(dev.discourse.org|localhost\:3000|l.discourse|discuss.emberjs.com)\/.*$/
|
||||
matcher do
|
||||
Regexp.new "^#{Discourse.base_url.gsub(".","\\.")}.*$", true
|
||||
end
|
||||
|
||||
def onebox
|
||||
uri = URI::parse(@url)
|
||||
|
Reference in New Issue
Block a user