Skip to content

Commit a3350fd

Browse files
committed
wait... Config variables are overwritten on multiple places, this is not very clean.
1 parent c221a9c commit a3350fd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

encryptcontent/plugin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,6 @@ def on_config(self, config, **kwargs):
193193
var=str(self.config['use_secret']))
194194
)
195195
os._exit(1) # prevent build without password to avoid leak
196-
# Set global password as default password for each page
197-
self.config['password'] = self.config['global_password']
198196
# Check if hljs feature need to be enabled, based on theme configuration
199197
if ('highlightjs' in config['theme']._vars
200198
and config['theme']._vars['highlightjs'] # noqa: W503
@@ -290,6 +288,9 @@ def on_page_markdown(self, markdown, page, config, **kwargs):
290288
:return: Markdown source text of page as string
291289
"""
292290

291+
# Set global password as default password for each page
292+
self.config['password'] = self.config['global_password']
293+
293294
if 'password' in page.meta.keys():
294295
# If global_password is set, but you don't want to encrypt content
295296
page_password = str(page.meta.get('password'))

0 commit comments

Comments
 (0)