Giter VIP home page Giter VIP logo

node.js-blog-engine's Introduction

#Node.js Blog Engine The goal of this project is to create a simple, reusable blog template for Node.js. By passing in a few options, you can quickly have a fully functioning blog, including WYSIWYG editing, database saving, Disqus comments, draft saving options, and a responsive Twitter Bootstrap theme.

##Live Example You can go to http://nodejs-blog-engine-example.herokuapp.com/ to view the example site. To login as the admin, go to http://nodejs-blog-engine-example.herokuapp.com/login. For the example website, any Google account will have admin access.

##Installation Warning! This is still being developed!!! But, if you want to help out in development, you can install it with:

npm install bootstrap-blog

##Simple Usage The following code should be placed in your main serverside javascript file that is executed with node. For example, if this is placed in app.js, then node app.js would run the blog.

var blog = require('bootstrap-blog');

blog.start({
	title: "My awesome blog",
	adminGoogleEmail: '[email protected]',
	liveDomain: 'http://some-app.herokuapp.com',
	database: { //Access information for a SQL database. If you need a free one to get started with, try http://xeround.com/
		database: config.database,
		user: config.user,
		password: config.password,
		host: config.host,
		dbPort: config.dbPort
	}
});

##Options ###Menu Items Custom menu items can be set by passing in an array of menu objects.

	menu: [
		{
			title: 'Google',
			path: 'http://www.google.com'
		}, {
			title: 'Amazon',
			path: 'http://www.amazon.com'
		}
	]

###Custom Pages If you want to create a custom page (not a blog posting), use the pages property.

pages:[
		{
			path: '/about',
			callback: function (req,res) {
				console.log('User has visitied the about page.');
				res.send('About page coming soon!');
			}
		},
		{
			path: '/about/history',
			callback: function (req,res) {
				console.log('User has visitied the history page.');
				res.send('History page coming soon!');
			}	
		}
	]

###Different Bootstrap Themes You can load in any Twitter Bootstrap theme by specifying the path to the css file.

bootstrapPath: '/css/bootstrap.min.css'

###Modifying templates When you run the blog for the first time, a views folder is created in your top directory. Edit these files to change the layout of the website. Since these are outside the node_modules folder, they will not be overridden during updates. ###Example

var blog = require('bootstrap-blog');

blog.start({
	title: "My awesome blog",
	adminGoogleEmail: '[email protected]',
	localPort: 5000, //defaults to 3000
	liveDomain: 'http://some-app.herokuapp.com',
	database: {
		database: config.database,
		user: config.user,
		password: config.password,
		host: config.host,
		dbPort: config.dbPort
	},
	bootstrapPath: '/css/bootstrap.min.css',
	pages:[
		{
			path: '/about',
			callback: function (req,res) {
				console.log('User has visitied the about page.');
				res.send('About page coming soon!');
			}
		},
		{
			path: '/about/history',
			callback: function (req,res) {
				console.log('User has visitied the history page.');
				res.send('History page coming soon!');
			}	
		}
	],
	menu: [
		{
			title: 'Google',
			path: 'http://www.google.com'
		}, {
			title: 'Amazon',
			path: 'http://www.amazon.com'
		}
	]
});

##Contributing Pull requests welcome!

node.js-blog-engine's People

Contributors

dan-silver avatar stockholmux avatar

Stargazers

Daniel Beauchamp avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.