Netlify Password Protection

How to password protected Netlify App?

官方的有密码保护功能,但是每月99刀。。。

自己搞:

一些可以研究的方法:

  1. netlify-plugin-password-protection,这个目前测试是最简单、而且有效的。不足的地方是:每个地方都需要验证密码。

  2. Password-protected pages on Netlify.

上述两种方法都具有一定问题。

解决方案:

StaticShield img

  • 一行代码解决

  • 免费

  • 步骤:

    1. register a new account on StaticShield
    2. Copy the HTML Code snippet
    3. Paste the above code to themes/pulp/layouts/partials/head.html at the very begining
      • maybe we have a different theme, but the approach is similar.
    4. Push to the github and wait Netlify published
    5. Done!
  • 注意:

    • 本地测试时,需要把 themes/pulp/layouts/partials/head.html 文件中的 password protected section comment 掉!!!

    • 本地测试完毕,上传到Netlify时候,别忘了恢复上述 password protected section.

  • Alfred Workflow: 我以及做好了 myblog 的workflow,调用即可

Chen Xing
Chen Xing
Founder & Data Scientist

Enjoy Life & Enjoy Work!

Related