Last active
December 16, 2015 07:49
-
-
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.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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