-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindiecard.html
74 lines (74 loc) · 3 KB
/
indiecard.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<html>
<head><title>{% if item %}{{" ".join(item.properties.name)}}{% else %}Indiecard{% endif %}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="styles/hfeed.css" media="all" rel="stylesheet" type="text/css" />
<link href="styles/indiecard.css" media="all" rel="stylesheet" type="text/css" />
<script src="static/fragmention.js"></script>
</head>
<body>
<header>
<form action="/indiecard" method="get">
<input name="url" type="url" placeholder="get card for url" />
<input type="submit" value="show indiecard" class="hidden"/>
</form>
</header>
<main>
{% for item in items %}
<div class="{{item.type[0]}} {% if item.type[0]=='h-recipe' %}hrecipe {% endif %}indiecard">
<h1 >{% if item.properties.photo %}
<a class="figure" href="{{url}}"><img src="{{item.properties.photo[0]}}" class="u-photo photo" /></a>
{% elif item.properties.featured %}
<a class="figure" href="{{url}}"><img src="{{item.properties.featured[0]}}" class="u-featured" /></a>
{% endif %}
<a class="u-url p-name fn" href="{{url}}">{{" ".join(item.properties.name)}}</a></h1>
{% if item.properties.author %}
{% if item.properties.author[0].properties %}
<h3 class="p-author author h-card">{% if item.properties.author[0].properties.photo %}<img src="{{item.properties.author[0].properties.photo[0]}}" class="u-photo" />{% endif %}{% if item.properties.author[0].properties.url %}<a class="u-url p-name"" href="{{item.properties.author[0].properties.url[0]}}">{{item.properties.author[0].properties.name[0]}}</a>{% else %}{{item.properties.author[0].properties.name[0]}}{% endif %}</h3>
{% else %}
<h3 class="p-author author">{{item.properties.author[0]}}</h3>
{% endif %}
{% endif %}
{% if item.properties.summary %}
<h2 class="p-summary summary">{{" ".join(item.properties.summary)}}</h2>
{% endif %}
{% if item.properties.content %}
<h2 class="e-content">{{" ".join(item.properties.content.html)}}</h2>
{% endif %}
{% if item.properties.ingredient %}
<h3>Ingredients</h3>
<ul>
{% for food in item.properties.ingredient %}<li class="ingredient p-ingredient">{{food}}{% endfor %}
</ul>
{% endif %}
{% if item.properties.instructions %}
<h3>Method</h3>
{% if item.properties.instructions|length ==1 %}
{% autoescape false %}
<p class="instructions p-instructions">{{item.properties.instructions[0]["html"] or item.properties.instructions[0]}}</p>
{% endautoescape %}
{% else %}
<ol>
{% autoescape false %}
{% for stage in item.properties.instructions %}<li class="instructions p-instructions">{{stage["html"] or stage}}{% endfor %}
{% endautoescape %}
</ol>
{% endif %}
{% endif %}
{% if item.properties.note %}
{% if item.properties.note[0].html %}
{% autoescape false %}
<h2 class="e-note">{{item.properties.note[0].html}}</h2>
{% endautoescape %}
{% else %}
<h2 class="p-note">{{" ".join(item.properties.note)}}</h2>
{% endif %}
{% endif %}
</div>
{% endfor %}
</main>
<footer>
{%if items %}<details><summary>raw</summary><code>{{items}}</code></details>{% endif %}
</footer>
</body>
</html>