Skip to content

Commit 59d2724

Browse files
committed
feat: Add authors ability to posts
1 parent 29bbc25 commit 59d2724

File tree

11 files changed

+2969
-2263
lines changed

11 files changed

+2969
-2263
lines changed

package-lock.json

+2,470-1,823
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+29-28
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
1-
{
2-
"name": "hexo-site",
3-
"version": "0.0.0",
4-
"private": true,
5-
"scripts": {
6-
"build": "hexo clean && hexo generate",
7-
"clean": "hexo clean",
8-
"deploy": "hexo deploy",
9-
"server": "hexo server",
10-
"total": "hexo clean && hexo generate && hexo server"
11-
},
12-
"hexo": {
13-
"version": "6.3.0"
14-
},
15-
"dependencies": {
16-
"hexo": "^6.3.0",
17-
"hexo-generator-archive": "^2.0.0",
18-
"hexo-generator-category": "^2.0.0",
19-
"hexo-generator-feed": "^3.0.0",
20-
"hexo-generator-index": "^3.0.0",
21-
"hexo-generator-tag": "^2.0.0",
22-
"hexo-renderer-ejs": "^2.0.0",
23-
"hexo-renderer-marked": "^6.0.0",
24-
"hexo-renderer-stylus": "^2.1.0",
25-
"hexo-server": "^3.0.0",
26-
"hexo-theme-landscape": "^0.0.3"
27-
}
28-
}
1+
{
2+
"name": "hexo-site",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"build": "hexo clean && hexo generate",
7+
"clean": "hexo clean",
8+
"deploy": "hexo deploy",
9+
"server": "hexo server",
10+
"total": "hexo clean && hexo generate && hexo server"
11+
},
12+
"hexo": {
13+
"version": "6.3.0"
14+
},
15+
"dependencies": {
16+
"hexo": "^6.3.0",
17+
"hexo-generator-archive": "^2.0.0",
18+
"hexo-generator-category": "^2.0.0",
19+
"hexo-generator-feed": "^3.0.0",
20+
"hexo-generator-index": "^3.0.0",
21+
"hexo-generator-tag": "^2.0.0",
22+
"hexo-multiauthor-plugin": "^1.1.3",
23+
"hexo-renderer-ejs": "^2.0.0",
24+
"hexo-renderer-marked": "^6.0.0",
25+
"hexo-renderer-stylus": "^2.1.0",
26+
"hexo-server": "^3.0.0",
27+
"hexo-theme-landscape": "^0.0.3"
28+
}
29+
}

scaffolds/blog.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: {{ title }}
3+
date: {{ date }}
4+
tags:
5+
- all
6+
- update
7+
excerpt:
8+
author:
9+
---
10+
11+
12+
Welcome
13+
-------
14+
15+
GitHub
16+
-------
17+
### Feature Changes
18+
### Technical Changes
19+
20+
Wiki
21+
----
22+
YouTube
23+
----
24+
Wiki
25+
----
26+
-----------------------------

source/_authors/template.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Username should be the same name as the filename
2+
username: template
3+
name: "Template Template"
4+
about: "Template Template"

source/_authors/toffeemax.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
username: toffeemax
2+
name: "ToffeeMax"
3+
about: "Community Wrangler for Gamemode 4"

source/_posts/feb-update-23.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ tags:
55
- updates
66
date: 2023-04-09 17:34:26
77
excerpt: An update on the state of the project from December 2022 to February 2023
8-
author: ToffeeMax
8+
authors:
9+
- toffeemax
910
---
1011

