Hyde LessCSS 插件不将 less 文件转换为 css
我一直在尝试用最新版本的Hyde(0.8.4)搭建一个网站。我使用内置的命令创建了一个网站,命令是hyde -s /path/to/dir create
,一切都很顺利。然后,我按照一些找到的例子,试着通过编辑site.yaml
文件来添加对LessCSS的支持:
plugins:
- hyde.ext.plugins.meta.MetaPlugin
- hyde.ext.plugins.auto_extend.AutoExtendPlugin
- hyde.ext.plugins.sorter.SorterPlugin
- hyde.ext.plugins.tagger.TaggerPlugin
- hyde.ext.plugins.syntext.SyntextPlugin
- hyde.ext.plugins.textlinks.TextlinksPlugin
- hyde.ext.plugins.less.LessCSSPlugin
# ...
less:
app: /path/to/lessc
我添加了一个非常简单的less文件来检查它是否有效:
/* content/media/css/style.less */
@color: blue;
body { background-color: @color; }
并把它包含在我的应用程序中:
<link rel="stylesheet" href="{{ media_url('css/style.css') }}">
当我生成网站时,我在命令行输出中看到了正确的css内容body{background-color:blue};
,但是文件deploy/media/css/style.css
只是less文件的一个副本。关于这方面的文档不是很好——有没有人成功过?谢谢。
1 个回答
1
Hyde有一套很全面的测试程序,结果显示less的css测试都通过了。所以less插件是可以正常工作的。我能想到的唯一问题就是less
这个二进制文件。Hyde的less插件是为了和JavaScript版本的less一起使用而写的,具体可以查看这个链接:https://github.com/cloudhead/less.js/。