feature(css) get list of files from css.json

This commit is contained in:
coderaiser 2015-07-15 06:24:13 -04:00
parent 2fea5ae5a2
commit bea26927e0
3 changed files with 19 additions and 4 deletions

View file

@ -9,8 +9,7 @@
<title>{{ title }}</title> <title>{{ title }}</title>
<link rel=stylesheet href="{{ prefix }}/css/urls.css"> <link rel=stylesheet href="{{ prefix }}/css/urls.css">
<link rel=stylesheet href="{{ prefix }}/join:css/reset.css:css/style.css:css/icons.css:css/help.css:css/query.css"> <link rel=stylesheet href="{{ prefix }}/join:{{ css }}">
<noscript> <noscript>
<link rel=stylesheet href="{{ prefix }}/css/nojs.css"> <link rel=stylesheet href="{{ prefix }}/css/nojs.css">
</noscript> </noscript>

7
json/css.json Normal file
View file

@ -0,0 +1,7 @@
[
"reset",
"style",
"icons",
"help",
"query"
]

View file

@ -5,6 +5,7 @@
DIR_TMPL = DIR + 'tmpl/', DIR_TMPL = DIR + 'tmpl/',
DIR_HTML = DIR + 'html/', DIR_HTML = DIR + 'html/',
DIR_LIB = DIR + 'lib/', DIR_LIB = DIR + 'lib/',
DIR_JSON = DIR + 'json/',
DIR_SERVER = __dirname + '/', DIR_SERVER = __dirname + '/',
DIR_FS = DIR_TMPL + 'fs/', DIR_FS = DIR_TMPL + 'fs/',
@ -37,7 +38,14 @@
Template = {}, Template = {},
Prefix, 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) { module.exports = function(params) {
var p = params || {}; var p = params || {};
@ -87,7 +95,8 @@
data = rendy(data, { data = rendy(data, {
title : CloudFunc.getTitle(), title : CloudFunc.getTitle(),
fm : left + right, fm : left + right,
prefix : Prefix prefix : Prefix,
css : CSS_URL
}); });
return data; return data;