【问题标题】:How to add conditional comments to hamlet templates?如何在 hamlet 模板中添加条件注释?
【发布时间】:2026-01-15 21:05:01
【问题描述】:

如何将conditional comments(或任何类型的 Html 评论)添加到Shakespearean templates

如果我添加

<!--[if IE 6]>
<link type="text/css" rel="stylesheet" href="..." media="screen">
<![endif]-->

我的小村庄模板只生成了一个空行。

【问题讨论】:

    标签: haskell yesod conditional-comments hamlet html


    【解决方案1】:

    脚手架项目在 templates/default-layout-wrapper.hamlet 中有一个条件 cmets 示例:

    \<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
    

    【讨论】: