提交 e23f6bf9 编写于 作者: EvanOne(文一)'s avatar EvanOne(文一)

style: Format pug & stylus

上级 b135764f
-
var algolia = 'undefined';
var algolia = "undefined";
var env = process.env;
if (theme.algolia_search.enable) {
algolia = JSON.stringify({
......@@ -15,14 +15,14 @@
});
}
var sidebar = 'undefined';
var sidebar = "undefined";
if (theme.sidebar.enable) {
sidebar = JSON.stringify({
offsetTop: theme.sidebar.offsetTop
});
}
var back2top = 'undefined';
var back2top = "undefined";
if (theme.back2top.enable) {
back2top = JSON.stringify({
enable: theme.back2top.enable,
......@@ -30,22 +30,22 @@
});
}
var gallery_waterfall = 'undefined';
var gallery_waterfall = "undefined";
if (theme.gallery_waterfall.enable) {
gallery_waterfall = JSON.stringify(theme.gallery_waterfall);
}
var lazyload = 'undefined';
var lazyload = "undefined";
if (theme.lazyload.enable) {
lazyload = JSON.stringify(theme.lazyload);
}
var zoom_image = 'undefined';
var zoom_image = "undefined";
if (theme.zoom_image.enable) {
zoom_image = JSON.stringify(theme.zoom_image);
}
var external_link = 'undefined';
var external_link = "undefined";
if (theme.external_link.icon.enable) {
external_link = JSON.stringify({
icon: {
......
......@@ -18,12 +18,12 @@ footer#footer
).footer-separator
else
span= " "
span= footer.copyright.text || config.author + "."
if footer.copyright.enable && footer.beian.enable
span.footer-separator= "|"
if footer.beian.enable
span!= footer.beian.icp
......@@ -33,10 +33,10 @@ footer#footer
span.footer-powered
- var HEXO_URL = "http://hexo.io/";
!= _p("footer.powered", link_to(HEXO_URL, "hexo", { external: true }))
if footer.powered.version
span= " v" + hexo_env("version") + "."
if footer.powered.enable && footer.theme.enable
span.footer-separator= "|"
......@@ -44,10 +44,10 @@ footer#footer
span= _p("footer.theme") + " - "
- var STUN_URL = "https://github.com/liuyib/hexo-theme-stun/";
!= link_to(STUN_URL, "stun", { external: true })
if footer.theme.version
span= " v" + stun_env("version") + "."
if theme.busuanzi.enable
include ../_components/analytics/busuanzi.pug
......
......@@ -32,7 +32,7 @@ meta(name="apple-mobile-web-app-status-bar-style" content="black")
if theme.pwa && theme.pwa.enable
if theme.pwa.theme_color
meta(name="theme-color" content=theme.pwa.theme_color)
if theme.pwa.manifest
link(rel="manifest" href=`${url_for(theme.pwa.manifest)}?v=${stun_env("version")}`)
......
......@@ -10,7 +10,7 @@ html(lang=config.language)
if theme.back2top.enable
include ../_components/back2top.pug
include ../_components/search/index.pug
include ../_scripts/cdn.pug
include ../_scripts/common.pug
......@@ -2,13 +2,13 @@ main#main
div.main-inner
if theme.sidebar.enable
include ./sidebar.pug
if body
div!= body
else
block content
if page.comments
include ../_components/comments.pug
div.clearfix
......@@ -5,17 +5,17 @@ div.busuanzi
if !theme.busuanzi.site.icon_only
span= _p("footer.uv") + " "
span#busuanzi_value_site_uv
if theme.busuanzi.site.uv.enable && theme.busuanzi.site.pv.enable
span.separator= "|"
if theme.busuanzi.site.pv.enable
span.busuanzi-pv
i.fa.fa-eye
if !theme.busuanzi.site.icon_only
span= _p("footer.pv") + " "
span#busuanzi_value_site_pv
......@@ -15,7 +15,7 @@ nav#paginator
a(href=url_for(page.prev.path))
i.fa.fa-chevron-left
span.title= page.prev.title || _p("post.untitled")
if (page.next)
div.article-next.pull-right
a(href=url_for(page.next.path))
......
......@@ -5,14 +5,14 @@ section#recent-posts.recent-posts
- postLists.each(function (post) {
article(class=`${post.link ? 'post-link' : ''}`).post
+postHeader(post)
div.post-body
if theme.post_list.cover_image.home && post.top_image
img(src=post.top_image)
if post.photos && post.photos.length
+gallery(post)
if theme.auto_excerpt && theme.auto_excerpt.enable
- const content = strip_html(post.content)
- var excerpt = content.substring(0, theme.auto_excerpt.length)
......
......@@ -3,11 +3,11 @@ div.search-mask
div.search-popup
span.search-close
div.search-input
div.search-results
div#algolia-hits
div#algolia-pagination
if theme.algolia_search.labels.show_stats
div#algolia-stats
......@@ -2,7 +2,7 @@ mixin postHeader(post)
header.post-header
if post.top
include ../_components/sticky-top.pug
if is_post()
h1.post-title= post.title || _p("post.untitled")
else
......@@ -14,7 +14,7 @@ mixin postHeader(post)
h1.post-title
a(href=url_for(post.path)
).post-title-link= post.title || _p("post.untitled")
if !post.link
div.post-meta
if theme.post_meta.created.enable
......@@ -24,7 +24,7 @@ mixin postHeader(post)
if !theme.post_meta.icon_only
span= _p("post.posted") + " "
span= full_date(post.date, "YYYY-MM-DD")
if theme.post_meta.updated.enable
span.post-update
i(class=`fa fa-${theme.post_meta.updated.icon}`)
......@@ -32,7 +32,7 @@ mixin postHeader(post)
if !theme.post_meta.icon_only
span= _p("post.updated") + " "
span= full_date(post.updated, "YYYY-MM-DD")
if theme.post_meta.word_count.enable
span.post-word-count
i(class=`fa fa-${theme.post_meta.word_count.icon}`)
......@@ -40,12 +40,12 @@ mixin postHeader(post)
if !theme.post_meta.icon_only
span= _p("post.word_count") + " "
span= wordcount(post.content)
if theme.post_meta.reading_time.enable
- var postReadingTime = theme.post_meta.reading_time
span.post-reading-time
i(class=`fa fa-${postReadingTime.icon}`)
if !theme.post_meta.icon_only
span= _p("post.reading_time") + " "
- var READING_TIME_UNIT = "m";
......@@ -64,8 +64,8 @@ mixin postHeader(post)
if theme.busuanzi.enable && theme.busuanzi.post_pv.enable
span.post-reading-count
i(class=`fa fa-${theme.busuanzi.post_pv.icon}`)
if !theme.post_meta.icon_only && !theme.busuanzi.post_pv.icon_only
span= _p("post.reading_count") + " "
span#busuanzi_value_page_pv
......@@ -4,11 +4,11 @@ mixin articleSort(posts)
- posts.each(function (post) {
if post.date
- tmpYear = full_date(post.date, "YYYY")
if tmpYear !== year
- year = tmpYear
time.article-sort-item.year= year
post.article-sort-item
if post.date
time.article-sort-item__time= full_date(post.date, "MM-DD")
......
-
var busuanzi_js = "https://cdn.jsdelivr.net/gh/sukkaw/busuanzi@latest/bsz.pure.mini.js"
if (theme.cdn.busuanzi) busuanzi_js = theme.cdn.busuanzi
script(async src=busuanzi_js)
......@@ -10,4 +10,4 @@ if page.comments
else if theme.valine && theme.valine.enable
include ./valine.pug
else if theme.valine && theme.valine.enable && theme.valine.visitor
include ./valine.pug
include ./valine.pug
......@@ -122,8 +122,7 @@ if theme.local_search.enable
// 索引位置相同的关键词,保留长度较长的
titleHitSlice.forEach(function (hit) {
if (hit.index === index &&
hit.word.length < word.length) {
if (hit.index === index && hit.word.length < word.length) {
hit.word = word;
hasMatch = true;
}
......
......@@ -15,6 +15,6 @@ block content
+articleSort(page.posts)
else
+articleSort(site.posts)
if theme.post_list.paginate.archives
include ./_components/pagination.pug
......@@ -2,7 +2,7 @@ extends ./_common/layout.pug
block content
include ./_mixins/posts-sort.pug
div.content
div.category-inner
div.article-sort-title= _p("page.categories") + " - " + page.category
......
......@@ -3,7 +3,7 @@ extends ./_common/layout.pug
block content
include ./_mixins/posts-sort.pug
include ./_mixins/post-header.pug
div.content.home-content.code-highlight
if theme.post_list.paginate.home
include ./_components/recent-posts.pug
......
......@@ -7,7 +7,7 @@ block content
div.content.tag-cloud
if page.photos && page.photos.length
+gallery(page)
div.tag-cloud-title= _p("page.tags") + " - "
span.tag-cloud-num= site.tags.length
- var min_font = theme.tag_cloud ? theme.tag_cloud.min_size : 14
......@@ -19,7 +19,7 @@ block content
div.content.category
if page.photos && page.photos.length
+gallery(page)
div.category-title= _p("page.categories") + " - "
span.category-num= site.categories.length
!= list_categories()
......@@ -27,11 +27,11 @@ block content
div.content.headings.code-highlight
if page.photos && page.photos.length
+gallery(page)
!= page.content
else
div.content.headings.code-highlight
if page.photos && page.photos.length
+gallery(page)
!= page.content
......@@ -3,14 +3,14 @@ extends ./_common/layout.pug
block content
include ./_mixins/post-header.pug
include ./_mixins/gallery.pug
div.content.headings.code-highlight
+postHeader(page)
div.post-body
if page.photos && page.photos.length
+gallery(page)
!= page.content
footer.post-footer
......@@ -19,7 +19,7 @@ block content
span= "------"
span= _p("post.end")
span= "------"
- let themeConfigCC = theme.creative_commons.enable && theme.creative_commons.post
if page.copyright === false ? page.copyright : themeConfigCC
include ./_components/copyright.pug
......@@ -30,8 +30,8 @@ block content
i.fa.fa-tags.icon
each tag in page.tags.data
span!= link_to(tag.permalink, tag.name)
if page.reward === false ? page.reward : (theme.reward && theme.reward.enable)
include ./_components/reward.pug
include ./_components/pagination.pug
......@@ -2,7 +2,7 @@ extends ./_common/layout.pug
block content
include ./_mixins/posts-sort.pug
div.content
div.tag-inner
div.article-sort-title= _p("page.tags") + " - " + page.tag
......
......@@ -5,8 +5,8 @@
.footer-inner
.external-link i
color: #fff
font-size: .7em
color: #fff
.post-title
.external-link i
......
......@@ -59,7 +59,7 @@
width: 1rem
height: .2rem
background-color: $black-light
@extend .anime-close
.search-results
......
......@@ -32,7 +32,7 @@
&:hover
color: $blue-light
b
color: $blue-light
......
......@@ -56,7 +56,12 @@
strong
color: #dc3b3b
h1, h2, h3, h4, h5, h6
h1,
h2,
h3,
h4,
h5,
h6
margin: 0
strong
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册