Prevent insertion of `buildId` in HTML generated by OxygenXML.

huangapple go评论51阅读模式
英文:

Prevent insertion of `buildId` in HTML generated by OxygenXML

问题

以下是翻译好的部分:

我有一些DITA内容,我通过OxygenXML将其发布为HTML响应式Web帮助。

对于每次导出,OxygenXML都会将日期时间附加到每个导入项,作为buildId

<link rel="stylesheet" type="text/css" href="../../../oxygen-webhelp/template/oxygen.css?buildId=2023042410"/>

日期时间对于每次发布运行都是唯一的,这可能会使我们的版本控制系统认为内容已经更改,尽管实际上没有更改。

当导出到HTML时,DITA_OT不会指定buildId - 因此,如果内容没有更改,它不会成为新版本。

<link rel="stylesheet" type="text/css" href="../../../commonltr.css">

在OxygenXML到HTML发布过程中是否可能抑制buildId的包含?

英文:

I have some DITA content that I am publishing to HTML Responsive Webhelp via OxygenXML

For each export, OxygenXML appends the date-time to each import, as a buildId:

<link rel="stylesheet" type="text/css" href="../../../oxygen-webhelp/template/oxygen.css?buildId=2023042410"/>

The date-time is unique for each publishing run, and can make it appear to our Version Control System that the content has changed - though it hasn't actually.

DITA_OT does not specify the buildId when exporting to HTML - so if none of the content has changed, it's not a new version.

<link rel="stylesheet" type="text/css" href="../../../commonltr.css">

Is it possible to suppress inclusion of the buildId in HTML imports in the OxygenXML to HTML publishing process?

答案1

得分: 1

以下是翻译的部分:

在这个构建文件中"DITA-OT/plugins/com.oxygenxml.webhelp.responsive/build_dita_template.xml",有一个名为"init-whr-version"的目标,它设置了此属性"webhelp.transformation.timestamp"的值。

<target name="init-whr-version">
    <!-- WebHelp版本和构建号。 -->
    <property name="webhelp.version" value="26.0"/>
    <property name="webhelp.build.number" value="2023080314"/>
    <echo>Oxygen XML WebHelp ${webhelp.version} build ${webhelp.build.number}</echo>
    <tstamp>
        <format property="webhelp.transformation.timestamp" pattern="yyyyMMddHHmmss"/>
    </tstamp>
</target>

我不确定控制此值的优雅方式是什么,理想情况下,您不应在我们的"com.oxygenxml.webhelp.responsive"插件内进行更改,也许您可以联系Oxygen XML支持渠道(电子邮件、论坛或技术支持表单),提供给他们此帖子的链接,我的WebHelp支持团队同事可以提供进一步帮助。

忘了告诉您为什么我们这样做。Web浏览器会缓存JavaScript和CSS文件,如果这些JS和CSS文件发生更改(无论是您修改的自定义WebHelp CSS还是我们在WebHelp插件版本发布之间修改的CSS和JavaScript),则Web浏览器可能仍然加载来自较早WebHelp版本的CSS和JavaScript,从而呈现不准确的内容。因此,您的用户在某个时候可能加载网页并看到带有破碎布局的HTML内容,这就是移除这些时间戳的危险之处。

英文:

If you look in this build file "DITA-OT/plugins/com.oxygenxml.webhelp.responsive/build_dita_template.xml" there is a target named "init-whr-version" which sets up the value for this property "webhelp.transformation.timestamp".

&lt;target name=&quot;init-whr-version&quot;&gt;
  &lt;!-- WebHelp version &amp; build number. --&gt;
  &lt;property name=&quot;webhelp.version&quot; value=&quot;26.0&quot;/&gt;
  &lt;property name=&quot;webhelp.build.number&quot; value=&quot;2023080314&quot;/&gt;
  &lt;echo&gt;Oxygen XML WebHelp ${webhelp.version} build ${webhelp.build.number}&lt;/echo&gt;
  &lt;tstamp&gt;
       &lt;format property=&quot;webhelp.transformation.timestamp&quot; pattern=&quot;yyyyMMddHHmmss&quot;/&gt;
	&lt;/tstamp&gt;
&lt;/target&gt;

I'm not sure what the elegant way to control this value would be, ideally you would not make changes inside our "com.oxygenxml.webhelp.responsive" plugin, maybe you can contact an Oxygen XML support channel (email, forum or tech support form), give them a link to this post and my colleagues from the WebHelp support team can help further.

Forgot to give you the reason for why we do this. Web browsers cache Javascript and CSS files and if those JS and CSS files change (either you have custom WebHelp CSSs which you modify or we modify the CSSs and Javascripts between WebHelp plugin version releases) the web browser may still load the CSSs and Javascripts from older WebHelp versions thus presenting content which is not accurately displayed. So your users may at some point load the web page and see the HTML content with broken layout, this would be the danger of removing those timestamps.

huangapple
  • 本文由 发表于 2023年8月4日 22:12:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/76836718.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定