Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在标准HTML中使用Piler而不是Jade?_Html_Node.js_Pug_Piler - Fatal编程技术网

如何在标准HTML中使用Piler而不是Jade?

如何在标准HTML中使用Piler而不是Jade?,html,node.js,pug,piler,Html,Node.js,Pug,Piler,我将Node.js与Piler()一起使用。 项目网站上的示例演示了如何将Piler与index.jade文件一起使用 index.jade: !!! 5 html head !{css} !{js} body h1 Hello Piler !{css}和!{js}标记将在索引文件交付给客户端时转换为相应的html标记 例如: 如果没有index.jade文件而使用index.html文件,如何使用Piler? 什么是!{css}和!{js}标签在index.h

我将Node.js与Piler()一起使用。 项目网站上的示例演示了如何将Piler与index.jade文件一起使用

index.jade:

!!! 5
html
  head
    !{css}
    !{js}
  body
    h1 Hello Piler
!{css}
!{js}
标记将在索引文件交付给客户端时转换为相应的html标记

例如:

如果没有index.jade文件而使用index.html文件,如何使用Piler? 什么是
!{css}
!{js}
标签在index.html中应该是什么样子

换句话说:我不想将Piler与Jade一起使用,而是与标准html一起使用


提前感谢。

Piler默认情况下会将js和css的concat版本存储在Piler缓存目录中,您可以在创建js/css管理器时通过传递
outputDirectory
参数来指定该目录

pilerCachePath = '/www/your-project/public-path/assets/';
var clientjs = piler.createJSManager({outputDirectory: pilerCachePath});
var clientcss = piler.createCSSManager({outputDirectory: pilerCachePath});
您可以定义一个可以访问的公共路径,然后在html中使用这些路径

<!-- ... -->
<link rel="stylesheet" type="text/css" href="/assets/global.css">
</head>
<body>
<!-- ... -->
<script type="text/javascript" src="/assets/global.js"></script>
</body>

但是,我建议为此目的使用。他们的文档对如何使用它有详细的说明