Giter Site home page Giter Site logo

jekyll-password-protect's Introduction

jekyll-firewall

Password protect Jekyll posts.

Demo

Disclaimers

Before using, keep the following in mind:

  • This encryption type is weak against brute force attacks. Here is an example of a safe guard by mrlubos.
  • Liquid templating isn't currently supported in protected posts
  • Use only Markdown syntax supported by marked
  • The password needs to be entered for each protected post. But you can easily store a successful password in cache and bypass subsequent logins
  • I discourage storing your site in a public repository unless you are okay with gitignoring sensitive information (and have no remote backup)

Installation

To begin a new site, build on top of this repository by forking or cloning.

To integrate with an existing Jekyll site, below are the necessary files:

  • _layouts/encrypted โ€” The layout for a locked page
  • gulpfile โ€” The Gulp file to encrypt posts

Usage

Site Structure & Password

The encrypt gulp task (below) encrypts each file in SRC-FOLDER with PASSWORD and outputs it into DEST-FOLDER. Change these settings in gulpfile.js according to your site structure.

gulp.task('encrypt', () => {
  return gulp.src('SRC-FOLDER')
    .pipe(encrypt('PASSWORD'))
    .pipe(gulp.dest('DEST-FOLDER'));
});

Heads up that if you write public posts to DEST-FOLDER, it may be difficult to distinguish the public and protected posts. This can be easily amended but is outside the scope of the skeleton site in this repo. However, you can adjust the gulp encrypt task to change the outputted filename of protected files in the DEST-FOLDER and set the url in the front matter.

Protect Posts

To encrypt a post, simply save it in your desinated SRC-FOLDER and run gulp.

Credit

Libraries

Contributors

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.