Tag: 哈巴狗

用吞咽数据吞噬G G

我正在尝试在我的工作stream中使用gulp-jade的gulp-data,但是我得到了一个与gulp-data插件相关的错误。 这是我的gulpfile.js var gulp = require('gulp'), plumber = require('gulp-plumber'), browserSync = require('browser-sync'), jade = require('gulp-jade'), data = require('gulp-data'), path = require('path'), sass = require('gulp-ruby-sass'), prefix = require('gulp-autoprefixer'), concat = require('gulp-concat'), uglify = require('gulp-uglify'), process = require('child_process'); gulp.task('default', ['browser-sync', 'watch']); // Watch task gulp.task('watch', function() { gulp.watch('*.jade', ['jade']); gulp.watch('public/css/**/*.scss', ['sass']); gulp.watch('public/js/*.js', ['js']); }); var getJsonData = […]

如何使用标准HTML而不是Jade使用Piler?

我用Piler( https://github.com/epeli/piler )使用Node.js。 项目网站上的示例显示了如何使用带有index.jade文件的Piler。 index.jade: !!! 5 html head !{css} !{js} body h1 Hello Piler 索引文件传递给客户端时, !{css}和!{js}标签将转换为相应的html标签。 例如: <script type="text/javascript" src="myscript.js"></script> 我如何使用没有index.jade文件的Piler,而是使用index.html文件? 什么是!{css}和!{js}标签应该看起来像在index.html? 换句话说:我不想用Jade的Piler,而是用标准的HTML。 提前致谢。

在expressjs渲染中干燥布局本地化

我在nodejs中使用express,并试图保持我的视图呈现干燥。 在我的布局里面,我有以下的东西(我在用玉石) body nav.login -if(currentUser) ="logged in information" -else ="logged out information" !=body 问题是,我每次渲染,现在我需要有 res.render('anything.jade',{ locals: { currentUser: req.session.currentUser, /*all of my other locals*/ } }); 看起来像是一个痛苦,必须通过所有的渲染调用,并添加,然后做同样的事情,如果我必须添加任何其他当地人的布局。 有什么办法可以避免在我渲染的任何地方重新input“currentUser”到当地人

你如何链接到一个玉文件的CSS?

我目前正试图链接normalize.css但它不工作(使用套接字expression) html head title= "Real time web chat" link(href='/css/normalize.css') script(src='/chat.js') script(src='/socket.io/socket.io.js') script(src='http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js') body #content(style='width: 100%; height: 600px; margin: 0 0 20px 0; border: solid 1px #999; overflow-y: scroll;') .controls | Name: input#name(style='width:350px;') input#field(style='width:350px; display: inline; margin-left -90px;') input#send(type='button', value='send')