Skip to content

Instantly share code, notes, and snippets.

@tstone
Created October 5, 2012 22:57
Show Gist options
  • Save tstone/3842942 to your computer and use it in GitHub Desktop.
Save tstone/3842942 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Examples</title>
<!-- Tags have a default attribute which can be ommitted -->
<meta="keywords" content="template language" />
<meta="author" content="template language" />
<script>
alert('Supports embedded javascript!');
</script>
</head>
<body>
<h1>Markup examples</h1>
<!-- Tag ids and classes can be written css selector-like -->
<div#content>
<p>This example shows you how a basic template file looks like.</p>
<!-- code blocks appear on a line by themselves, starting with an @ -->
@yield
<!-- whitespace doesn't matter -->
@ if items
<table>
@for item in items
<tr>
<!-- substitutions can be either block with no whitespace... -->
<td.name>@{ item.name }</td>
<td.price>@{ item.price }</td>
</tr>
@end
</table>
@else
<p>No items found. Please ad some inventory. Thank you!</p>
@end
</div>
<div#footer>
@render 'footer'
<!-- or simple if surrounded by whitespace -->
Copyright © @:year @:author
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment