gpt4 book ai didi

node.js - 如何在 Jade 中包含一个css文件(不链接它)

转载 作者:IT老高 更新时间:2023-10-28 23:18:24 26 4
gpt4 key购买 nike

我有这个 Jade 文件:

!!! 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 文件,但我不想这样做。

最佳答案

我还没有测试它(不是在我的开发计算机 ATM 上)但是有机会做这样的事情可以工作:

!!!
head
title test include
| <style type='text/css'>
include test.css
| </style>

顺便说一句,我找到了 HTML2Jade 在线转换器,但没有找到 Jade2HTML。知道在哪里可以找到它吗?

关于node.js - 如何在 Jade 中包含一个css文件(不链接它),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10595593/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com