Skip to content

About

🔒 A Metalsmith plugin to enable HTTP basic authentication via front-matter attributes.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metalsmith Basic Auth

A Metalsmith plugin to enable HTTP basic authentication via front-matter attributes.

  • So far, this is only supports authentication using Apache .htaccess files.
  • HTTP basic authentication is only truly safe when using HTTPS.

Installation

$ npm install metalsmith-basic-auth

Usage

var auth = require('metalsmith-basic-auth');
var metalsmith = require('Metalsmith');

metalsmith.use(auth({

    // Required: path to the root of your site on the server:
    serverPath: '/var/www/my-site',

    // Optional: name displayed in auth dialog:
    authName: 'My Protected Area'
}));

Add the following to your front matter:

---
auth:
    user: username
    pass: password
---

.htaccess and .htpasswd files will be generated and placed alongside the output file.

About

🔒 A Metalsmith plugin to enable HTTP basic authentication via front-matter attributes.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages