Skip to content

Commit

Permalink
Fix nikola default_config (remove hacky init access)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kwpolska committed Jan 10, 2024
1 parent 6182703 commit d4a3c71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Bugfixes
* Fix margins of paragraphs at the end of sections (Issue #3704)
* Ignore ``.DS_Store`` files in listing indexes (Issue #3698)
* Fix baguetteBox.js invoking in the base theme (Issue #3687)
* Fix development (preview) server `nikola auto`
* Fix development (preview) server ``nikola auto``
for non-root SITE_URL, in particular when URL_TYPE is full_path.
(Issue #3715)

Expand Down
7 changes: 5 additions & 2 deletions nikola/plugins/command/default_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ class CommandShowConfig(Command):

def _execute(self, options=None, args=None):
"""Show the default configuration."""
init_plugin = self.site.plugin_manager.get_plugin_by_name("init", "Command").plugin_object
config = init_plugin.create_configuration_to_string()

try:
print(nikola.plugins.command.init.CommandInit.create_configuration_to_string())
print(config)
except Exception:
sys.stdout.buffer.write(nikola.plugins.command.init.CommandInit.create_configuration_to_string().encode('utf-8'))
sys.stdout.buffer.write(config.encode('utf-8'))

0 comments on commit d4a3c71

Please sign in to comment.