adisaktijrs / hexo-theme-minima

A lightweight dark/light theme for Hexo.js
https://adisaktijrs.github.io/minima
MIT License
220 stars 51 forks source link

Issue related to categories title #12

Closed Picorims closed 2 years ago

Picorims commented 3 years ago

When going to /categories/categoryname, the title says "All posts". From my testing, it looks like archive.ejs is the used layout for categories and not tag.ejs. So migrating the title manipulation here as well fixed the issue.

archive.ejs:

<%
    var title = '';
    if (page.category) title = page.category;
    if (page.archive){
        if (page.year) title = page.year + (page.month ? '/' + page.month : '');
        else title = "Archives";
    }
%>
<% if(title && is_category()) { %>
  <h5 class="">Category — <%- title %></h5>
<% } else if (title) { %>
  <h5 class=""><%- title %></h5>
<% } else { %>
  <h5>All Posts</h5>
<% } %>

tag.ejs

<%
    var title = '';
    if (page.tag) title = page.tag;
%>
<% if(title) { %>
   <h5 class="">Posts Related to — <%- title %></h5>
<% } %>

In layout.ejs, it also lacks the is_category() case for the category title:

} else if (is_category()){
    title = 'Category - ' + page.category;
}

These fixed categories on my side 😃 .

I also to take the opportunity to say big thanks for this theme, I am learning a lot by this one, and it is much more digest than the default theme! The minimalistic css and ejs makes it very easy to customize it to my needs. The thumbnail feature is also amazing.

adisaktijrs commented 3 years ago

Hi @Picorims, I haven't checked and tested the latest version of this theme for months, therefore thanks for mentioning this issue and the solution as well. And glad to hear that you love it! 😃