Jekyll website with Staticrypt protected post, Where to put the encrypted.html?

Viewed 232

I'm using Jekyll for my blog. I want to protect some blog post with a password and I've decided to use Staticrypt.

I can encrypt the index.htmlpage of one of my blog post with the Staticryp CLI and my custom password_template.html. It outputs a index_encrypted.html.

My question is: Where do I put the index_encrypted.html? I can't add it to the _site since Jekyll return the build to default everytime I serve it.

I tried adding the index_encrypted.html to the _includes folder and calling the page from the .md post like this:

{% include index_encrypted.html %} but this just break the page.

Thank you!

1 Answers

I figured out how to do it.

Here's what I did:

  1. Put the index_encrypted.html in _includes and _layouts

  2. Add a permalink: /index_encrypted.html in front matter of the .md post you're targetting.

  3. Add a layout: index_encrypted in front matter of the .md post you're targetting.

  4. Delete the whole markdown content of the .md post.

  5. Voila!

You front matter should look like this:

---
title: 
date: 
tags: 
description: 
layout: index_encrypted
permalink: "/index_encrypted.html"
---

Edit: Make sure to create a copy of your .md post for later use.

Related