Renaming plugin.
This commit is contained in:
20
plugin.rb
20
plugin.rb
@@ -1,32 +1,32 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# name: discourse-url-to-article
|
||||
# name: discourse-bookmark-url
|
||||
# about: Scrapes a URL pasted into the topic title and populates the composer body with the article content
|
||||
# version: 0.1.0
|
||||
# authors: Robert Johnson
|
||||
# url: https://code.draft13.com/robert/discourse-url-to-article
|
||||
# url: https://code.draft13.com/robert/discourse-bookmark-url
|
||||
|
||||
enabled_site_setting :url_to_article_enabled
|
||||
enabled_site_setting :bookmark_url_enabled
|
||||
|
||||
after_initialize do
|
||||
require_relative "lib/url_to_article/article_extractor"
|
||||
require_relative "lib/bookmark_url/article_extractor"
|
||||
|
||||
module ::UrlToArticle
|
||||
PLUGIN_NAME = "discourse-url-to-article"
|
||||
module ::BookmarkUrl
|
||||
PLUGIN_NAME = "discourse-bookmark-url"
|
||||
|
||||
class Engine < ::Rails::Engine
|
||||
engine_name PLUGIN_NAME
|
||||
isolate_namespace UrlToArticle
|
||||
isolate_namespace BookmarkUrl
|
||||
end
|
||||
end
|
||||
|
||||
require_relative "app/controllers/url_to_article/articles_controller"
|
||||
require_relative "app/controllers/bookmark_url/articles_controller"
|
||||
|
||||
UrlToArticle::Engine.routes.draw do
|
||||
BookmarkUrl::Engine.routes.draw do
|
||||
post "/extract" => "articles#extract"
|
||||
end
|
||||
|
||||
Discourse::Application.routes.append do
|
||||
mount UrlToArticle::Engine, at: "/url-to-article"
|
||||
mount BookmarkUrl::Engine, at: "/bookmark-url"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user