Fix #263, document HTML comments & IE conditionals
authorjesper-mortensen <jesper.mortensen@bauria.com>
Thu, 5 Jun 2014 17:15:40 +0000 (19:15 +0200)
committerspf13 <steve.francia@gmail.com>
Mon, 30 Jun 2014 18:51:30 +0000 (14:51 -0400)
docs/content/templates/go-templates.md

index c9f6178ccbe33328005e2a69abea5d9403e85e71..cdc351fe90eb64ab14aabf71621e27ca1c63adcc 100644 (file)
@@ -221,6 +221,13 @@ Could be rewritten as
     Stuff Here 
     {{ end }}
 
+### Internet Explorer conditional comments using Pipes
+
+By default Go Templates remove HTML comments from output. This has the unfortunate side effect of removing Internet Explorer conditional comments. As a workaround, use something like this:
+
+    {{ "<!--[if lt IE 9]>" | safeHtml }}
+      <script src="html5shiv.js"></script>
+    {{ "<![endif]-->" | safeHtml }}
 
 ## Context (aka. the dot)