works with desirae v0.9.0 as module
This commit is contained in:
parent
b0d2bf6ff9
commit
4b0d93725e
|
@ -25,6 +25,28 @@ function serve(blogdir) {
|
||||||
//secureServer = https.createServer(app).listen(65043);
|
//secureServer = https.createServer(app).listen(65043);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function build(blogdir) {
|
||||||
|
var Desi = require('desirae').Desirae
|
||||||
|
, desi = {}
|
||||||
|
, env = {}
|
||||||
|
;
|
||||||
|
|
||||||
|
env.working_path = env.blogdir = blogdir;
|
||||||
|
Desi.init(desi, env).then(function () {
|
||||||
|
env.url = desi.site.base_url + desi.site.base_path.replace(/^\/$/, '');
|
||||||
|
env.base_url = desi.site.base_url;
|
||||||
|
env.base_path = desi.site.base_path;
|
||||||
|
env.compiled_path = 'compiled';
|
||||||
|
//env.since = 0;
|
||||||
|
|
||||||
|
Desi.buildAll(desi, env).then(function () {
|
||||||
|
Desi.write(desi, env).then(function () {
|
||||||
|
console.log('Build Success!');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
cli.main(function (args, options) {
|
cli.main(function (args, options) {
|
||||||
var command = args[0]
|
var command = args[0]
|
||||||
, blogdir = options.blog
|
, blogdir = options.blog
|
||||||
|
@ -47,6 +69,10 @@ cli.main(function (args, options) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else if ('build' === command) {
|
||||||
|
build(blogdir);
|
||||||
|
return;
|
||||||
|
}
|
||||||
else if ('post' === command) {
|
else if ('post' === command) {
|
||||||
console.error("`post' not yet implemented");
|
console.error("`post' not yet implemented");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
"angular-route": "~1.3.8",
|
"angular-route": "~1.3.8",
|
||||||
"html5-boilerplate": "~4.3.0",
|
"html5-boilerplate": "~4.3.0",
|
||||||
"bootstrap": "~3.3.1",
|
"bootstrap": "~3.3.1",
|
||||||
"md5": "~0.1.3"
|
"md5": "~0.1.3",
|
||||||
|
"desirae": "~0.9.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
angular.module('myApp.services', []).
|
angular.module('myApp.services', []).
|
||||||
factory('Desirae', ['$q', '$http', function ($q, $http) {
|
factory('Desirae', ['$q', '$http', function ($q, $http) {
|
||||||
var Desi = window.Desi || require('./deardesi').Desi
|
var Desi = window.Desirae || require('./deardesi').Desirae
|
||||||
, desi = {/*TODO api_base: '/api'*/}
|
, desi = {/*TODO api_base: '/api'*/}
|
||||||
, fsapi = window.fsapi
|
|
||||||
;
|
;
|
||||||
|
|
||||||
function getBlogdir () {
|
function getBlogdir () {
|
||||||
|
@ -65,7 +64,7 @@ angular.module('myApp.services', []).
|
||||||
return d.promise;
|
return d.promise;
|
||||||
}
|
}
|
||||||
, putFiles: function (files) {
|
, putFiles: function (files) {
|
||||||
return $q.when(fsapi.putFiles(files));
|
return $q.when(Desi.fsapi.putFiles(files));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}]
|
}]
|
||||||
|
|
1
desirae
1
desirae
|
@ -1 +0,0 @@
|
||||||
Subproject commit 98f998088a48630388dbb7ffad59a7a6ac8b62ac
|
|
|
@ -1,7 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var fsapi = require('./desirae/lib/fsapi').fsapi
|
var fsapi = require('desirae/lib/node-adapters').fsapi
|
||||||
, path = require('path')
|
|
||||||
;
|
;
|
||||||
|
|
||||||
module.exports.create = function (options) {
|
module.exports.create = function (options) {
|
||||||
|
|
24
index.html
24
index.html
|
@ -84,22 +84,22 @@
|
||||||
|
|
||||||
|
|
||||||
<!-- Deps -->
|
<!-- Deps -->
|
||||||
<script src="./desirae/bower_components/bluebird/js/browser/bluebird.js"></script>
|
<script src="./bower_components/bluebird/js/browser/bluebird.js"></script>
|
||||||
<script src="./desirae/bower_components/mustache/mustache.js"></script>
|
<script src="./bower_components/mustache/mustache.js"></script>
|
||||||
<script src="./desirae/bower_components/markdown-it/dist/markdown-it.js"></script>
|
<script src="./bower_components/markdown-it/dist/markdown-it.js"></script>
|
||||||
<script src="./desirae/bower_components/js-yaml/dist/js-yaml.js"></script>
|
<script src="./bower_components/js-yaml/dist/js-yaml.js"></script>
|
||||||
<script src="./desirae/bower_components/path/path.js"></script>
|
<script src="./bower_components/path/path.js"></script>
|
||||||
<script src="./desirae/bower_components/node-uuid/uuid.js"></script>
|
<script src="./bower_components/node-uuid/uuid.js"></script>
|
||||||
<script src="./desirae/bower_components/forEachAsync/forEachAsync.js"></script>
|
<script src="./bower_components/forEachAsync/forEachAsync.js"></script>
|
||||||
|
|
||||||
<!-- Libs -->
|
<!-- Libs -->
|
||||||
<script src="./desirae/lib/deardesi-utils.js"></script>
|
<script src="./bower_components/desirae/lib/verify-config.js"></script>
|
||||||
<script src="./desirae/lib/verify-config.js"></script>
|
|
||||||
<script src="./desirae/lib/deardesi-browser.js"></script>
|
|
||||||
<script src="./desirae/lib/frontmatter.js"></script>
|
|
||||||
|
|
||||||
<!-- Desi -->
|
<!-- Desi -->
|
||||||
<script src="./desirae/desirae.js"></script>
|
<script src="./bower_components/desirae/desirae.js"></script>
|
||||||
|
<script src="./bower_components/desirae/lib/frontmatter.js"></script>
|
||||||
|
<script src="./bower_components/desirae/lib/browser-adapters.js"></script>
|
||||||
|
<script src="./bower_components/desirae/lib/utils.js"></script>
|
||||||
|
|
||||||
<!-- UX Using Angular, but not getting fancy -->
|
<!-- UX Using Angular, but not getting fancy -->
|
||||||
<script src="./bower_components/angular/angular.js"></script>
|
<script src="./bower_components/angular/angular.js"></script>
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
"connect": "^3.3.4",
|
"connect": "^3.3.4",
|
||||||
"connect-query": "^0.2.0",
|
"connect-query": "^0.2.0",
|
||||||
"connect-send-json": "^1.0.0",
|
"connect-send-json": "^1.0.0",
|
||||||
|
"desirae": "^0.9.0",
|
||||||
"fs.extra": "^1.3.0",
|
"fs.extra": "^1.3.0",
|
||||||
"require-yaml": "0.0.1",
|
"require-yaml": "0.0.1",
|
||||||
"serve-static": "^1.8.0"
|
"serve-static": "^1.8.0"
|
||||||
|
|
|
@ -59,7 +59,7 @@ function create(options) {
|
||||||
//.use(serveStatic(options.blogdir))
|
//.use(serveStatic(options.blogdir))
|
||||||
.use('/blog', serveStatic(options.blogdir))
|
.use('/blog', serveStatic(options.blogdir))
|
||||||
.use('/compiled_dev', serveStatic(path.join(options.blogdir, '/compiled_dev')))
|
.use('/compiled_dev', serveStatic(path.join(options.blogdir, '/compiled_dev')))
|
||||||
//.use('/compiled', serveStatic(path.join(options.blogdir, '/compiled')))
|
.use('/compiled', serveStatic(path.join(options.blogdir, '/compiled')))
|
||||||
;
|
;
|
||||||
|
|
||||||
return app;
|
return app;
|
||||||
|
|
|
@ -16,6 +16,7 @@ angular.module('myApp.post', ['ngRoute'])
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
Desirae.meta().then(function (desi) {
|
Desirae.meta().then(function (desi) {
|
||||||
|
console.warn(desi);
|
||||||
scope.blogdir = desi.blogdir.path.replace(/^\/(Users|home)\/[^\/]+\//, '~/');
|
scope.blogdir = desi.blogdir.path.replace(/^\/(Users|home)\/[^\/]+\//, '~/');
|
||||||
scope.site = desi.site;
|
scope.site = desi.site;
|
||||||
newPost();
|
newPost();
|
||||||
|
|
Loading…
Reference in New Issue