Skip to content

Commit

Permalink
perf: optimize footer since year settings
Browse files Browse the repository at this point in the history
  • Loading branch information
XPoet committed Oct 12, 2024
1 parent e7cb759 commit 19be89b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions layout/_partial/footer.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ try {
const show_word_count = f_word_count === true && f_temp_total_word !== 0
const has_count_info = show_pv || show_uv || show_word_count
const current_year = String(date(new Date(), 'YYYY'))
%>
<footer class="footer border-box">
<div class="copyright-info info-item">
&copy;&nbsp;<% if (f_since) { %>
<span><%= f_since %></span>
<% } if(f_since != date(new Date(), 'YYYY')) {%>
&nbsp;-&nbsp;<%= date(new Date(), 'YYYY') %>
<% } %>
<% if (web_master) { %>
&copy;&nbsp;<% if (f_since && String(f_since) !== current_year) { %><span><%= f_since %></span>&nbsp;-&nbsp;<% } %><%= current_year %>
<% if (web_master) { %>
&nbsp;<i class="fas fa-heart icon-animate"></i>&nbsp;&nbsp;<a href="<%- url_for('/') %>"><%= web_master %></a>
<% } %>
</div>
Expand Down

0 comments on commit 19be89b

Please sign in to comment.