Update plugin skeleton with plugin name

This commit is contained in:
2026-09-26 16:22:20 +02:00
parent d902dfa8c4
commit ce3b6ffb78
7 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
# **Plugin Name** Plugin
# **Hledger** Plugin
**Plugin Summary**
@@ -1,6 +1,6 @@
# frozen_string_literal: true
module ::MyPluginModule
module ::Hledger
class ExamplesController < ::ApplicationController
requires_plugin PLUGIN_NAME
+2 -2
View File
@@ -3,7 +3,7 @@ en:
admin:
site_settings:
categories:
TODO_plugin_name: "Plugin Name"
hledger: "Hledger"
js:
discourse_plugin_name:
hledger:
placeholder: placeholder
+2 -2
View File
@@ -1,8 +1,8 @@
# frozen_string_literal: true
MyPluginModule::Engine.routes.draw do
Hledger::Engine.routes.draw do
get "/examples" => "examples#index"
# define routes here
end
Discourse::Application.routes.draw { mount ::MyPluginModule::Engine, at: "my-plugin" }
Discourse::Application.routes.draw { mount ::Hledger::Engine, at: "hledger" }
+2 -2
View File
@@ -1,4 +1,4 @@
TODO_plugin_name:
plugin_name_enabled:
hledger:
hledger_enabled:
default: false
client: true
@@ -1,9 +1,9 @@
# frozen_string_literal: true
module ::MyPluginModule
module ::Hledger
class Engine < ::Rails::Engine
engine_name PLUGIN_NAME
isolate_namespace MyPluginModule
isolate_namespace Hledger
config.autoload_paths << File.join(config.root, "lib")
scheduled_job_dir = "#{config.root}/app/jobs/scheduled"
config.to_prepare do
+5 -5
View File
@@ -1,6 +1,6 @@
# frozen_string_literal: true
# name: discourse-plugin-name
# name: hledger
# about: TODO
# meta_topic_id: TODO
# version: 0.0.1
@@ -8,13 +8,13 @@
# url: TODO
# required_version: 2.7.0
enabled_site_setting :plugin_name_enabled
enabled_site_setting :hledger_enabled
module ::MyPluginModule
PLUGIN_NAME = "discourse-plugin-name"
module ::Hledger
PLUGIN_NAME = "hledger"
end
require_relative "lib/my_plugin_module/engine"
require_relative "lib/hledger/engine"
after_initialize do
# Code which should run after Rails has finished booting