Documentation of overridable partials: https://github.com/groue/GRMustache/blob/master/Guides/partials.md
Created
September 23, 2012 12:21
-
-
Save groue/3770302 to your computer and use it in GitHub Desktop.
GRMustache: reuse common layout templates
This file contains 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
{{<layout}} | |
{{$page_title}} | |
{{title}} | |
{{/page_title}} | |
{{$page_content}} | |
<p>{{text}}</p> | |
<p>by {{author}}</p> | |
{{/page_content}} | |
{{/layout}} |
This file contains 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
<h1>{{$page_title}}Default title{{/page_title}}</h1> |
This file contains 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> | |
<head> | |
<title>{{$page_title}}Default title{{/page_title}}</title> | |
</head> | |
<body> | |
{{>header}} | |
{{$page_content}}Default content{{/page_content}} | |
</body> | |
</html> |
This file contains 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
id article = @{ | |
@"title": @"Layouts are awesome", | |
@"author": @"John Doe", | |
@"text": @"Lorem ipsum dolor sit amet, consectetur adipiscing elit." | |
}; | |
NSString *rendering = [GRMustacheTemplate renderObject:article | |
fromResource:@"article" | |
bundle:nil | |
error:NULL]; |
This file contains 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> | |
<head> | |
<title> | |
Layouts are awesome | |
</title> | |
</head> | |
<body> | |
<h1> | |
Layouts are awesome | |
</h1> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> | |
<p>by John Doe</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment