{{ message }}
Repository navigation
Add start_time and end_time in page.meta
#77
joapuiib
started this conversation in
Show and tell
Replies: 2 comments
|
@unverbuggt Is there any easy way of extending default plugin behavior without having to have a custom version of the plugin? |
0 replies
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Discussion started on #72.
I've modified this plugin to control in which time range can each page be decrypted, using the attributes
start_timeandend_timein eachpage.meta.Basically, I've added a
<div id="mkdocs-encrypted-config">with a dictionary of config options, which includesstart_timeandend_time. The dictionary is encrypted with the same key as the content page.In the decryption process, I decrypt the config and I check if the current time is between that time range. If so, I let the page be decrypted.
The code is available at: https://github.com/joapuiib/mkdocs-encryptcontent-plugin/tree/feature/time-range
This doesn't provide any kind of added security. It wouldn't be hard to bypass with JS if you know the password of the page, but I think this is enough for me at the moment.
If anyone wants to try to improve it, any help is welcome.
All reactions