Netlify Password Protection
$$
\newcommand{\indep}{\mathrel{\perp\mkern-10mu\perp}}
\newcommand{\P}{\mathbb{P}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\E}{\mathbb{E}}
\newcommand{\Var}{\operatorname{Var}}
\newcommand{\Cov}{\operatorname{Cov}}
\newcommand{\1}[1]{\mathbf{1}\\{#1\\}}
$$
How to password protected Netlify App?
官方的有密码保护功能,但是每月99刀。。。
自己搞:
一些可以研究的方法:
-
netlify-plugin-password-protection,这个目前测试是最简单、而且有效的。不足的地方是:每个地方都需要验证密码。
上述两种方法都具有一定问题。
解决方案:
-
一行代码解决
-
免费
-
步骤:
- register a new account on StaticShield
- Copy the HTML Code snippet
- Paste the above code to
themes/pulp/layouts/partials/head.htmlat the very begining- maybe we have a different theme, but the approach is similar.
- Push to the github and wait Netlify published
- Done!
-
注意:
-
本地测试时,需要把
themes/pulp/layouts/partials/head.html文件中的 password protected section comment 掉!!! -
本地测试完毕,上传到Netlify时候,别忘了恢复上述 password protected section.
-
-
Alfred Workflow: 我以及做好了
myblog的workflow,调用即可
