Encrypted and password protected pages on Jekyll

Custom plugin

This is a custom plugin for Jekyll to create AES256 CBC encrypted pages that can be decrypted on-the-fly in the browser with a password.

Enable collection in Jekyll config file

File: _config.yml

[...]

collections:
  - protected

[...]

All the protected pages live in _protected/.

Plugin

File: /_plugins/protector.rb

Encrypted page template

File: _layouts/protected.html

This template prompts the user to insert a password and tries to decrypt the page content with the given password. Password protected page prompt example

Protected page example

File: _protected/example-protected-page.md

---
title: Example protected page
password: s00pers3cr3t
---

# This content is served encrypted

You can use *markdown* as always.

Published page

The protected page will be available at /protected/example-protected-page after rendering.