Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.
pvorb edited this page Feb 8, 2012 · 1 revision

bread can be easily installed with node package manager.

$ npm install -g bread

You also have to install MongoDB to use bread.

On Debian for example, use

$ sudo apt-get install mongodb

You may also read how to install MongoDB on Unix, Windows or Mac OS X.

The module itself is used like this:

varbread=require("bread");// configuration objectvarconf={dbinf: {// MongoDB connectionhost: "localhost",port: "27017",name: "mywebsite",// Name of the database to be usedcollection: "pages"// Name of the collection to be used// (This collection will be dropped, so ensure there's no critical data in it.)},directories: {input: "in",// Look for files in this dir.output: "out",// Write files to this dir.templates: "tpl"// Look for templates in this dir.},fileExtensions: {// Defines, which file extensions to read and write ("read": "write")"mkd": "html","md": "html","mdown": "html","markdown": "html"},// Array of indexes that shall be createdindexes: [// Blog Index{title: "My Blog",pattern: /\/log\/[^\/]+/,// Index files matched by this pattern.path: {first: "/log/index.html",// first page of the indexpattern: "/log/index-{{page}}.html"// other pages},template: "index.tpl",// templatelimit: 8,// 8 links per pagesort: [["date","desc"]]// newest first},// RSS Feed{title: "My Blog",pattern: /\/log\/[^\/]+/,// Add files matched by this pattern to// the feed.path: "/log/feed.xml",// feed urltemplate: "rss.tpl",// templatelimit: 10,// total maximumsort: [["date","desc"]]// newest first}],properties: {siteTitle: "My Site"}};bread(conf);

Clone this wiki locally