Skip to content

Instantly share code, notes, and snippets.

@mindplay-dk
Last active December 16, 2015 07:49
Show Gist options
  • Select an option

  • Save mindplay-dk/5401019 to your computer and use it in GitHub Desktop.

Select an option

Save mindplay-dk/5401019 to your computer and use it in GitHub Desktop.
An HTML/PHP template syntax (hey, some of us like curly braces.)
html {
/* block comments */
head {
title = $title // insert $title into the title tag (HTML-escaped)
}
body {
#left { // <div id="left">
ul.nav-main { // <ul class="nav-main">
// foreach, if, while, etc. are keywords:
foreach $menu as $url => $title {
// double construction - a-tag inside an li-tag:
li a {
href: $url // href-attribute on the parent a-tag
= $title // insert $title into the a-tag (HTML-escaped)
}
}
}
}
#main {
h1.headline = $title // <h1 class="headline">
section {
// literal output: (not HTML-escaped)
== "What if <strong>HTML</strong> looked more like CSS?"
}
}
#footer {
p = "Copyright (C) " . date('Y')
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment