Coder Social home page Coder Social logo

scotch's Introduction

#Scotch ###A really classy, dead simple, markdown based, blogging framework for node.js

To try Scotch for yourself, make sure that you have node, npm, and mongodb installed (and running), then do this:

$> npm install -g scotch-blog
$> scotch create blog
$> cd blog
$> sudo scotch serve

Go to http://0.0.0.0/dashboard/install to install Scotch.

Your blog should be up and running on http://localhost

Static Site Generation

$> cd blog
$> scotch generate

Your you should now have a 'static' directory in your blog's root directory.

Read the deployment docs on how to configure static site deployment.

Dashboard

Scotch's dashboard

Writing

writing in Scotch

Reading

writing in Scotch

Deployment

Create config/deployment.js and fill it with your deployment settings then run scotch deploy from your terminal. At the moment we support S3 and FTP deployment, with gh-pages on its way.

Sample S3 Settings
module.exports = {
  "destination": "s3"
, "opts": {
    "bucket": "<BUCKET NAME>"
  , "key": "<AWS ACCESS KEY>"
  , "secret": "<AWS SECRET KEY>"
  , "region": "<AWS REGION>"      //us-west-1
  }
};
Sample FTP Settings
module.exports = {
  "destination": "ftp"
, "opts": {
    "host": "<FTP HOST>"          //ftp.myserver.com
  , "port": <FTP PORT>            //Default: 21
  , "username": "<FTP USERNAME>"
  , "password": "<FTP PASSWORD>"
  }
};

Plugins

Plugins are installed via npm and enabled via in app/config/environment.js.

/*
* Sample app/config/environment.js
* `npm install readmore`
*/
var config = {
  port: 80,
  model: {
    defaultAdapter: 'mongo'
  },
  db: {
    mongo: {
      dbname: 'blog'
    }
  },
  plugins: {
    formatters: [
      'readmore'
    ]
  }
};

module.exports = config;
Formatters

Formatter plugins enhance the markdown language.

/*
* An example formatter plugin that replaces the string "charcount" with the number
* of characters in the markdown source when viewing a post in the blog index
*/
var replacer = function (buffer) {
  //`this` in the context of a formatter plugin refers to the post model
  return buffer.replace(/charcount/, this.markdown.length);
};

/*
* You can modify either the `index` or `show` actions.
* By not exporting to exports.show, our plugin will only
* run on posts during the index action
*/
exports.index = replacer;

Things to Do

If you'd like to help out, check out the issue list.

scotch's People

Contributors

techwraith avatar cstumph avatar

Watchers

Ertuğrul Emre Ertekin 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.