From 61bd443e124dc35c7fff66fcfe2dd21eff50fc7f Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 15 Jan 2015 21:56:14 -0700 Subject: [PATCH] updated to latest, fixed minor bugs --- .gitignore | 1 - bin/deardesi.js | 18 +++++++++++++----- bower.json | 3 ++- components/desirae/desirae.js | 4 ++++ index.html | 1 + package.json | 5 +++-- views/about/about.html | 30 ++++++++++++++++++++++-------- views/build/build.js | 5 +++++ views/post/post.html | 18 +++++++++++++++++- views/post/post.js | 30 ++++++++++++++++++------------ 10 files changed, 85 insertions(+), 30 deletions(-) diff --git a/.gitignore b/.gitignore index 0e80248..1325818 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ node_modules -bower_components # Logs logs diff --git a/bin/deardesi.js b/bin/deardesi.js index 7550824..c41f625 100644 --- a/bin/deardesi.js +++ b/bin/deardesi.js @@ -5,6 +5,7 @@ var PromiseA = require('bluebird') , path = require('path') , cli = require('cli') , UUID = require('node-uuid') + , Desi ; cli.parse({ @@ -12,6 +13,13 @@ cli.parse({ //, output: ['o', 'name of output directory within ~/path/to/blog', 'string', './compiled'] }); +function init() { + Desi = require('desirae').Desirae; + + Desi.registerDataMapper('ruhoh', require('desirae-datamap-ruhoh').DesiraeDatamapRuhoh); + Desi.registerDataMapper('ruhoh@2.6', require('desirae-datamap-ruhoh').DesiraeDatamapRuhoh); +} + function serve(blogdir) { var http = require('http') //, https = require('https') @@ -27,8 +35,7 @@ function serve(blogdir) { } function build(blogdir) { - var Desi = require('desirae').Desirae - , desi = {} + var desi = {} , env = {} ; @@ -60,9 +67,7 @@ function createPost(originalDir, blogdir, title, extra) { process.exit(1); } - var Desi = require('desirae').Desirae - //, desi = {} - , env = {} + var env = {} , post = {} , slug , filepath @@ -149,7 +154,10 @@ function createPost(originalDir, blogdir, title, extra) { }); } + cli.main(function (args, options) { + init(); + var command = args[0] , blogdir = options.blogdir , originalDir = blogdir diff --git a/bower.json b/bower.json index e44d877..7b1f5a0 100644 --- a/bower.json +++ b/bower.json @@ -38,6 +38,7 @@ "html5-boilerplate": "~4.3.0", "bootstrap": "~3.3.1", "md5": "~0.1.3", - "desirae": "~0.9.0" + "desirae": "~0.9.6", + "desirae-datamap-ruhoh": "~1.0.0" } } diff --git a/components/desirae/desirae.js b/components/desirae/desirae.js index 7b3fbff..d1ff193 100644 --- a/components/desirae/desirae.js +++ b/components/desirae/desirae.js @@ -4,6 +4,10 @@ angular.module('myApp.services', []). , desi = {/*TODO api_base: '/api'*/} ; + // TODO what version of ruhoh are ruhoh-twitter and ruhoh-boostrap-2 + Desi.registerDataMapper('ruhoh', window.DesiraeDatamapRuhoh || require('desirae-datamap-ruhoh').DesiraeDatamapRuhoh); + Desi.registerDataMapper('ruhoh@2.6', window.DesiraeDatamapRuhoh || require('desirae-datamap-ruhoh').DesiraeDatamapRuhoh); + function getBlogdir () { return $http.get('/api/fs/rootdir').then(function (resp) { desi.blogdir = resp.data; diff --git a/index.html b/index.html index 4258797..bece5d1 100644 --- a/index.html +++ b/index.html @@ -100,6 +100,7 @@ + diff --git a/package.json b/package.json index 0f3e72b..0834553 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "desi", - "version": "0.5.2", + "version": "0.5.3", "description": "A nice, friendly tool to help you get set up and start blogging, built on the Desirae blogging platform", "main": "server.js", "scripts": { @@ -44,7 +44,8 @@ "connect": "^3.3.4", "connect-query": "^0.2.0", "connect-send-json": "^1.0.0", - "desirae": "^0.9.3", + "desirae": "^0.9.6", + "desirae-datamap-ruhoh": "^1.0.0", "fs.extra": "^1.3.0", "node-uuid": "^1.4.2", "require-yaml": "0.0.1", diff --git a/views/about/about.html b/views/about/about.html index dc3b7c9..6b4c4b1 100644 --- a/views/about/about.html +++ b/views/about/about.html @@ -3,7 +3,7 @@
@@ -18,28 +18,42 @@

- +
+              
+npm install -g desi
+
+git clone https://github.com/DearDesi/desirae-blog-template.git blog
+
+pushd blog
+
+git submodule add https://github.com/DearDesi/ruhoh-twitter.git \
+  themes/ruhoh-twitter
+
+desi serve
+              
+            

-

Dear Desi is...

+

Why Desi?


    -
  • Builds in the Browser +
  • Built in JavaScript
      -
    • The in-browser static blog generator
    • Write content in Markdown, Jade, or HTML
    • Mustache Templates
    • +
    • Use ruhoh themes (or roll your own)
  • -
  • Git, Dropbox, or regular Folders for management
  • -
  • Go headless with Node.js support
  • +
  • Build your blog right in your browser
  • +
  • Build headless with io.js (and node.js)
  • +
  • Use Git, Dropbox, or regular Folders for management
  • Dual Licensed Apache2 and MIT
  • No Ruby version Hell - it'll still work in 6 months! :-D

What are you waiting for?


- Get Started + Try it!
diff --git a/views/build/build.js b/views/build/build.js index d70109c..cef50a3 100644 --- a/views/build/build.js +++ b/views/build/build.js @@ -21,6 +21,11 @@ angular.module('myApp.build', ['ngRoute']) scope.blogdir = desi.blogdir.path.replace(/^\/(Users|home)\/[^\/]+\//, '~/'); scope.site = desi.site; + if (!desi.site.base_url || !desi.site.base_path) { + window.alert("Please go back to the site config and enter any mandatory missing fields (base_url, base_path)."); + return; + } + scope.production_url = desi.site.base_url + path.join('/', desi.site.base_path); // this is the responsibility of the build system (Dear Desi), not the library (Desirae) diff --git a/views/post/post.html b/views/post/post.html index d4a4824..5daf928 100644 --- a/views/post/post.html +++ b/views/post/post.html @@ -122,7 +122,23 @@
- + +
+ +
+
+ +
+