我有这个玉文件:如何包括在玉一个CSS文件(不链接)
!!! 5
html
head
title test include
style(type='text/css')
//- DOES NOT WORK!
include test.css
body
//- works
include test.css
div
//- works
include test.css
输出:
$ jade -P test.jade
rendered test.html
$ cat test.html
<!DOCTYPE html>
<html>
<head>
<title>test include</title>
<style type="text/css">
//- DOES NOT WORK!
include test.css
</style>
</head>
<body>body { color: peachpuff; }
<div> body { color: peachpuff; }
</div>
</body>
</html>
当然,我可以简单地链接的CSS文件, 但我不想。
我不认为这是可能的,但为什么不是简单的解决方案? – jsbeckr
我想你想要在服务器文件中将HTML与HTML分开,但在html中提供样式以避免获取CSS的额外请求。 这是错误的:你将不会被要求每一个时间,因为它会被缓存文件添加额外的计算(文件包含)。 –