ppoffice / hexo-theme-hueman

A redesign of Alx's wordpress theme Hueman, ported to Hexo.
http://ppoffice.github.io/hexo-theme-hueman/
GNU General Public License v2.0
1.17k stars 336 forks source link

Disable annual archive in main page #294

Closed AbdullahOztuurkk closed 2 years ago

AbdullahOztuurkk commented 2 years ago

Firstly, thank you for wonderful theme. My issue is annual archive. I want to disable annual archive in main page when i'm adding old articles. How can i do it? I edited layout/archives.ejs but it doesnt work. I given up because of my mind is blown. I want to your help.

ppoffice commented 2 years ago

Are you talking about https://github.com/ppoffice/hexo-theme-hueman/blob/master/layout/widget/archive.ejs ?

AbdullahOztuurkk commented 2 years ago

I'm talking about https://github.com/ppoffice/hexo-theme-hueman/blob/master/layout/common/archive.ejs I'm trying to delete some codeblocks but it doesnt work. Because of that, i want to your help and your knowledge.

ppoffice commented 2 years ago

Can you attach a screenshot to show what is are you trying to remove? Sorry I don't quite understand your question.

ppoffice commented 2 years ago

@AbdullahOztuurkk Comment out these lines:

https://github.com/ppoffice/hexo-theme-hueman/blob/0.5.0/layout/common/archive.ejs#L10-L12

ppoffice commented 2 years ago

@AbdullahOztuurkk

index 6ad3a4f..4d9680b 100644
--- a/layout/common/archive.ejs
+++ b/layout/common/archive.ejs
@@ -1,17 +1,5 @@
 <% var last, postCount = 0; %>
 <% page.posts.each(function(post, i) { %>
-    <% var year = post.date.year(); %>
-    <% if (last != year) { %>
-        <% if (last != null) { %>
-            </div></section>
-        <% } %>
-        <% last = year; postCount = 0;%>
-        <section class="archives-wrap">
-            <div class="archive-year-wrap">
-                <a href="<%- url_for('archives/' + year) %>" class="archive-year"><i class="icon fa fa-calendar-o"></i><%= year %></a>
-            </div>
-            <div class="archives">
-    <% } %>
     <% postCount++; %>
     <% if (postCount % 2 == 1) { %>
         <div class="article-row">
@@ -21,9 +9,6 @@
         </div>
     <% } %>
 <% }) %>
-<% if (page.posts.length) { %>
-    </div></section>
-<% } %>
 <% if (page.total > 1) { %>
     <nav id="page-nav">
         <span class="pages"><%= _p('nav.current_page', page.current) %><%= _p('nav.total_page', page.total) %></span>