A blog platform written in JavaScript for developers, but with normal people in mind.
Go to file
AJ ONeal cc3f24daf0 getting more browser-ready-tastic 2015-01-06 06:52:44 +00:00
lib getting more browser-ready-tastic 2015-01-06 06:52:44 +00:00
.gitignore initial commit 2015-01-05 19:23:26 +00:00
.gitmodules retrieving files and folders 2015-01-05 22:05:35 +00:00
LICENSE Initial commit 2015-01-03 12:26:23 -07:00
MIGRATE.md Update MIGRATE.md 2015-01-03 23:17:42 -07:00
README.md add some README, fsapi works! 2015-01-06 06:07:14 +00:00
bower.json getting more browser-ready-tastic 2015-01-06 06:52:44 +00:00
deardesi.js getting more browser-ready-tastic 2015-01-06 06:52:44 +00:00
index.html getting more browser-ready-tastic 2015-01-06 06:52:44 +00:00
package.json add some README, fsapi works! 2015-01-06 06:07:14 +00:00
server.js add some README, fsapi works! 2015-01-06 06:07:14 +00:00

README.md

Desirae

In development.

Blog Platform. A Ruhoh knock-off written in JavaScript for the Browser

Key Features

Really good use of try { ... } catch(e) ... - it won't all blow up at the slightest parse error (cough ruhoh cough jekyll)... bless me.

JavaScript - it's so stable it takes 10 years to get new any features. Won't break every time you upgrade OS X and reinstall brew (cough ruby).

Browser (optional) - using your front-end templates to build in your front-end? Imagine that!

Node (optional) - if you'd prefer to go headless, you can.

The server is very minimal and could easily be implemented in any language (such as ruby or python).

Server

Obviously there has to be a server with some sort of storage and retrieval mechanism.

I've implemented a very simple node server using the filesystem.

/api/fs/walk

GET http://local.dear.desi:8080/api/fs/walk?dir=posts&dotfiles=true&extensions=md,markdown,jade,htm,html

  • dir must be supplied. returns a flat list of all files, recursively
  • dotfiles default to false. includes dotfiles when true.
  • extensions defaults to null. inclode only the supplied extensions when true.
[
  { "name": "happy-new-year.md"
  , "lastModifiedDate": "2015-01-05T18:19:30.000Z"
  , "size": 2121
  , "relativePath": "posts/2015"
  }

, { "name": "tips-for-the-ages.jade"
  , "lastModifiedDate": "2014-06-16T18:19:30.000Z"
  , "size": 389
  , "relativePath": "posts"
  }
, { "name": "my-first-post.html"
  , "lastModifiedDate": "2013-08-01T22:47:37.000Z"
  , "size": 4118
  , "relativePath": "posts/2013"
  }
]

To retrieve multiple dir listings at once:

  • for a few simple dirs without special chars just change dir to dirs and separate with commas

GET http://local.dear.desi:8080/api/fs/walk?dirs=posts/2015,posts/2013&dotfiles=true&extensions=md,markdown,jade,htm,html

  • for many dirs, or dirs with special chars, POST an object containing an array of dirs with &_method=GET appended to the url.
POST http://local.dear.desi:8080/api/fs/walk?dotfiles=true&extensions=md,markdown,jade,htm,html&_method=GET

{ "dirs": [ "old", "2013,12", "2013,11" ] }
{
  "posts/2015": [ { "name": ... }, { ... } ]
, "posts/2013": [ ... ]
}

/api/fs/files

GET http://local.dear.desi:8080/api/fs/files?path=posts/happy-new-year.md

{ "path": "posts/intro-to-http-with-netcat-node-connect.md"
, "lastModifiedDate": "2013-08-01T22:47:37.000Z"
, "contents": "..."
, "sha1": "6eae3a5b062c6d0d79f070c26e6d62486b40cb46"
}

To retrieve multiple files at once:

  • for a few simple files without special chars just change path to paths and separate with commas

GET http://local.dear.desi:8080/api/fs/files?paths=posts/foo.md,posts/bar.md

  • for many files, or files with special chars, POST an object containing an array of pathss with &_method=GET appended to the url.
POST http://local.dear.desi:8080/api/fs/files?dotfiles=true&extensions=md,markdown,jade,htm,html&_method=GET

{ "paths": [ "posts/foo.md", "posts/2013,11,30.md" ] }
[
  { "path": "posts/foo.md"
  , "lastModifiedDate": "2013-08-01T22:47:37.000Z"
  , "contents": "..."
  , "sha1": "6eae3a5b062c6d0d79f070c26e6d62486b40cb46"
  }
, ...
]