metalsmith-privileges
A plugin to allow several level of privileges for a statis site.
Based on given privileges for each file, it duplicates and filter files to generate several version of the same site. Each non-public file is given a hash in its filename.
Installation
$ npm install metalsmith-privileges
Usage
In the page:
---
title: This page is private
privileges: private
---
You can use different handle to define the level of privileges, by configuring the handle
option. privileges
is the default.
All the links to local files will be updated to point to the privileged files.
In the build
var privileges = ; metalsmith ;
In the template
You can gather all the posts from the current privilege, to build an index or a menu.
// An array of all the posts from current privilegevar posts = Object;