我有這個玉文件:如何包括在玉一個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的額外請求。 這是錯誤的:你將不會被要求每一個時間,因爲它會被緩存文件添加額外的計算(文件包含)。 –