• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

lilykonings/jekyll-password-protect: Password protect Jekyll posts (formerly jek ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

lilykonings/jekyll-password-protect

开源软件地址:

https://github.com/lilykonings/jekyll-password-protect

开源编程语言:

JavaScript 48.8%

开源软件介绍:

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




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap