metalsmith-basic-auth
A Metalsmith plugin to enable HTTP basic authentication via front-matter attributes.
Last updated 4 years ago by elcontraption .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install metalsmith-basic-auth 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 0.1.5                                ...           latest (4 years ago)

3 Versions

  • 0.1.5                                ...           4 years ago
  • 0.1.4                                ...           4 years ago
  • 0.1.3                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (7)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |