Skip to content

Commit

Permalink
perf
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Sketon committed Feb 15, 2024
1 parent 0668328 commit 2b230ad
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 24 deletions.
24 changes: 8 additions & 16 deletions layout/_partial/post.ejs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<% if (even === true) { %>
<div class="post-wrap-left wow fadeInUp">
<% if (post.link) { %>
<a class="post-link" href="<%- url_for(post.link, {relative: false}) %>" itemprop="url" target="_blank"></a>
<a class="post-link" href="<%- url_for(post.link, {relative: false}) %>" itemprop="url" target="_blank" aria-label="<%= post.title %>"></a>
<% } else { %>
<a class="post-link" href="<%- url_for(post.path) %>"></a>
<a class="post-link" href="<%- url_for(post.path) %>" aria-label="<%= post.title %>"></a>
<% } %>
<% if (post.sticky) { %>
<div class="post-sticky"><%= __('sticky')%></div>
Expand All @@ -22,9 +22,9 @@
</div>
<div class="post-info">
<div class="post-meta">
<a><span class="icon-calendar"></span><%- date(post.date, "YYYY-MM-DD") %></a>
<a><span class="icon-pencil"></span><%= _p('post.count', wordcount(post.content)) %></a>
<a><span class="icon-clock"></span><%= _p('post.time', min2read(post.content)) %></a>
<span><span class="icon-calendar"></span><%- date(post.date, "YYYY-MM-DD") %></span>
<span><span class="icon-pencil"></span><%= _p('post.count', wordcount(post.content)) %></span>
<span><span class="icon-clock"></span><%= _p('post.time', min2read(post.content)) %></span>
</div>
<h2 class="post-title"><%= post.title %></h2>
<article class="post-article">
Expand Down Expand Up @@ -57,17 +57,9 @@
</div>
<div class="post-info">
<div class="post-meta">
<a><span class="icon-calendar"></span><%- date(post.date, "YYYY-MM-DD") %></a>
<% if (wordcount(post.content) == 1) { %>
<a><span class="icon-pencil"></span><%= _p('post.count', wordcount(post.content)) %></a>
<% } else { %>
<a><span class="icon-pencil"></span><%= _p('post.count', wordcount(post.content)) %></a>
<% } %>
<% if (min2read(post.content) == 1) { %>
<a><span class="icon-clock"></span><%= _p('post.time', min2read(post.content)) %></a>
<% } else { %>
<a><span class="icon-clock"></span><%= _p('post.time', min2read(post.content)) %></a>
<% } %>
<span><span class="icon-calendar"></span><%- date(post.date, "YYYY-MM-DD") %></span>
<span><span class="icon-pencil"></span><%= _p('post.count', wordcount(post.content)) %></span>
<span><span class="icon-clock"></span><%= _p('post.time', min2read(post.content)) %></span>
</div>
<h2 class="post-title"><%= post.title %></h2>
<article class="post-article">
Expand Down
4 changes: 2 additions & 2 deletions layout/_partial/sidebar/common-sidebar.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
<div class="sidebar-social">
<% for (var i in theme.social) { %>
<div class=<%= 'icon-' + i %>>
<a href=<%= theme.social[i] %> itemprop="url" target="_blank"></a>
<a href=<%= theme.social[i] %> itemprop="url" target="_blank" aria-label="<%= i %>"></a>
</div>
<% } %>
</div>
<div class="sidebar-menu">
<% for (var i in theme.menu) { %>
<div class="sidebar-menu-link-wrap">
<a class="sidebar-menu-link-dummy" href="<%- url_for(theme.menu[i]) %>"></a>
<a class="sidebar-menu-link-dummy" href="<%- url_for(theme.menu[i]) %>" aria-label="<%= __(i) %>"></a>
<span class="sidebar-menu-icon"></span>
<div class="sidebar-menu-link"><%= __(i) %></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion scripts/helper/vendorFont.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { htmlTag } = require('hexo-util')
hexo.extend.helper.register('vendorFont', () => {
const fontDisplay = '&display=swap'
const fontSubset = '&subset=latin,latin-ext'
const fontStyles = ':300,300italic,400,400italic,700,700italic'
const fontStyles = ':400,400italic,700,700italic'
const fontHost = 'https://fonts.googleapis.com'

let fontFamilies = ['Mulish', 'Noto Serif SC', 'Ubuntu Mono'].map(item => {
Expand Down
4 changes: 2 additions & 2 deletions source/css/_partial/header.styl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ $logo-text
#subtitle
@extend $logo-text
font-size: subtitle-size
font-weight: 300
font-weight: 400
line-height: subtitle-size
letter-spacing: 1px

Expand Down Expand Up @@ -169,7 +169,7 @@ $nav-link-wrap

.main-nav-link
@extend $nav-link
font-weight: 300
font-weight: 400
letter-spacing: 1px

.main-nav-icon
Expand Down
5 changes: 2 additions & 3 deletions source/css/_partial/post.styl
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,14 @@ $post-wrap
justify-content: flex-end
margin: 5px 0

a
span
font-size: 14px
color: #777777
margin: 0 8px
white-space: nowrap
text-overflow: ellipsis
overflow: hidden

a:before,
span:before
margin: 0 10px

Expand Down Expand Up @@ -188,7 +187,7 @@ $post-cover
left: 0
width: 70px
height: 35px
background: var(--red-4)
background: var(--color-sticky)
color: var(--red-1)
font-weight: bold
font-size: 15px
Expand Down
2 changes: 2 additions & 0 deletions source/css/_variables.styl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
--color-dark-facebook: darken(#3b5998, 20%)
--color-dark-pinterest: darken(#cb2027, 20%)
--color-dark-linkedin: darken(#0077B5, 20%)
--color-sticky: #ffecec

--color-h2-border: #eee
--color-meta-shadow: --var(--red-6)
Expand Down Expand Up @@ -83,6 +84,7 @@
--color-dark-facebook: darken(#3b5998, 20%)
--color-dark-pinterest: darken(#cb2027, 20%)
--color-dark-linkedin: darken(#0077B5, 20%)
--color-sticky: #ffecec

--color-h2-border: #47474a
--color-meta-shadow: rgba(0, 0, 0, 0.2)
Expand Down
Binary file modified source/images/banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2b230ad

Please sign in to comment.