Skip to content

Instantly share code, notes, and snippets.

@sevki
Last active January 10, 2016 13:11
Show Gist options
  • Select an option

  • Save sevki/e2ed0fbd7d44c7e7494f to your computer and use it in GitHub Desktop.

Select an option

Save sevki/e2ed0fbd7d44c7e7494f to your computer and use it in GitHub Desktop.
{{ template "root" .}}
{{define "title"}}Pic index{{end}}
{{define "content"}}
{{ range . }}
<p class="bla">
<a href="{{ .url }}">{{.title}}</a>
</p>
{{ end }}
{{ end }}
{{ template "root" .}}
{{define "title"}}{{.title}}{{end}}
{{define "content"}}
<img src="{{ .url }}" alt="{{.title}}" />
{{ end }}
{{define "root" }}
<!DOCTYPE html>
<html>
<head>
<title>{{template "title" .}}</title>
</head>
<body>
<header>
</header>
{{ template "content" .}}
<footer>
</footer>
</div>
</body>
</html>
{{end}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment