Permalink
Browse files

updated the less file checking to compare modified dates and output a…

…ppropriatly
  • Loading branch information...
1 parent 515c9e6 commit 5894de1fbaf15ea7363920bb92dbe759b5e051ea @mikevalstar committed Feb 13, 2012
View
58 app.js
@@ -34,42 +34,48 @@ app.configure('production', function(){
// Build (Stylesheets)
var lessBootstrapFile = path.join(__dirname, 'style/bootstrap.less');
var cssBootstrapFile = path.join(__dirname, 'public/css/bootstrap.css');
-var parseBootstrapLess = function(){
- var lessParser = new(less.Parser)({
- paths: ['.', './style'], // Specify search paths for @import directives
- });
-
- fs.readFile(lessBootstrapFile, 'utf8', function (e, data) {
- lessParser.parse(data, function (e, tree) {
- //tree.toCSS({ compress: true }); // Minify CSS output
- fs.writeFile(cssBootstrapFile, tree.toCSS(), function (err) {
- if (err) throw err;
- console.log(cssBootstrapFile + ' Written to disk!');
+var parseBootstrapLess = function(curr, prev){
+ if(typeof(curr) == 'undefined' || curr.mtime.getTime() != prev.mtime.getTime()){
+
+ var lessParser = new(less.Parser)({
+ paths: ['.', './style'], // Specify search paths for @import directives
+ });
+
+ fs.readFile(lessBootstrapFile, 'utf8', function (e, data) {
+ lessParser.parse(data, function (e, tree) {
+ //tree.toCSS({ compress: true }); // Minify CSS output
+ fs.writeFile(cssBootstrapFile, tree.toCSS(), function (err) {
+ if (err) throw err;
+ console.log(cssBootstrapFile + ' Written to disk!');
+ });
});
});
- });
+ }
};
var lessGPFile = path.join(__dirname, 'style/g-p.less');
var cssGPFile = path.join(__dirname, 'public/css/css.css');
-var parseGPLess = function(){
- var lessParser = new(less.Parser)({
- paths: ['.', './style'], // Specify search paths for @import directives
- });
-
- fs.readFile(lessGPFile, 'utf8', function (e, data) {
- lessParser.parse(data, function (e, tree) {
- //tree.toCSS({ compress: true }); // Minify CSS output
- fs.writeFile(cssGPFile, tree.toCSS(), function (err) {
- if (err) throw err;
- console.log(cssGPFile + ' Written to disk!');
+var parseGPLess = function(curr, prev){
+ if(typeof(curr) == 'undefined' || curr.mtime.getTime() != prev.mtime.getTime()){
+
+ var lessParser = new(less.Parser)({
+ paths: ['.', './style'], // Specify search paths for @import directives
+ });
+
+ fs.readFile(lessGPFile, 'utf8', function (e, data) {
+ lessParser.parse(data, function (e, tree) {
+ //tree.toCSS({ compress: true }); // Minify CSS output
+ fs.writeFile(cssGPFile, tree.toCSS(), function (err) {
+ if (err) throw err;
+ console.log(cssGPFile + ' Written to disk!');
+ });
});
});
- });
+ }
};
-//parseBootstrapLess();
-//parseGPLess();
+parseBootstrapLess();
+parseGPLess();
fs.watchFile(path.join(__dirname, 'style/variables.less'), parseBootstrapLess);
fs.watchFile(lessGPFile, parseGPLess);
View
BIN public/img/glyphicons-halflings-white.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/glyphicons-halflings.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
5 style/g-p.less
@@ -1,2 +1,5 @@
// Core variables from twitter bootstrap
-@import "variables.less";
+@import "variables.less";
+
+/* Layout */
+#C{ padding-top: @navbarHeight; }
View
35 views/layout.jade
@@ -1,6 +1,29 @@
-!!!
-html
- head
- title= title
- link(rel='stylesheet', href='/stylesheets/style.css')
- body!= body
+!!! 5
+html(lang="en")
+ head
+ title= title
+ link(rel='stylesheet', href='/css/bootstrap.css')
+ link(rel='stylesheet', href='/css/css.css')
+ body
+ .navbar.navbar-fixed-top
+ .navbar-inner
+ .container
+ a.brand(href="/") Gentoo-Portage
+ ul.nav
+ li.active
+ a(href="#") Newest
+ li
+ a(href="#") News
+ li
+ a(href="#") Browse
+ li
+ a(href="#") USE Flags
+ li
+ a(href="#") GLSAs
+ li
+ a(href="#") More
+ form.navbar-search.pull-right
+ input.search-query(type="text", placeholder="Search")
+
+ #C.container
+ #CC!= body

0 comments on commit 5894de1

Please sign in to comment.