Require a password to access your site.
To set up password authentication for your site:
- Go to the Site Settings / Authentication section
- Select Password and click Switch to Password authentication
- Enter a password and click Update Site Password
Visitors to your site will be prompted for the password to view.
Creating a custom login page#
Customize the password login page with your own branding.
CloudCannon injects classes into the HTML to indicate the result of the action. They are injected into {{messageClasses}}
. Use these classes to provide error handling and success notifications in your forms.
Filename: login.html
Form action: not required
Form inputs: username
, password
Message classes: has-incorrect-login
For Jekyll-generated pages, use raw
tags so Jekyll outputs it for CloudCannon to process later: {% raw %}{{messageClasses}}{% endraw %}
.
CloudCannon requires a hidden username input here for internal reasons. The value is ignored.