Skip to content

Commit

Permalink
feat: Add authors ability to posts
Browse files Browse the repository at this point in the history
  • Loading branch information
ToffeeMax committed Apr 1, 2024
1 parent 29bbc25 commit 59d2724
Show file tree
Hide file tree
Showing 11 changed files with 2,969 additions and 2,263 deletions.
4,293 changes: 2,470 additions & 1,823 deletions package-lock.json

Large diffs are not rendered by default.

57 changes: 29 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
{
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "hexo clean && hexo generate",
"clean": "hexo clean",
"deploy": "hexo deploy",
"server": "hexo server",
"total": "hexo clean && hexo generate && hexo server"
},
"hexo": {
"version": "6.3.0"
},
"dependencies": {
"hexo": "^6.3.0",
"hexo-generator-archive": "^2.0.0",
"hexo-generator-category": "^2.0.0",
"hexo-generator-feed": "^3.0.0",
"hexo-generator-index": "^3.0.0",
"hexo-generator-tag": "^2.0.0",
"hexo-renderer-ejs": "^2.0.0",
"hexo-renderer-marked": "^6.0.0",
"hexo-renderer-stylus": "^2.1.0",
"hexo-server": "^3.0.0",
"hexo-theme-landscape": "^0.0.3"
}
}
{
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "hexo clean && hexo generate",
"clean": "hexo clean",
"deploy": "hexo deploy",
"server": "hexo server",
"total": "hexo clean && hexo generate && hexo server"
},
"hexo": {
"version": "6.3.0"
},
"dependencies": {
"hexo": "^6.3.0",
"hexo-generator-archive": "^2.0.0",
"hexo-generator-category": "^2.0.0",
"hexo-generator-feed": "^3.0.0",
"hexo-generator-index": "^3.0.0",
"hexo-generator-tag": "^2.0.0",
"hexo-multiauthor-plugin": "^1.1.3",
"hexo-renderer-ejs": "^2.0.0",
"hexo-renderer-marked": "^6.0.0",
"hexo-renderer-stylus": "^2.1.0",
"hexo-server": "^3.0.0",
"hexo-theme-landscape": "^0.0.3"
}
}
26 changes: 26 additions & 0 deletions scaffolds/blog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: {{ title }}
date: {{ date }}
tags:
- all
- update
excerpt:
author:
---


Welcome
-------

GitHub
-------
### Feature Changes
### Technical Changes

Wiki
----
YouTube
----
Wiki
----
-----------------------------
4 changes: 4 additions & 0 deletions source/_authors/template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Username should be the same name as the filename
username: template
name: "Template Template"
about: "Template Template"
3 changes: 3 additions & 0 deletions source/_authors/toffeemax.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
username: toffeemax
name: "ToffeeMax"
about: "Community Wrangler for Gamemode 4"
3 changes: 2 additions & 1 deletion source/_posts/feb-update-23.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ tags:
- updates
date: 2023-04-09 17:34:26
excerpt: An update on the state of the project from December 2022 to February 2023
author: ToffeeMax
authors:
- toffeemax
---

> "Blow the dust off after christmas, loosening a few belt holes and running off that gained project weight" - ToffeeMax
Expand Down
62 changes: 25 additions & 37 deletions themes/gamemode4/layout/_partial/article-excerpt.ejs
Original file line number Diff line number Diff line change
@@ -1,38 +1,26 @@

<div class="blog-post">

<!-- Title -->
<a href="<%- config.root %><%- item.path %>" >
<h3 class="blog-post-title">

<%- item.title %>

</h3>
</a>

<!-- Date and Author -->
<p class="blog-post-meta">
<% if(item.author) { %>
by <%- item.author %>
<% } %>
<br>
<i><%= item.date.format(config.date_format) %></i>
</p>





<!-- Content -->
<div class="blog-article-excerpt">
<%- item.excerpt || item.content %>
</div>
<!-- Only display the Read More link if we are displaying an excerpt -->
<% if(item.excerpt) { %>
<p>
<a href="<%- config.root %><%- item.path %>">
<%= theme.excerpt_link %>
</a>
</p>
<% } %>

<div class="blog-post">

<!-- Title -->
<a href="<%- config.root %><%- item.path %>" >
<h3 class="blog-post-title">

<%- item.title %>

</h3>
</a>


<!-- Content -->
<div class="blog-article-excerpt">
<%- item.excerpt || item.content %>
</div>
<!-- Only display the Read More link if we are displaying an excerpt -->
<% if(item.excerpt) { %>
<p>
<a href="<%- config.root %><%- item.path %>">
<%= theme.excerpt_link %>
</a>
</p>
<% } %>
</div>
72 changes: 30 additions & 42 deletions themes/gamemode4/layout/_partial/article-full.ejs
Original file line number Diff line number Diff line change
@@ -1,43 +1,31 @@

<div class="blog-post">

<!-- Title -->
<h2 class="blog-post-title">
<a href="<%- config.root %><%- item.path %>">
<%- item.title || item.link%>
</a>
</h2>

<!-- Date and Author -->
<p class="blog-post-meta">

</p>

<p class="blog-post-meta">
<% if(item.author) { %>
by <%- item.author %>
<br>
<% } %>

<i><%= item.date.format(config.date_format) %></i>
<% if (item.changed) { %>
<br>
<i> Updated on <%- item.changed %></i>
<% } %>
</p>




<!-- Content -->
<%- item.content %>

<hr />

<!-- Tags and Categories links -->
<%- partial('article-tags', {item: item}) %>
<%- partial('article-categories', {item: item}) %>


<div class="blog-post">

<!-- Title -->
<h2 class="blog-post-title">
<a href="<%- config.root %><%- item.path %>">
<%- item.title || item.link%>
</a>
</h2>

<!-- Date and Author -->
<p class="blog-post-meta">

</p>
<%- partial('_partial/author',{item: item}) %>






<!-- Content -->
<%- item.content %>

<hr />

<!-- Tags and Categories links -->
<%- partial('article-tags', {item: item}) %>
<%- partial('article-categories', {item: item}) %>

</div>
24 changes: 24 additions & 0 deletions themes/gamemode4/layout/_partial/author.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div class="author-banner">
<hr class="rounded">
<% let post_obj = item %>
<% if (post_author(post_obj)){ %>
<% if (item.authors.length > 1){ %>
<div class="author-header"><h4>Authors</h4></div>
<% } else if (item.authors.length == 1){ %>
<div class="author-header"><h4>Author</h4></div>
<% } %>
<% item.author.forEach(function(au) { %>
<div class="author-details">
<div class="author-name">
<%=au.name %>
</div>
<div class="author-meta">
<%=au.about %>
</div>
</div>
<% }); %>
<hr class="rounded">
<% } %>
</div>
16 changes: 8 additions & 8 deletions themes/gamemode4/scripts/sidebar-archive.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
hexo.extend.helper.register("count_years", function(item){
var count = 0
for (var i = 0; i < item.length; i++) {
item[i].count = item[i].posts.length;
count += 1
}
return count;
// ...
hexo.extend.helper.register("count_years", function(item){
var count = 0
for (var i = 0; i < item.length; i++) {
item[i].count = item[i].posts.length;
count += 1
}
return count;
// ...
});
Loading

0 comments on commit 59d2724

Please sign in to comment.