forked from vuejs/v2.vuejs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.ejs
30 lines (30 loc) · 1.34 KB
/
page.ejs
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
<% if (page.type) { %>
<%- partial('partials/sidebar', { type: page.type, index: page.index }) %>
<% } else { %>
<div class="sidebar">
<ul class="main-menu">
<%- partial('partials/main_menu', { context: 'sidebar' }) %>
</ul>
</div>
<% } %>
<div class="content <%- page.type ? page.type + ' with-sidebar' : '' %> <%- page.type === 'guide' ? page.path.replace(/.+\//, '').replace('.html', '') + '-guide' : '' %>">
<%- partial('partials/ad') %>
<h1><%- page.title %><%- page.type === 'examples' ? ' Example' : '' %></h1>
<%- page.content %>
<% if (page.type === 'guide') { %>
<div class="guide-links">
<% site.pages.find({ type: page.type, order: page.order - 1 }).each(function (page) { %>
<span>← <a href="<%- url_for(page.path) %>"><%- page.title %></a></span>
<% }) %>
<% site.pages.find({ type: page.type, order: page.order + 1 }).each(function (page) { %>
<span style="float:right"><a href="<%- url_for(page.path) %>"><%- page.title %></a> →</span>
<% }) %>
</div>
<% } %>
<div class="footer">
Caught a mistake or want to contribute to the documentation?
<a href="https://github.com/vuejs/vuejs.org/blob/master/src/<%- page.path.replace(/\.html$/, '.md') %>" target="_blank">
Edit this page on Github!
</a>
</div>
</div>