-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sidebar, required comment & poll fields, bug fixes
- Loading branch information
Showing
9 changed files
with
138 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<div class="sidebar"> | ||
<h3>Recent Articles</h3> | ||
<ul> | ||
<% for (let i = 0; i < 5 && i < cms.articles.length; i++) { %> | ||
<li><a href="<%- vars.domain %>/articles/<%= new Date(cms.articles[i].date).getFullYear() %>/<%= cms.articles[i].slug %>"><%= cms.articles[i].title %></a></li> | ||
<% } %> | ||
</ul> | ||
<% var tags = {}; | ||
for (article of cms.articles) { | ||
if (article.tags) { | ||
for (tag of article.tags) { | ||
tag = tag.toLowerCase(); | ||
if (!tags[tag]) { | ||
tags[tag] = []; | ||
}; | ||
tags[tag].push(article); | ||
}; | ||
}; | ||
}; | ||
var sortedTagsObj = {}; | ||
Object.keys(tags).sort(function(a, b) { | ||
return tags[b].length - tags[a].length; | ||
}).forEach(function(key) { | ||
sortedTagsObj[key] = tags[key]; | ||
}); | ||
tags = sortedTagsObj; | ||
if (Object.keys(tags).length != 0) { %> | ||
<h3>Popular Tags</h3> | ||
<ul> | ||
<% for (let i = 0; i < Object.keys(tags).length; i++) { const tag = Object.keys(tags)[i]; %> | ||
<li><a href="<%- vars.domain %>/tags/<%= tag.toLowerCase().replaceAll(" ", "-") %>">#<%= tag.toLowerCase().replaceAll(" ", "-") %> (<%= tags[tag].length %>)</a></li> | ||
<% } %> | ||
</ul> | ||
<% } %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# The Southern Bell Website | ||
|
||
[![Total Time](https://wakatime.com/badge/user/074621a8-639e-4f3e-b6d9-f23b6bb481a9/project/2b675577-fc77-4320-ad6f-c728de7ad7bc.svg)](https://wakatime.com/@OGFaisalN/projects/uapnosftrk) | ||
All - [![Total Time](https://wakatime.com/badge/user/074621a8-639e-4f3e-b6d9-f23b6bb481a9/project/2b675577-fc77-4320-ad6f-c728de7ad7bc.svg)](https://wakatime.com/@OGFaisalN/projects/uapnosftrk) | ||
Production - ![Deploy Node.js App](https://github.com/OGFaisalN/Southern-Bell/actions/workflows/main.yml/badge.svg?branch=prod) | ||
Development - ![Deploy Node.js App](https://github.com/OGFaisalN/Southern-Bell/actions/workflows/main.yml/badge.svg?branch=dev) | ||
|
||
CMS - /admin |