Skip to content

Commit

Permalink
Merge pull request #238 from D-Sketon/seo
Browse files Browse the repository at this point in the history
perf: lighthouse
  • Loading branch information
zkz098 committed Feb 15, 2024
2 parents 3967fc1 + e25d065 commit 2e2dc1f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
7 changes: 4 additions & 3 deletions layout/_partials/footer.pug
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ div(class="status")
i(class="ic i-chart-area")
span(title=__('symbols_count_time.count_total'))
!= `${ symbolsCountTotal(site) } ${__('symbols_count_time.word')}`
span(class="post-meta-divider") |
span(class="post-meta-divider")
!= " | "
span(class="post-meta-item-icon")
i(class="ic i-coffee")
span(title=__('symbols_count_time.time_total'))
Expand All @@ -27,14 +28,14 @@ div(class="status")
!= __('footer.powered', _url('https://hexo.io', 'Hexo') + ' & Theme.' + _url('https://github.com/theme-shoka-x/hexo-theme-shokaX/', 'ShokaX'))
if theme.footer.icp.enable
br
span(style="display:inline;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;")
span(style="display:inline;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:var(--grey-5);")
a(href="https://beian.miit.gov.cn")
!= theme.footer.icp.icpnumber
- var beianN = theme.footer.icp?.beian, RC=theme.footer.icp?.recordcode
if beianN && RC
br
a(target="_blank" href=`https://beian.mps.gov.cn/#/query/webSearch?code=${RC}`)
img(loading="lazy" decoding="async" data-src=theme.statics + theme.assets + '/' + theme.footer.icp.icon style="max-width: 2em;display:inline;" width="20" height="20")
img(loading="lazy" decoding="async" data-src=theme.statics + theme.assets + '/' + theme.footer.icp.icon style="max-width: 2em;display:inline;" width="20" height="20" alt="备案")
!= beianN
!= shokax_inject('status')
Expand Down
7 changes: 7 additions & 0 deletions layout/_partials/head/head_com.pug
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ else if page.tags && page.tags.length
else if config.keywords
meta(name="keywords" content=config.keywords)
if page.description
meta(name="description" content=page.description)
else if page.excerpt
meta(name="description" content=page.excerpt)
else if config.description
meta(name="description" content=config.description)
!= canonical()
if theme.open_graph
Expand Down
4 changes: 2 additions & 2 deletions layout/_partials/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
if theme.homeConfig.gradient || enableFixedCover
//- cover不可用时用Bing随机图片代替
- var coverImage = theme.homeConfig?.fixedCover || "https://7ed.net/bing/api"
img(src=coverImage loading="eager" decoding="async" fetchpriority="high")
img(src=coverImage loading="eager" decoding="async" fetchpriority="high" alt=title)
else
if covers.length === 6
ul
each image in covers
li(class="item" style=`background-image: url("${image}");`)
else
img(src=covers loading="eager" decoding="async" fetchpriority="high")
img(src=covers loading="eager" decoding="async" fetchpriority="high" alt=title)
div(id="waves")
svg(class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto")
defs
Expand Down
2 changes: 1 addition & 1 deletion layout/_partials/sidebar/menu.pug
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mixin item(name, path, parent, sublist)
if parent
li(class="item dropdown")
if itemURL === '/'
a(href="javascript:void(0);")
a(href="#" onclick="return false;")
!= menuIcon + menuText
else
!= _url(itemURL, menuIcon + menuText, {rel: 'section'})
Expand Down
4 changes: 1 addition & 3 deletions source/css/_common/outline/footer/footer.styl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
background: var(--body-bg-shadow);

.inner {
margin: 0 auto;
margin: 2rem auto .625rem;
width: $content-desktop;
position: relative;

Expand Down Expand Up @@ -35,7 +35,6 @@
.status {
width: 100%;
text-align: center;
margin-top: 2rem;
}

.languages {
Expand Down Expand Up @@ -65,5 +64,4 @@

.powered-by, .theme-info {
display: inline-block;
margin-bottom: .625rem;
}

0 comments on commit 2e2dc1f

Please sign in to comment.