ho questo file giada:Come includere un file CSS in giada (senza collegarlo)
!!! 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
L'output:
$ 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>
Naturalmente, si potrebbe semplicemente collegare il css file , ma io non voglio.
Non penso sia possibile, ma perché non la soluzione semplice? – jsbeckr
Immagino che vogliate separare CSS da HTML nei file server, ma fornire lo stile in html per evitare ulteriori richieste di ottenere il CSS. Questo è sbagliato: si aggiunge ulteriore elaborazione (inclusione di file) per un file che non verrebbe richiesto ogni volta perché sarebbe stato memorizzato nella cache. –