forked from nanjizal/code-cookbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayout-page-snippet.mtt
100 lines (96 loc) · 5.61 KB
/
layout-page-snippet.mtt
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
::use 'layout.mtt'::
<header class="hero-unit-small">
<div class="container">
<div class="row">
<div id="title">Haxe Code Cookbook</div>
</div>
</div>
</header>
<main class="container">
<section class="row">
<nav class="span4 sidebar-toc" id="sidebar" ::cond currentPage.customData.tag==null::>
<h3>Table of contents</h3>
<ul class="unstyled" itemscope="itemscope" itemtype="http://schema.org/BreadcrumbList">
::foreach category sitemap::
<li ::cond !category.isSerie::><a href="::category.outputPath::" ::attr class if(category==currentCategory) "active"::>::category.title::</a>
<ul class="unstyled" >
::foreach page category.pages::
<li ::cond page.visible:: ::attr class if(page==currentPage) "active":: itemprop="itemListElement" itemscope="itemscope" itemtype="http://schema.org/ListItem"><a href="::page.outputPath::" itemprop="item"><span itemprop="name">::page.title::</span></a>
<ol itemscope="itemscope" itemtype="http://schema.org/BreadcrumbList" ::cond page.category.isSerie && page.category==currentPage.category::>
::foreach page page.category.pages::
<li ::cond page.visible && !page.isSerieHome():: ::attr class if(page==currentPage) "active":: itemprop="itemListElement" itemscope="itemscope" itemtype="http://schema.org/ListItem"><a href="::page.outputPath::" itemprop="item"><span itemprop="name">::page.title::</span></a></li>
::end::
</ol>
</li>
::end::
</ul>
</li>
<br/>
::end::
</ul>
</nav>
<nav class="span4 sidebar-tags" id="sidebar" ::cond currentPage.customData.tag!=null::>
<h3>All tags</h3>
<ul class="unstyled" itemscope="itemscope" itemtype="http://schema.org/BreadcrumbList">
::foreach tag tags.keys()::
<li ::attr class if(tag==currentPage.customData.tag) "active":: itemprop="itemListElement" itemscope="itemscope" itemtype="http://schema.org/ListItem"><i class="fa fa-tag"></i> <a href="tag/::tag::.html" rel="tag" itemprop="item"><span itemprop="name">::getTagTitle(tag)::</span></a> <small class="category-count">(::tags.get(tag).length::)</small></li>
::end::
</ul>
</nav>
<article class="span8" itemscope="itemscope" itemtype="http://schema.org/Article">
<h1><a href="::currentPage.absoluteUrl::" itemprop="url" class="anchorjs-icons"></a> <span itemprop="name">::currentPage.title::</span></h1>
<div itemprop="articleBody">::raw pageContent::</div>
<time datetime="::currentPage.dates.created::" itemprop="datePublished" class="semantic">::currentPage.dates.created::</time>
<time datetime="::currentPage.dates.modified::" itemprop="dateModified" class="semantic">::currentPage.dates.modified::</time>
<hr/>
<div ::cond (currentPage.next!=null || currentPage.prev!=null)::>
<ul class="pager">
<li class="previous" ::cond currentPage.prev!=null::><a href="::currentPage.prev.outputPath::">← ::currentPage.prev.title::</a></li>
<li class="previous" ::cond currentPage.prev==null::><a href="::currentPage.category.outputPath::">← ::currentPage.category.title::</a></li>
<li class="next" ::cond currentPage.next!=null::><a href="::currentPage.next.outputPath::">::currentPage.next.title:: →</a></li>
</ul>
</div>
<div ::cond !currentPage.category.isSerie::>
Category:
<span itemprop="articleSection"><i class="fa fa-book"></i> <a href="::currentCategory.outputPath::">::currentCategory.title::</a></span>
</div>
<div class="tags" ::cond currentPage.visible && currentPage.tags!=null && currentPage.tags.length>0::>
Tags:
<span itemprop="keywords">
::foreach tag currentPage.tags::
<span class="tag"><i class="fa fa-tag"></i> <a href="tag/::tag::.html" rel="tag">::tag::</a><i class="semantic" ::cond !repeat.tag.last::>,</i></span>
::end::
</span>
</div>
<hr/>
<div class="contribution">
<span><i class="fa fa-lightbulb-o"></i> <a href="::currentPage.editUrl::" rel="external">Suggest improvement</a></span>
<span>| <i class="fa fa-exclamation-circle"></i> <a href="https://github.com/HaxeFoundation/code-cookbook/issues/new?title=[::currentPage.title::]&body=%0A%0ASources:%0A*%20::currentPage.absoluteUrl::%0A*%20::currentPage.contributionUrl::" rel="external">Report issue</a></span>
<span ::cond !currentPage.category.isSerie::>| <i class="fa fa-plus-circle"></i> <a href="::currentPage.addLinkUrl::" rel="external">Add new snippet</a></span>
</div>
<hr/>
<div class="share-buttons">
<!-- G+ button code -->
<script src="https://apis.google.com/js/platform.js" async="async" defer="defer"></script>
<div class="g-plus" data-action="share" data-annotation="bubble" style="display:inline-block"></div>
<!-- Twitter button code -->
<a href="https://twitter.com/share" class="twitter-share-button" style="display:inline-block" data-show-count="false">Tweet</a>
<script async="async" src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
<!-- Load Facebook SDK for JavaScript -->
<div id="fb-root" style="display:inline-block"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<!-- FB like button code -->
<div class="fb-like" data-href="::currentPage.absoluteUrl::" style="display:inline-block" data-layout="button_count" data-action="like" data-show-faces="true"></div>
</div>
</article>
</section>
</main>
::end::