Skip to content

Commit ae2e555

Browse files
Merge pull request #19 from exokitxr/remove-blog-2
Remove blog
2 parents 4bcd0a4 + 25736f1 commit ae2e555

File tree

7 files changed

+13
-121
lines changed

7 files changed

+13
-121
lines changed

ORGANIZATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Powered by [Hexo](https://hexo.io/)
1212
- `_data/` -
1313
- `community/index.md` - Community page.
1414
- `faq/index.md` - FAQ page.
15-
- `images/` - Site images
15+
- `images/` - Site images
1616
- `themes/` - Layout, CSS, releases.
1717
- `exokit/`
1818
- `layout/` - HTML and templates.

scripts/generators.js

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -19,50 +19,3 @@ hexo.extend.generator.register('examples', function (locals) {
1919

2020
return routes;
2121
});
22-
23-
/**
24-
* Paginated blog.
25-
*/
26-
hexo.extend.generator.register('blog', function (locals) {
27-
var routes = [];
28-
var perPage = hexo.config.per_page;
29-
var posts = locals.posts.sort('date', -1);
30-
for (var i = 1, j = posts.length, page = 1; i < j; i += perPage, page++) {
31-
// blog/page/*/
32-
var route = {
33-
path: 'blog/' + page + '/',
34-
data: {
35-
blog_index: true,
36-
posts: posts.slice(i - 1, i - 1 + perPage),
37-
},
38-
layout: 'blog'
39-
};
40-
41-
// Next.
42-
if (i + perPage < posts.length) {
43-
route.data.next = {
44-
pageNum: page + 1,
45-
path: '/blog/' + (page + 1) + '/',
46-
title: 'Next Page'
47-
};
48-
}
49-
50-
// Prev.
51-
if (i > 1) {
52-
route.data.prev = {
53-
pageNum: page - 1,
54-
path: page - 1 === 1 ? 'blog/' : '/blog/' + (page - 1) + '/',
55-
title: 'Previous Page'
56-
};
57-
}
58-
59-
// blog/ root alias of blog/page/1/.
60-
routes.push(route);
61-
if (page === 1) {
62-
var indexRoute = Object.assign({}, route);
63-
indexRoute.path = 'blog/';
64-
routes.push(indexRoute);
65-
}
66-
}
67-
return routes;
68-
});

scripts/helpers.js

Lines changed: 1 addition & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -56,69 +56,10 @@ hexo.extend.helper.register('table_of_contents', function (content) {
5656
return toc;
5757
});
5858

59-
/**
60-
* twitter|exokitxr -> [@exokitxr](twitter.com/exokitxr)
61-
* twitter|exokitxr|Exokit XR -> [Exokit XR](twitter.com/exokitxr)
62-
* github|exokitxr -> [exokitxr](github.com/exokitxr)
63-
* exokitxr -> [exokitxr](exokitxr)
64-
* http://exokitxr.com|Exokit XR -> [Exokit XR](exokitxr.com)
65-
*/
66-
hexo.extend.helper.register('blog_attribution', function (author) {
67-
var authorSplit = author.split('|');
68-
var display;
69-
var link;
70-
71-
// Nothing to do.
72-
if (authorSplit.length === 1) { return author; }
73-
74-
// Twitter handle.
75-
if (authorSplit[0] === 'twitter') {
76-
if (authorSplit.length === 2) {
77-
display = authorSplit[1];
78-
link = authorSplit[1];
79-
} else {
80-
display = authorSplit[2];
81-
link = authorSplit[1];
82-
}
83-
// Strip `@` from link.
84-
if (link[0] === '@') {
85-
link = link.substring(1);
86-
}
87-
return '<a class="blog-attribution" href="https://twitter.com/' + link + '">' +
88-
display + '</a>';
89-
}
90-
91-
// GitHub username.
92-
if (authorSplit[0] === 'github') {
93-
if (authorSplit.length === 2) {
94-
display = authorSplit[1];
95-
link = authorSplit[1];
96-
} else {
97-
display = authorSplit[2];
98-
link = authorSplit[1];
99-
}
100-
return '<a class="blog-attribution" href="https://github.com/' + link + '">' +
101-
display + '</a>';
102-
}
103-
104-
// Link.
105-
display = authorSplit[1];
106-
link = authorSplit[0];
107-
return '<a class="blog-attribution" href="' + link + '">' + display + '</a>';
108-
});
109-
11059
hexo.extend.helper.register('markdown', function (text) {
11160
return hexo.render.renderSync({text: text, engine: 'markdown'});
11261
});
11362

114-
hexo.extend.helper.register('blog_date', function (date) {
115-
return moment(date).format('MMM D[,] YYYY');
116-
});
117-
118-
hexo.extend.helper.register('blog_date_subtract_week', function (date) {
119-
return moment(date).subtract({weeks: 1}).format('MMM D[,] YYYY');
120-
});
121-
12263
/**
12364
* #1000 -> github.com/exokitxr/exokit/pull/1000
12465
* abcde -> github.com/exokitxr/exokit/commit/abcde
@@ -164,9 +105,7 @@ hexo.extend.helper.register('website_github_edit_url', function (path) {
164105
return urljoin(this.config.github.exokit_site.url, 'edit', MASTER,
165106
path.replace('docs/', 'src/docs/').replace(/\.html$/, '.md'));
166107
}
167-
// For blog posts.
168-
return urljoin(this.config.github.exokit_site.url, 'edit', MASTER, this.config.source_dir,
169-
path.replace(/\.html$/, '.md'));
108+
170109
});
171110

172111
/**
@@ -248,10 +187,6 @@ hexo.extend.helper.register('is_external_url', isUrl);
248187
* Generate description for `<meta name="description">`.
249188
*/
250189
hexo.extend.helper.register('meta_description', function (page) {
251-
// If blog or documentation, return article excerpt.
252-
if (page.layout === 'docs' || (page.layout === 'blog' && !page.blog_index)) {
253-
return striptags(page.excerpt).substring(0, 280);
254-
}
255190
// Else, return vanilla description.
256191
return hexo.config.description;
257192
});
@@ -260,11 +195,6 @@ hexo.extend.helper.register('meta_description', function (page) {
260195
* Infer image for `<meta property="og:image">` and Twitter card.
261196
*/
262197
hexo.extend.helper.register('meta_image', function (page, defaultCard) {
263-
// If blog, return blog image.
264-
if (page.layout === 'blog' && !page.blog_index && page.image &&
265-
!page.image.src.endsWith('.gif')) {
266-
return 'images/blog/' + page.image.src;
267-
}
268198
// Else, return default card image.
269199
return defaultCard;
270200
});

src/_posts/helloworld.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: "Hello World"
3+
date: 2018-1-1
4+
layout: blog
5+
image:
6+
src: https://raw.githubusercontent.com/exokitxr/exokit/master/icon.png
7+
author: https://twitter.com/exokitxr|Exokit
8+
---
9+
10+
## Hello World

themes/exokit/layout/partials/secondary/sidebar_header.ejs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
var links = [
33
{url: 'docs/introduction/', text: 'Docs'},
44
{url: 'community/', text: 'Community'},
5-
{url: 'showcase/', text: 'Showcase'},
65
{url: config.github.exokitxr.url, text: 'GitHub', slug: 'github', title: 'Exokit Project Repository'},
76
{url: config.discord.exokit.url, text: 'Discord'}
87
];

themes/exokit/source/css/_common.styl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ h4
102102
.copy__wrap
103103
padding 40px
104104

105-
106105
.nav, .subnav
107106
list-style-type none
108107

themes/exokit/source/css/secondary.styl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ video
441441
.docs-header + blockquote
442442
margin 4em 0 2em
443443

444+
444445
[data-is-mobile="true"] #docs-version
445446
border 1px solid #CCC
446447

0 commit comments

Comments
 (0)