Skip to content

Commit cfbbc4c

Browse files
committed
search_index handling should be redone.
1 parent a01faf7 commit cfbbc4c

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
@@ -427,6 +427,7 @@ def on_post_page(self, output_content, page, config, **kwargs):
427427
delattr(page, 'decrypt_form')
428428
output_content = str(soup)
429429

430+
#TODO: Move search index processing to on_post_build to be less likely to fail due to incompatible search plugins
430431
if hasattr(page, 'encrypted'):
431432
#encrypt or exclude encrypted pages from search_index.json
432433
for plugin in config['plugins']:
@@ -462,8 +463,8 @@ def on_post_page(self, output_content, page, config, **kwargs):
462463
config['plugins'][plugin].search_index.entries = search_entries
463464

464465
except:
465-
logger.error('Could not encrypt search index of "' + page.title + '" for "' + plugin+ '" plugin!')
466-
466+
logger.error('Could not encrypt search index of "' + page.title + '" for "' + plugin+ '" plugin! Abort !')
467+
os._exit(1) # prevent build with possible plaintext in search_index
467468
return output_content
468469

469470
def on_post_build(self, config, **kwargs):

0 commit comments

Comments
 (0)