add examples
This commit is contained in:
4
examples/templates/blog-post.html
Normal file
4
examples/templates/blog-post.html
Normal file
@@ -0,0 +1,4 @@
|
||||
{% extends "page.html" %}
|
||||
{% block body %}
|
||||
{{ this.body }}
|
||||
{% endblock %}
|
||||
6
examples/templates/blog.html
Normal file
6
examples/templates/blog.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{% extends "page.html" %}
|
||||
{% block body %}
|
||||
{% for child in this.children %}
|
||||
<a href="{{child|url}}">{{ child.title }}</a>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
3
examples/templates/example-advanced.html
Normal file
3
examples/templates/example-advanced.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<h2>Path: {{ this | url(absolute=True) }}</h2>
|
||||
<div>This is: {{this}}</div>
|
||||
<div>Children: {{this.children}}</div>
|
||||
7
examples/templates/example-config.html
Normal file
7
examples/templates/example-config.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<h2>Path: {{ this | url(absolute=True) }}</h2>
|
||||
<div>This is: {{this}}</div>
|
||||
<ul>
|
||||
{%- for child, extras in this.children.items() %}
|
||||
<li>Page: {{ child.path }}, Tags: {{ extras }}</li>
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
12
examples/templates/example-simple.html
Normal file
12
examples/templates/example-simple.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<h2>Path: {{ this | url(absolute=True) }}</h2>
|
||||
<div>This is: {{this}}</div>
|
||||
<ul>
|
||||
{%- for child, extras in this.children.items() %}
|
||||
<li>Page: {{ child.path }}</li>
|
||||
<ul>
|
||||
{%- for extra in extras %}
|
||||
Name: {{ extra.val }}, Tag count: {{ extra.tags_in_page }}
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
37
examples/templates/page.html
Normal file
37
examples/templates/page.html
Normal file
@@ -0,0 +1,37 @@
|
||||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>{% block title %}Welcome{% endblock %}</title>
|
||||
<style type="text/css">
|
||||
header, footer { padding: 1em; background: #DDD; }
|
||||
main { margin: 3em; }
|
||||
</style>
|
||||
<body>
|
||||
<header>
|
||||
<div>Nav:
|
||||
<a href="{{ '/'|url }}">Root</a>
|
||||
<a href="{{ '/blog'|url }}">Blog</a>
|
||||
<a href="{{ '/projects'|url }}">Projects</a>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<h2>{{ this.title }}</h2>
|
||||
{% block body %}{{ this.body }}{% endblock %}
|
||||
</main>
|
||||
<footer>
|
||||
<div>Simple Tags:
|
||||
{% for tag in ['blog','directory','blog-post','initial','samegroup'] %}
|
||||
<a href="/blog/simple/{{tag}}/">({{tag}})</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div>Config Tags:
|
||||
{% for tag in ['root','blog','directory','blog-post','initial','samegroup'] %}
|
||||
<a href="/config/{{tag}}.html">({{tag}})</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div>Advanced Tags:
|
||||
{% for tag in ['tag','two','blog'] %}
|
||||
<a href="/advanced/{{tag}}/">({{tag}})</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
Reference in New Issue
Block a user