From bea26927e04ff2d3a581fd3c720f1e8ea93762e4 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 15 Jul 2015 06:24:13 -0400 Subject: [PATCH] feature(css) get list of files from css.json --- html/index.html | 3 +-- json/css.json | 7 +++++++ lib/server/route.js | 13 +++++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 json/css.json diff --git a/html/index.html b/html/index.html index 202a6b28..3779308e 100644 --- a/html/index.html +++ b/html/index.html @@ -9,8 +9,7 @@ {{ title }} - - + diff --git a/json/css.json b/json/css.json new file mode 100644 index 00000000..47ba620c --- /dev/null +++ b/json/css.json @@ -0,0 +1,7 @@ +[ + "reset", + "style", + "icons", + "help", + "query" +] diff --git a/lib/server/route.js b/lib/server/route.js index 148e8ad1..e33b5c92 100644 --- a/lib/server/route.js +++ b/lib/server/route.js @@ -5,6 +5,7 @@ DIR_TMPL = DIR + 'tmpl/', DIR_HTML = DIR + 'html/', DIR_LIB = DIR + 'lib/', + DIR_JSON = DIR + 'json/', DIR_SERVER = __dirname + '/', DIR_FS = DIR_TMPL + 'fs/', @@ -37,7 +38,14 @@ Template = {}, Prefix, - FS = CloudFunc.FS; + + FS = CloudFunc.FS, + + CSS_URL = require(DIR_JSON + 'css.json') + .map(function(name) { + return 'css/' + name + '.css'; + }).join(':'); + module.exports = function(params) { var p = params || {}; @@ -87,7 +95,8 @@ data = rendy(data, { title : CloudFunc.getTitle(), fm : left + right, - prefix : Prefix + prefix : Prefix, + css : CSS_URL }); return data;