Googlenetworking字体在Express中不起作用
我无法让Google网页字体在Express 3.0中运行。
以标准方式加载字体似乎不起作用:
link(href='http://fonts.googleapis.com/css?family=Crete+Round')
然而加载字体在这些方式之一工作正常:
script(type="text/javascript") WebFontConfig = {google: { families: [ 'Crete+Round::latin' ] }}; (function() { var wf = document.createElement('script'); wf.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js'; wf.type = 'text/javascript'; wf.async = 'true'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(wf, s); })();
要么
style @import url(http://fonts.googleapis.com/css?family=Crete+Round);
我有类似的问题与Express 3.0.0rc2不包括CSS。 我不确定这是一个Jade还是一个Express问题,但是当我添加一个工作的style.css
它的工作就像这样:
link(rel='stylesheet', href='/stylesheets/style.css')
然而,如果我删除该行并插入Twitter Bootstrap css文件,我会得到奇怪的HTML输出。
link(rel='stylesheet', href='/bootstrap/css/bootstrap.min.css')
它只有当我有这样的东西时才起作用:
link(rel='stylesheet', href='/bootstrap/css/bootstrap.min.css') link(rel='stylesheet', href='/bootstrap/css/bootstrap-responsive.min.css') link(rel='stylesheet', href='/stylesheets/style.css')
为什么? 我不知道。 :-)我认为这是parsing和HTML输出。