Add a metadata page for inspecting configuration.
This is another metadata page that uses the new configuration system to show all the available options, their current values, and their defaults. This is still unstyled, but the info is there. I still need to add on a method for extensions to register their configuration with the global config so they show up (stuff like blog) but this is a start.
This commit is contained in:
parent
52c4677391
commit
d6110e2ff1
5 changed files with 53 additions and 3 deletions
|
@ -171,12 +171,20 @@ module Middleman
|
|||
def dup
|
||||
copy = ConfigurationManager.new
|
||||
@settings.each do |key, setting|
|
||||
copy_setting = copy.define_setting setting.key, setting.default, setting.description
|
||||
copy_setting = copy.define_setting(setting.key, setting.default, setting.description)
|
||||
copy_setting.value = setting.value if setting.value_set?
|
||||
end
|
||||
copy
|
||||
end
|
||||
|
||||
# Load in a list of settings
|
||||
def load_settings(other_settings)
|
||||
other_settings.each do |setting|
|
||||
new_setting = define_setting(setting.key, setting.default, setting.description)
|
||||
new_setting.value = setting.value if setting.value_set?
|
||||
end
|
||||
end
|
||||
|
||||
def to_h
|
||||
hash = {}
|
||||
@settings.each do |key, setting|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue