Password Protected Posts & Code Highlighting #2511
cesar-guillen
started this conversation in
Ideas
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I have been using Chirpy as my blog them for some time and I have worked on two features. I was looking forward to get some feedback on them.
The source code and detailed explanations for both features can be found in the following repositories:
The first feature is a simple plugin that can be used to highlight text inside of code blocks. It acts as a simpler version of the Jekyll tag

{% highlight %}
which is not compatible with Chirpy . An example of this feature can be found below:The second feature enables you to protect specific posts with a password. This tool contains:
I found the issue of not having password protected content being mentioned in another
.
Since it is a static site, there is no server-side authentication and any JavaScript can be reversed engineered. I found that this solution works well at dealing with these problems.
With this setup, you can keep selected posts private even if your GitHub Pages repository is public. At no point will the raw Markdown or generated content be exposed in plaintext.
An example of the UI can be found below:

Once the correct password is entered the post content is decrypted and the page is rendered like any other:

Thank you for reading! Again any type of feedback is welcome.
Beta Was this translation helpful? Give feedback.
All reactions