Skip to content

Instantly share code, notes, and snippets.

@mrchrisadams
Created August 27, 2012 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrchrisadams/3487822 to your computer and use it in GitHub Desktop.
Save mrchrisadams/3487822 to your computer and use it in GitHub Desktop.
Doing something absurdly simple in Jade that surely shouldn't take more than 3 minutes, based on reading jade docs here - http://naltatis.github.com/jade-syntax-docs/
!!! 5
html
head
title my jade template
body
// does this work, trying to use the jade syntax to make an img tag by adding a trailing slash? Nope.
img(src="http://gravatar.com/avatar/927009d35360a64b8fb08bfddfe2f867?s=200&r=pg&d=404")/
// May be it's smart enough to add one by itself. No again. Oh dear. Is an image tag too much to ask? Come on guys!
img(src="http://gravatar.com/avatar/927009d35360a64b8fb08bfddfe2f867?s=200&r=pg&d=404")
h1 Hello #{name}
<!DOCTYPE html>
<html>
<head>
<title>my jade template</title>
</head>
<body>
<!-- does this work, adding a trailing slash? Nope.--><img src="http://gravatar.com/avatar/927009d35360a64b8fb08bfddfe2f867?s=200&amp;r=pg&amp;d=404">
<!-- // May be it's smart enough to add one by itself. No again. Oh dear. Is an image tag too much to ask? Come on guys!--><img src="http://gravatar.com/avatar/927009d35360a64b8fb08bfddfe2f867?s=200&amp;r=pg&amp;d=404">
<h1>Hello Bob</h1>
</body>
</html>
@tj
Copy link

tj commented Aug 27, 2012

when the doctype is "html" you dont need / ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment