Aem 组件忽略了我的clientLib(不包括指向css的链接)

Aem 组件忽略了我的clientLib(不包括指向css的链接),aem,sightly,client-library,Aem,Sightly,Client Library,我使用以下示例: 但我的输出html文件不包含指向css文件的链接 样板文件sightlypage.html: <html> <sly data-sly-include="head.html" data-sly-unwrap /> <sly data-sly-include="/libs/wcm/core/components/init/init.jsp" data-sly-unwrap /> <body> <div data-sly

我使用以下示例: 但我的输出html文件不包含指向css文件的链接

样板文件sightlypage.html:

<html>
<sly data-sly-include="head.html" data-sly-unwrap />
<sly data-sly-include="/libs/wcm/core/components/init/init.jsp" data-sly-unwrap />
<body>
    <div data-sly-test="${wcmmode.edit}"> 
        <!--/* Show only in edit (author) mode */-->
        <h1>Simple Page Component Using Sightly</h1>
    </div>

    <div class="flex-row"> 
        <div class="col-half">First column</div>
        <div class="col-half">Second column</div> 
    </div>

<div data-sly-resource="${@path='par',resourceType='wcm/foundation/components/parsys'}"></div>
</body>
</html>
CSS文件位置:
/etc/designs/alexpi training/clientLib/css/first.css
/etc/designs/alexpi training/clientLib/css/flex.css

我看到其中包括“head.html”:

<head>
<meta http-equiv="”content-type”" content="”text/html;" charset="UTF-8”">
<title>AP empty sightly page with clienlib</title>

<link rel="stylesheet"href="/libs/cq/gui/components/authoring/clientlibs/page.css" type="text/css">
<script type="text/javascript" src="/libs/granite/author/deviceemulator/clientlibs.js"></script>
<script type="text/javascript" src="/libs/cq/gui/components/authoring/clientlibs/page.js"></script>
</head>

AP用clienlib清空页面

要通过
选项传递数组
需要使用
${myVar@optName=[myVar,'string']}
语法

在your head.html中:

<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"
    data-sly-call="${clientlib.css @ categories=['alexpi', 'flex']}"/>


注意:
categories=['alexpi','flex']

要通过
选项传递数组
您需要使用
${myVar@optName=[myVar,'string']}
语法

在your head.html中:

<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"
    data-sly-call="${clientlib.css @ categories=['alexpi', 'flex']}"/>


注意:
categories=['alexpi','flex']

我认为您的问题可能与多个类别有关。可能在clientlib定义中有一些空格字符,例如在'flex'之前。若要检查,请尝试删除其中一个类别,然后只包含一个。我认为您的问题可能与多个类别有关。可能在clientlib定义中有一些空格字符,例如在'flex'之前。若要检查,请尝试删除其中一个类别,然后仅包含一个类别。
<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"
    data-sly-call="${clientlib.css @ categories=['alexpi', 'flex']}"/>