Skip to content

Commit f780733

Browse files
committed
move search to sidebar
1 parent 98b4106 commit f780733

16 files changed

+235
-221
lines changed

src/_css

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../themes/aframe/source/css/

src/_html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../themes/aframe/layout/

src/_js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../themes/aframe/source/js/

themes/aframe/layout/blog.ejs

+99-97
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<%- partial('partials/secondary/sidebar_wordmark') %>
12
<aside id="sidebar" class="sidebar borderless-links">
23
<%- partial('partials/secondary/sidebar_header', {site: site}) %>
34

@@ -17,122 +18,123 @@
1718
</div>
1819
</aside>
1920

20-
<div class="content content--blog copy post <% if (page.awoa && !page.awoa.projects) { %>content--awoa<% } %>">
21-
<%- partial('partials/secondary/mobile_header') %>
21+
<div class="content content--blog copy post <% if (page.awoa && !page.awoa.projects) { %>content--awoa<% } %>">
22+
<%- partial('partials/secondary/mobile_header') %>
2223

23-
<div class="copy__wrap">
24-
<% if (page.blog_index) { %>
25-
<h1 class="page__title"><%- config.blog_title %></h1>
24+
<div class="copy__wrap">
25+
<% if (page.blog_index) { %>
26+
<h1 class="page__title"><%- config.blog_title %></h1>
2627
27-
<%- page.content %>
28+
<%- page.content %>
2829
29-
<% page.posts.each(function (post) { %>
30-
<article class="post post--listing">
31-
<a href="<%- page_url(post.path) %>">
32-
<h2 class="post__heading"><%- post.title %></h2>
33-
</a>
34-
<%- partial('partials/blog/metadata', {post: post}) %>
30+
<% page.posts.each(function (post) { %>
31+
<article class="post post--listing">
32+
<a href="<%- page_url(post.path) %>">
33+
<h2 class="post__heading"><%- post.title %></h2>
34+
</a>
35+
<%- partial('partials/blog/metadata', {post: post}) %>
36+
37+
<% if (post.awoa) { %>
38+
<% if (post.from) { %>
39+
<i>What's up with A-Frame, a WebVR framework for building virtual reality experiences, from <%= blog_date(post.from) %> to <%= blog_date(post.date) %>.</i>
40+
<% } else { %>
41+
<i>What's up with A-Frame, a WebVR framework for building virtual reality experiences, for the week of <%= blog_date_subtract_week(post.date) %> to <%= blog_date(post.date) %>.</i>
42+
<% } %>
43+
<%- partial('partials/blog/awoa_projects_showcase', {
44+
projects: post.awoa.projects
45+
}) %>
46+
<% } %>
47+
48+
<% if (post.excerpt) { %>
49+
<% if (!post.awoa) { %>
50+
<%- partial('partials/blog/image', {image: post.image, title: post.title}) %>
51+
<% } %>
52+
<div class="post__excerpt"><%- post.excerpt %></div>
53+
<% } %>
54+
55+
<a href="<%- page_url(post.path) %>" class="post__more">Read more &hellip;</a>
56+
</article>
57+
<% }) %>
3558
36-
<% if (post.awoa) { %>
37-
<% if (post.from) { %>
38-
<i>What's up with A-Frame, a WebVR framework for building virtual reality experiences, from <%= blog_date(post.from) %> to <%= blog_date(post.date) %>.</i>
59+
<footer class="footer guide-links c">
60+
<% var prevPost = page.prev %>
61+
<% var nextPost = page.next %>
62+
<% if (page.prev) { %>
63+
<span class="float-left"><a href="<%- page_url(prevPost.path) %>" class="guide-link guide-link-left"><%- prevPost.title %></a></span>
64+
<% } %>
65+
<% if (page.next) { %>
66+
<span class="float-right"><a href="<%- page_url(nextPost.path) %>" class="guide-link guide-link-right"><%- nextPost.title %></a></span>
67+
<% } %>
68+
</footer>
69+
<% } else { %>
70+
<article class="post post-full">
71+
<p class="page__section">
72+
<a href="<%- url_for('blog/') %>" class="borderless-link">Blog</a>
73+
</p>
74+
75+
<h1 class="page__title post__heading"><%- page.title %></h1>
76+
<%- partial('partials/blog/metadata', {post: page}) %>
77+
78+
<% if (page.awoa) { %>
79+
<% if (page.from) { %>
80+
<i>What's up with A-Frame, a WebVR framework for building virtual reality experiences, from <%= blog_date(page.from) %> to <%= blog_date(page.date) %>.</i>
3981
<% } else { %>
40-
<i>What's up with A-Frame, a WebVR framework for building virtual reality experiences, for the week of <%= blog_date_subtract_week(post.date) %> to <%= blog_date(post.date) %>.</i>
82+
<i>What's up with A-Frame, a WebVR framework for building virtual reality experiences, for the week of <%= blog_date_subtract_week(page.date) %> to <%= blog_date(page.date) %>.</i>
4183
<% } %>
4284
<%- partial('partials/blog/awoa_projects_showcase', {
43-
projects: post.awoa.projects
85+
projects: page.awoa.projects
4486
}) %>
4587
<% } %>
4688
47-
<% if (post.excerpt) { %>
48-
<% if (!post.awoa) { %>
49-
<%- partial('partials/blog/image', {image: post.image, title: post.title}) %>
50-
<% } %>
51-
<div class="post__excerpt"><%- post.excerpt %></div>
89+
<% if (!page.awoa) { %>
90+
<%- partial('partials/blog/image', {image: page.image, title: page.title}) %>
5291
<% } %>
5392
54-
<a href="<%- page_url(post.path) %>" class="post__more">Read more &hellip;</a>
93+
<%- page.content %>
94+
95+
<% if (page.awoa) { %>
96+
<%- partial('partials/blog/awoa_projects_text', {projects: page.awoa.projects}) %>
97+
<%- partial('partials/blog/awoa_media',
98+
{media: page.awoa.media}) %>
99+
<%- partial('partials/blog/awoa_contributions',
100+
{contributions: page.awoa.contributions}) %>
101+
<% } %>
55102
</article>
56-
<% }) %>
57103
58-
<footer class="footer guide-links c">
59-
<% var prevPost = page.prev %>
60-
<% var nextPost = page.next %>
61-
<% if (page.prev) { %>
62-
<span class="float-left"><a href="<%- page_url(prevPost.path) %>" class="guide-link guide-link-left"><%- prevPost.title %></a></span>
63-
<% } %>
64-
<% if (page.next) { %>
65-
<span class="float-right"><a href="<%- page_url(nextPost.path) %>" class="guide-link guide-link-right"><%- nextPost.title %></a></span>
66-
<% } %>
67-
</footer>
68-
<% } else { %>
69-
<article class="post post-full">
70-
<p class="page__section">
71-
<a href="<%- url_for('blog/') %>" class="borderless-link">Blog</a>
72-
</p>
73-
74-
<h1 class="page__title post__heading"><%- page.title %></h1>
75-
<%- partial('partials/blog/metadata', {post: page}) %>
76-
77-
<% if (page.awoa) { %>
78-
<% if (page.from) { %>
79-
<i>What's up with A-Frame, a WebVR framework for building virtual reality experiences, from <%= blog_date(page.from) %> to <%= blog_date(page.date) %>.</i>
80-
<% } else { %>
81-
<i>What's up with A-Frame, a WebVR framework for building virtual reality experiences, for the week of <%= blog_date_subtract_week(page.date) %> to <%= blog_date(page.date) %>.</i>
104+
<footer class="footer guide-links c">
105+
<% // Yes, these are correct. %>
106+
<% var prevPost = page.next %>
107+
<% var nextPost = page.prev %>
108+
<% if (prevPost) { %>
109+
<span class="float-left"><a href="<%- page_url(prevPost.path) %>" class="guide-link guide-link-left"><%- prevPost.title %></a></span>
82110
<% } %>
83-
<%- partial('partials/blog/awoa_projects_showcase', {
84-
projects: page.awoa.projects
85-
}) %>
86-
<% } %>
111+
<% if (nextPost) { %>
112+
<span class="float-right"><a href="<%- page_url(nextPost.path) %>" class="guide-link guide-link-right"><%- nextPost.title %></a></span>
113+
<% } %>
114+
</footer>
115+
<% } %>
87116

88-
<% if (!page.awoa) { %>
89-
<%- partial('partials/blog/image', {image: page.image, title: page.title}) %>
117+
<footer class="footer footnote">
118+
<p>Except where otherwise noted, content on this site is licensed under the <a href="https://creativecommons.org/licenses/by-sa/3.0/" rel="external">Creative Commons Attribution Share-Alike License v3.0</a> or any later version.</p>
119+
<% if (!page.blog_index) { %>
120+
<p>Found a typo or suggestion for the docs? <br><br> <a href="<%- website_github_edit_url('_posts/' + page.slug + '.md') %>" class="github-file-link" rel="external">Suggest an edit on GitHub</a></p>
90121
<% } %>
91122
92-
<%- page.content %>
93-
94-
<% if (page.awoa) { %>
95-
<%- partial('partials/blog/awoa_projects_text', {projects: page.awoa.projects}) %>
96-
<%- partial('partials/blog/awoa_media',
97-
{media: page.awoa.media}) %>
98-
<%- partial('partials/blog/awoa_contributions',
99-
{contributions: page.awoa.contributions}) %>
100-
<% } %>
101-
</article>
102-
103-
<footer class="footer guide-links c">
104-
<% // Yes, these are correct. %>
105-
<% var prevPost = page.next %>
106-
<% var nextPost = page.prev %>
107-
<% if (prevPost) { %>
108-
<span class="float-left"><a href="<%- page_url(prevPost.path) %>" class="guide-link guide-link-left"><%- prevPost.title %></a></span>
109-
<% } %>
110-
<% if (nextPost) { %>
111-
<span class="float-right"><a href="<%- page_url(nextPost.path) %>" class="guide-link guide-link-right"><%- nextPost.title %></a></span>
112-
<% } %>
123+
<span class="sponsor" itemscope itemprop="organization" itemtype="http://schema.org/Organization">
124+
<div class="message">Supported by</div>
125+
<span itemprop="sponsor" itemscope itemtype="http://schema.org/Organization">
126+
<a class="mozilla-logo" itemprop="url" href="https://www.mozilla.org/" rel="external">
127+
<span itemprop="name"></span>
128+
</a>
129+
</span>
130+
</span>
113131
</footer>
114-
<% } %>
115-
116-
<footer class="footer footnote">
117-
<p>Except where otherwise noted, content on this site is licensed under the <a href="https://creativecommons.org/licenses/by-sa/3.0/" rel="external">Creative Commons Attribution Share-Alike License v3.0</a> or any later version.</p>
118-
<% if (!page.blog_index) { %>
119-
<p>Found a typo or suggestion for the docs? <br><br> <a href="<%- website_github_edit_url('_posts/' + page.slug + '.md') %>" class="github-file-link" rel="external">Suggest an edit on GitHub</a></p>
120-
<% } %>
132+
</div>
121133
122-
<span class="sponsor" itemscope itemprop="organization" itemtype="http://schema.org/Organization">
123-
<div class="message">Supported by</div>
124-
<span itemprop="sponsor" itemscope itemtype="http://schema.org/Organization">
125-
<a class="mozilla-logo" itemprop="url" href="https://www.mozilla.org/" rel="external">
126-
<span itemprop="name"></span>
127-
</a>
128-
</span>
129-
</span>
130-
</footer>
134+
<% if (!page.blog_index && !page.awoa) { %>
135+
<div class="secondary-sidebar">
136+
<%- partial('partials/toc', {page: page}) %>
137+
</div>
138+
<% } %>
131139
</div>
132-
133-
<% if (!page.blog_index && !page.awoa) { %>
134-
<div class="secondary-sidebar">
135-
<%- partial('partials/toc', {page: page}) %>
136-
</div>
137-
<% } %>
138140
</div>

themes/aframe/layout/docs.ejs

+49-47
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<% var activeVersion = docs_active_version(page) %>
33

44
<!-- Navigation. -->
5+
<%- partial('partials/secondary/sidebar_wordmark') %>
56
<aside id="sidebar" class="sidebar borderless-links">
67
<%- partial('partials/secondary/sidebar_header', {site: site}) %>
78

@@ -43,60 +44,61 @@
4344
</div>
4445
</aside>
4546

46-
<!-- Documentation. -->
47-
<div class="content content--structured content--<%- page.type %> copy">
48-
<%- partial('partials/secondary/mobile_header') %>
47+
<!-- Documentation. -->
48+
<div class="content content--structured content--<%- page.type %> copy">
49+
<%- partial('partials/secondary/mobile_header') %>
4950

50-
<div class="copy__wrap">
51-
<div class="page__section docs-header">
52-
<p>
53-
<a href="<%- page_url(activeSection.path) %>" class="borderless-link">
54-
<%- activeVersion %> &rsaquo; <%= activeSection.section_title %>
55-
</a>
56-
</p>
57-
<%- partial('partials/search_field', {location: 'docs'}) %>
58-
</div>
59-
<h1 class="page__title">
60-
<%- page.title.replace('<', '&lt;').replace('>', '&gt;') %>
61-
</h1>
51+
<div class="copy__wrap">
52+
<div class="page__section docs-header">
53+
<p>
54+
<a href="<%- page_url(activeSection.path) %>" class="borderless-link">
55+
<%- activeVersion %> &rsaquo; <%= activeSection.section_title %>
56+
</a>
57+
</p>
58+
</div>
59+
<h1 class="page__title">
60+
<%- page.title.replace('<', '&lt;').replace('>', '&gt;') %>
61+
</h1>
6262

63-
<% if (page.image) { %>
64-
<img src="<%= page.image.src %>">
65-
<% } %>
63+
<% if (page.image) { %>
64+
<img src="<%= page.image.src %>">
65+
<% } %>
6666

67-
<% var currentDocs = docs_root_path(site.pages, config.aframe_version) %>
68-
<% if (activeVersion === 'master') { %>
69-
<%- markdown("> **NOTE:** This version of the documentation tracks **unstable** development happening on [A-Frame's `master` branch](https://github.com/aframevr/aframe/tree/master/dist). If you wish to try it out, grab the [unstable build](https://github.com/aframevr/aframe/tree/master/dist#a-frame-builds). Otherwise, head to the [documentation for the current " + config.aframe_version + " version](" + currentDocs + ")") %>
70-
<% } else if (activeVersion !== config.aframe_version) { %>
71-
<%- markdown("> **Note:** This documentation is for the old " + activeVersion + " version of A-Frame. Check out the [documentation for the current " + config.aframe_version + " version](" + currentDocs + ")") %>
72-
<% } %>
67+
<% var currentDocs = docs_root_path(site.pages, config.aframe_version) %>
68+
<% if (activeVersion === 'master') { %>
69+
<%- markdown("> **NOTE:** This version of the documentation tracks **unstable** development happening on [A-Frame's `master` branch](https://github.com/aframevr/aframe/tree/master/dist). If you wish to try it out, grab the [unstable build](https://github.com/aframevr/aframe/tree/master/dist#a-frame-builds). Otherwise, head to the [documentation for the current " + config.aframe_version + " version](" + currentDocs + ")") %>
70+
<% } else if (activeVersion !== config.aframe_version) { %>
71+
<%- markdown("> **Note:** This documentation is for the old " + activeVersion + " version of A-Frame. Check out the [documentation for the current " + config.aframe_version + " version](" + currentDocs + ")") %>
72+
<% } %>
7373

74-
<%- page.content %>
74+
<%- page.content %>
7575

76-
<!-- Previous / Next navigation. -->
77-
<footer class="footer guide-links c">
78-
<% docs_version_filter(site.pages.find({type: page.type, order: page.order - 1}),
79-
activeVersion).each(function (page) { %>
80-
<span class="float-left">
81-
<a href="<%- page_url(page.path) %>" class="guide-link guide-link-left"><%= page.title %> </a></span>
82-
<% }) %>
83-
<% docs_version_filter(site.pages.find({type: page.type, order: page.order + 1}),
84-
activeVersion).each(function (page) { %>
85-
<span class="float-right">
86-
<a href="<%- page_url(page.path) %>" class="guide-link guide-link-right"><%= page.title %></a></span>
87-
<% }) %>
88-
</footer>
76+
<!-- Previous / Next navigation. -->
77+
<footer class="footer guide-links c">
78+
<% docs_version_filter(site.pages.find({type: page.type, order: page.order - 1}),
79+
activeVersion).each(function (page) { %>
80+
<span class="float-left">
81+
<a href="<%- page_url(page.path) %>" class="guide-link guide-link-left"><%= page.title %> </a></span>
82+
<% }) %>
83+
<% docs_version_filter(site.pages.find({type: page.type, order: page.order + 1}),
84+
activeVersion).each(function (page) { %>
85+
<span class="float-right">
86+
<a href="<%- page_url(page.path) %>" class="guide-link guide-link-right"><%= page.title %></a></span>
87+
<% }) %>
88+
</footer>
8989

90-
<%- partial('partials/docs/footer', {item: page}) %>
91-
</div>
90+
<%- partial('partials/docs/footer', {item: page}) %>
91+
</div>
9292

93-
<div class="secondary-sidebar">
94-
<%- partial('partials/toc', {page: page}) %>
95-
<div class="doc-actions">
96-
<a class="docs-suggest-edit github-file-link" href="<%- website_github_edit_url(page.path) %>" target="_blank" rel="external">Edit Page</a>
97-
<% if (page.source_code) { %>
98-
<a class="docs-view-source github-file-link" href="https://github.com/aframevr/aframe/tree/<%- activeVersion === 'master' ? 'master' : 'v' + activeVersion %>/<%- page.source_code %>" title="View Source" target="_blank" rel="external">View Source</a>
99-
<% } %>
93+
<div class="secondary-sidebar">
94+
<%- partial('partials/toc', {page: page}) %>
95+
<%- partial('partials/docs/examples_list', {page: page}) %>
96+
<div class="doc-actions">
97+
<a class="docs-suggest-edit github-file-link" href="<%- website_github_edit_url(page.path) %>" target="_blank" rel="external">Edit Page</a>
98+
<% if (page.source_code) { %>
99+
<a class="docs-view-source github-file-link" href="https://github.com/aframevr/aframe/tree/<%- activeVersion === 'master' ? 'master' : 'v' + activeVersion %>/<%- page.source_code %>" title="View Source" target="_blank" rel="external">View Source</a>
100+
<% } %>
101+
</div>
100102
</div>
101103
</div>
102104
</div>

themes/aframe/layout/layout.ejs

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
<%- css('css/secondary') %>
8181
<% } %>
8282

83-
<% if (isDocs || is404) { %>
83+
<% if (isSecondary || is404) { %>
8484
<!-- Search. -->
8585
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css"/>
8686
<%- css('css/search') %>
@@ -100,7 +100,7 @@
100100
<% } %>
101101
<% } %>
102102

103-
<% if (isDocs || is404) { %>
103+
<% if (isSecondary || is404) { %>
104104
<%- partial('partials/search') %>
105105
<% } %>
106106
</body>

themes/aframe/layout/page.ejs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<%- partial('partials/secondary/sidebar_wordmark') %>
12
<aside id="sidebar" class="sidebar borderless-links">
23
<%- partial('partials/secondary/sidebar_header', {site: site}) %>
34
</aside>
@@ -13,7 +14,9 @@
1314
<%- partial('partials/docs/footer', {item: page}) %>
1415
</div>
1516

16-
<% if (page.toc) { %>
17-
<%- partial('partials/toc', {page: page}) %>
18-
<% } %>
17+
<% if (page.toc) { %>
18+
<div class="secondary-sidebar">
19+
<%- partial('partials/toc', {page: page}) %>
20+
</div>
21+
<% } %>
1922
</div>

0 commit comments

Comments
 (0)