1112
> "Blow the dust off after christmas, loosening a few belt holes and running off that gained project weight" - ToffeeMax
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,26 @@
1-
2-
<div class="blog-post">
3-
4-
<!-- Title -->
5-
<a href="<%- config.root %><%- item.path %>" >
6-
<h3 class="blog-post-title">
7-
8-
<%- item.title %>
9-
10-
</h3>
11-
</a>
12-
13-
<!-- Date and Author -->
14-
<p class="blog-post-meta">
15-
<% if(item.author) { %>
16-
by <%- item.author %>
17-
<% } %>
18-
<br>
19-
<i><%= item.date.format(config.date_format) %></i>
20-
</p>
21-
22-
23-
24-
25-
26-
<!-- Content -->
27-
<div class="blog-article-excerpt">
28-
<%- item.excerpt || item.content %>
29-
</div>
30-
<!-- Only display the Read More link if we are displaying an excerpt -->
31-
<% if(item.excerpt) { %>
32-
<p>
33-
<a href="<%- config.root %><%- item.path %>">
34-
<%= theme.excerpt_link %>
35-
</a>
36-
</p>
37-
<% } %>
1+
2+
<div class="blog-post">
3+
4+
<!-- Title -->
5+
<a href="<%- config.root %><%- item.path %>" >
6+
<h3 class="blog-post-title">
7+
8+
<%- item.title %>
9+
10+
</h3>
11+
</a>
12+
13+
14+
<!-- Content -->
15+
<div class="blog-article-excerpt">
16+
<%- item.excerpt || item.content %>
17+
</div>
18+
<!-- Only display the Read More link if we are displaying an excerpt -->
19+
<% if(item.excerpt) { %>
20+
<p>
21+
<a href="<%- config.root %><%- item.path %>">
22+
<%= theme.excerpt_link %>
23+
</a>
24+
</p>
25+
<% } %>
3826
</div>
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,31 @@
1-
2-
<div class="blog-post">
3-
4-
<!-- Title -->
5-
<h2 class="blog-post-title">
6-
<a href="<%- config.root %><%- item.path %>">
7-
<%- item.title || item.link%>
8-
</a>
9-
</h2>
10-
11-
<!-- Date and Author -->
12-
<p class="blog-post-meta">
13-
14-
</p>
15-
16-
<p class="blog-post-meta">
17-
<% if(item.author) { %>
18-
by <%- item.author %>
19-
<br>
20-
<% } %>
21-
22-
<i><%= item.date.format(config.date_format) %></i>
23-
<% if (item.changed) { %>
24-
<br>
25-
<i> Updated on <%- item.changed %></i>
26-
27-
28-
<% } %>
29-
</p>
30-
31-
32-
33-
34-
<!-- Content -->
35-
<%- item.content %>
36-
37-
<hr />
38-
39-
<!-- Tags and Categories links -->
40-
<%- partial('article-tags', {item: item}) %>
41-
<%- partial('article-categories', {item: item}) %>
42-
1+
2+
<div class="blog-post">
3+
4+
<!-- Title -->
5+
<h2 class="blog-post-title">
6+
<a href="<%- config.root %><%- item.path %>">
7+
<%- item.title || item.link%>
8+
</a>
9+
</h2>
10+
11+
<!-- Date and Author -->
12+
<p class="blog-post-meta">
13+
14+
</p>
15+
<%- partial('_partial/author',{item: item}) %>
16+
17+
18+
19+
20+
21+
22+
<!-- Content -->
23+
<%- item.content %>
24+
25+
<hr />
26+
27+
<!-- Tags and Categories links -->
28+
<%- partial('article-tags', {item: item}) %>
29+
<%- partial('article-categories', {item: item}) %>
30+
4331
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<div class="author-banner">
2+
<hr class="rounded">
3+
<% let post_obj = item %>
4+
<% if (post_author(post_obj)){ %>
5+
<% if (item.authors.length > 1){ %>
6+
<div class="author-header"><h4>Authors</h4></div>
7+
<% } else if (item.authors.length == 1){ %>
8+
<div class="author-header"><h4>Author</h4></div>
9+
<% } %>
10+
<% item.author.forEach(function(au) { %>
11+
<div class="author-details">
12+
<div class="author-name">
13+
<%=au.name %>
14+
</div>
15+
<div class="author-meta">
16+
<%=au.about %>
17+
</div>
18+
19+
20+
</div>
21+
<% }); %>
22+
<hr class="rounded">
23+
<% } %>
24+
</div>
+8-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
hexo.extend.helper.register("count_years", function(item){
2-
var count = 0
3-
for (var i = 0; i < item.length; i++) {
4-
item[i].count = item[i].posts.length;
5-
count += 1
6-
}
7-
return count;
8-
// ...
1+
hexo.extend.helper.register("count_years", function(item){
2+
var count = 0
3+
for (var i = 0; i < item.length; i++) {
4+
item[i].count = item[i].posts.length;
5+
count += 1
6+
}
7+
return count;
8+
// ...
99
});

0 commit comments

Comments
 (0)