我在Sitecore SXA元数据部分设计中使用了一个HTML片段,在结果HTML的头部添加了一些链接:

这个HTML是:
<link rel="stylesheet" href="https://unpkg.com/sxa-umbrella-webcomponents@0.0.1/dist/sxa-umbrella-webcomponents/sxa-umbrella-webcomponents.css" />
<script type="module" src="https://unpkg.com/sxa-umbrella-webcomponents@0.0.1/dist/sxa-umbrella-webcomponents/sxa-umbrella-webcomponents.esm.js"></script>
<script nomodule src="https://unpkg.com/sxa-umbrella-webcomponents@0.0.1/dist/sxa-umbrella-webcomponents/sxa-umbrella-webcomponents.js"></script>但我希望可以使用令牌来配置基本路径,例如:
<link rel="stylesheet" href="$WebComponentsBasePath/sxa-umbrella-webcomponents.css" />
<script type="module" src="$WebComponentsBasePath/sxa-umbrella-webcomponents.esm.js"></script>
<script nomodule src="$WebComponentsBasePath/sxa-umbrella-webcomponents.js"></script>其中,令牌设置为:"https://unpkg.com/sxa-umbrella-webcomponents@0.0.1/dist/sxa-umbrella-webcomponents。
但是标记替换在HTML代码片段中不起作用。
关于如何使元数据部分设计的基本路径可配置,以便我可以对我的开发环境和生产环境进行不同的配置,并能够轻松地切换生产环境中的基本路径,以基于已配置的基本路径前滚或回滚所用文件的版本,您有什么想法吗?
发布于 2020-09-02 06:12:21
您是否会考虑为这3个文件创建一个主题,并将其包含在您的站点主题中?
https://stackoverflow.com/questions/63629474
复制相似问题