pagespace

1.4.1 • Public • Published

Pagespace

Build Status

Go to http://page.space for comprehensive documentation

Pagespace is website management software built using Node.JS and MongoDB.

Pagespace began as a simple platform for me to make websites on the Node platform for friends with content that was manageable, but has evolved into much more.

Developers use Pagespace as just another piece of Express 4 middleware, so its easy to add other middleware for parts of your application not managed by Pagespace.

Within Pagespace, developers create page templates with Handlebars using partials to include the manageable regions of a web page. These manageable regions are populated by Pagespace's plugins, called Parts, which are commonly used to edit web copy, include HTML, aggregate content, but can do virtually anything.

Besides the technologies already mentioned on this page, Pagespace does not dictate the use of any other technologies. Templates are blank canvases, for you to create any website you want, powered by any client side technology.

Website managers benefit from an admin dashboard where they have full website management capabilities. An important design goal of Pagespace is to find the perfect balance between a powerful management interface and a clean uncluttered UI. We recognize that some features are not suitable or necessary for all users and are, therefore, hidden behind different user roles.

Docker demo

You can run the demo that is part of this repository using Docker:

docker run -it --rm -p 9999:9999 pagespace/demo

Then visit http://localhost:9999/_dashboard. Use the following login credentials:

Username: admin Password: pagespace

Quick start

Prerequisites

Database setup

Create a new database:

    mongo
    > use mysite

Setup with Express

Pagespace is just another piece of Express middleware.

First install Express, Pagespace and also some required Express middleware: body parser, cookie parser and session and some Pagespace plugins to get started

npm install express

npm install pagespace
npm install pagespace-webcopy

npm install body-parser
npm install cookie-parser
npm install express-session

Here is the minimum code you'll need to run Pagespace on Express:

var express = require('express');
var pagespace = require('./src/index');
var bodyParser = require('body-parser');
var cookieParser = require('cookie-parser');
var session = require("express-session");
 
var app = express();
 
app.use(/^(?!\/_static).+/, [ bodyParser.json(), cookieParser(), session({secret: process.env.SESSION_SECRET || 'foo'})]);
 
// view engine setup
app.set('views', [ pagespace.getViewDir(), pagespace.getDefaultTemplateDir() ]);
app.engine('hbs', pagespace.getViewEngine());
 
app.use(pagespace.init({
    db: 'mongodb://localhost/mysite'
}));
 
// catch 404 and forwarding to error handler
app.use(function(req, res, next) {
    var err = new Error('Not Found');
    err.status = 404;
    next(err);
});
 
// error handler
app.use(function(err, req, res) {
    res.status(err.status || 500);
    res.render('error', {
        message: err.message,
        status: err.status,
        error: {}
    });
});
 
app.listen(9999, function() {
    console.log('Pagespace dev app now running on http://localhost:9999');
});

See app.js for a more comprehensive example.

Dashboard setup

First install a plugin, for example webcopy

    npm install pagespace-webcopy

Now you may populate template or page regions with this plugin.

Plugins

Webcopy

WYSIWYG HTML editor with integration for Pagespace links and media.

npm install pagespace-webcopy --save

https://github.com/pagespace/pagespace-webcopy

HTML

Simple raw HTML editor

npm install pagespace-html --save

https://github.com/pagespace/pagespace-html

Markdown

Markdown editor, processes Markdown to HTML.

npm install pagespace-markdown --save

https://github.com/pagespace/pagespace-markdown

Gallery

Creates a gallery include composed of Pagespace media items.

npm install pagespace-gallery --save

https://github.com/pagespace/pagespace-gallery

Posts

Aggregates includes from a collection of pages into one page. Useful for blog rolls or composing long scroll pages

npm install pagespace-posts --save

https://github.com/pagespace/pagespace-posts

Nav

Creates a navigation include.

npm install pagespace-nav --save

https://github.com/pagespace/pagespace-nav

Package Sidebar

Install

npm i pagespace

Homepage

page.space

Weekly Downloads

1

Version

1.4.1

License

LGPL-3.0

Last publish

Collaborators

  • philmander