首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Nanoc没有编译css

Nanoc没有编译css
EN

Stack Overflow用户
提问于 2012-12-13 21:21:42
回答 1查看 703关注 0票数 1

我想使用自定义样式表路径/stylesheets/stylesheet.css来使用nanoc,但是nanoc不会呈现output文件夹中的css文件。以下是我的规则:

代码语言:javascript
复制
compile '/stylesheets/' do
  filter :css
end

compile '/images/*/' do
end

compile '*' do
  if item.binary?
    # don’t filter binary items
  else
    filter :haml
    layout 'default'
  end
end

route '/stylesheets/' do
  '/stylesheets/stylesheet.css'
end

route '*' do
  if item.binary?
    # Write item with identifier /foo/ to /foo.ext
    item.identifier.chop + '.' + item[:extension]
  else
    # Write item with identifier /foo/ to /foo/index.html
    item.identifier + 'index.html'
  end
end

layout '*', :haml

它不起作用--有人知道问题出在哪里吗?此外,它只生成output/stylesheet/index.html,其中包含我的样式表,但放入我的html布局!:(

下面是它的外观(output/stylesheet/index.html):

代码语言:javascript
复制
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
  <head>
    <meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
    <title>
      A Brand New nanoc Site -

    </title>
    <link href='/stylesheets/stylesheet.css' media='screen' rel='stylesheet' type='text/css' />
    <meta content='nanoc 3.1.6' name='generator' />
  </head>
  <body>
    <!-- * reset css begins */ -->
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline;}
<!-- * HTML5 display-role reset for older browsers */ -->
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {display: block;}
body {line-height: 1;}
ol, ul {list-style: none;}
blockquote, q {quotes: none;}
blockquote:before, blockquote:after, q:before, q:after {content: ''; content: none;}
table {border-collapse: collapse; border-spacing: 0;}
<!-- * reset css ends */ -->
body, html{background: url('../images/background.png') no-repeat center top fixed; background-color: #fff; color: #666 !important;}
p{font-size: 400px;}
  </body>
</html>

请帮帮我!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-12-13 21:36:36

它应该显示compile '/stylesheet/',而不是compile '/stylesheets/',所以删除多余的s。路由规则也有类似的问题。

也没有:css过滤器。你想用它来达到什么目的?如果希望样式表按原样输出,则不需要过滤器。

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13860718

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档