init...
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
if !theme.disable_top_img && page.top_img !== false
|
||||
if is_post()
|
||||
- var top_img = page.top_img || page.cover || page.randomcover
|
||||
else if is_page()
|
||||
- var top_img = page.top_img || theme.default_top_img
|
||||
else if is_home()
|
||||
- var top_img = theme.index_img !== false ? theme.index_img || theme.default_top_img : false
|
||||
- var home_index_img = theme.index_img !== false ? theme.index_img || theme.default_top_img : false
|
||||
else
|
||||
- var top_img = page.top_img || theme.default_top_img
|
||||
|
||||
if top_img !== false
|
||||
- var imgSource = top_img && top_img.indexOf('/') !== -1 ? url_for(top_img) : top_img
|
||||
- var bg_img = top_img ? imgSource : ''
|
||||
- var home_index_img_bg = home_index_img ? home_index_img : ''
|
||||
- var site_title = page.title || page.tag || page.category || config.title
|
||||
- var isHomeClass = is_home() ? 'full_page' : 'not-home-page'
|
||||
- is_post() ? isHomeClass = 'post-bg' : isHomeClass
|
||||
else
|
||||
- var isHomeClass = 'not-top-img'
|
||||
else
|
||||
- var top_img = false
|
||||
- var isHomeClass = 'not-top-img'
|
||||
header#page-header(class=`${isHomeClass}` style=home_index_img_bg)
|
||||
!=partial('includes/header/nav', {}, {cache: true})
|
||||
if top_img !== false
|
||||
if is_post()
|
||||
if page.bilibili_bg
|
||||
!=partial('includes/bili-banner/index')
|
||||
else
|
||||
include ./post-info.pug
|
||||
if theme.dynamicEffect && theme.dynamicEffect.postTopWave
|
||||
section.main-hero-waves-area.waves-area
|
||||
svg.waves-svg(xmlns='http://www.w3.org/2000/svg', xlink='http://www.w3.org/1999/xlink', viewBox='0 24 150 28', preserveAspectRatio='none', shape-rendering='auto')
|
||||
defs
|
||||
path#gentle-wave(d='M -160 44 c 30 0 58 -18 88 -18 s 58 18 88 18 s 58 -18 88 -18 s 58 18 88 18 v 44 h -352 Z')
|
||||
g.parallax
|
||||
use(href='#gentle-wave', x='48', y='0')
|
||||
use(href='#gentle-wave', x='48', y='3')
|
||||
use(href='#gentle-wave', x='48', y='5')
|
||||
use(href='#gentle-wave', x='48', y='7')
|
||||
#post-top-cover
|
||||
img#post-top-bg(class='nolazyload' src=bg_img)
|
||||
|
||||
else if is_home()
|
||||
#site-info
|
||||
h1#site-title=site_title
|
||||
if theme.subtitle.enable
|
||||
- var loadSubJs = true
|
||||
#site-subtitle
|
||||
span#subtitle
|
||||
if(theme.social)
|
||||
#site_social_icons
|
||||
!=fragment_cache('social', function(){return partial('includes/header/social')})
|
||||
#scroll-down
|
||||
i.anzhiyufont.anzhiyu-icon-angle-down.scroll-down-effects
|
||||
else
|
||||
#page-site-info
|
||||
h1#site-title=site_title
|
||||
@@ -0,0 +1,49 @@
|
||||
if theme.menu
|
||||
//- for mobile sidebar
|
||||
- let sidebarChildHide = theme.hide_sidebar_menu_child ? 'hide' : ''
|
||||
|
||||
.menus_items
|
||||
each value, label in theme.menu
|
||||
if typeof value !== 'object'
|
||||
.menus_item
|
||||
a.site-page.faa-parent.animated-hover(href=url_for(trim(value.split('||')[0])))
|
||||
if value.split('||')[1]
|
||||
- var icon_value = trim(value.split('||')[1])
|
||||
- var anima_value = value.split('||')[2] ? trim(value.split('||')[2]) : 'faa-tada'
|
||||
if icon_value.substring(0,2)=="fa"
|
||||
i(class=icon_value + ' ' + anima_value)
|
||||
else if icon_value.substring(0,4)=="icon"
|
||||
svg.icon(aria-hidden="true" class=anima_value)
|
||||
use(xlink:href=`#`+ icon_value)
|
||||
else if icon_value.substring(0,4)=="anzhiyu"
|
||||
i.anzhiyufont(style="font-size: 0.9em;" class=icon_value + ' ' + anima_value)
|
||||
span=' '+label
|
||||
else
|
||||
.menus_item
|
||||
a.site-page(href='javascript:void(0);')
|
||||
if label.split('||')[1]
|
||||
- var icon_label = trim(label.split('||')[1])
|
||||
- var anima_label = label.split('||')[2] ? trim(label.split('||')[2]) : 'faa-tada'
|
||||
if icon_label.substring(0,2)=="fa"
|
||||
i(class=icon_label + ' ' + anima_label)
|
||||
else if (icon_label.startsWith("icon"))
|
||||
svg.icon(aria-hidden="true" class=anima_label)
|
||||
use(xlink:href=`#`+ icon_label)
|
||||
else if (icon_label.startsWith("anzhiyu"))
|
||||
i.anzhiyufont(style="font-size: 0.9em;" class=icon_label + ' ' + anima_label)
|
||||
span=' '+ trim(label.split('||')[0])
|
||||
ul.menus_item_child
|
||||
each val,lab in value
|
||||
li
|
||||
a.site-page.child.faa-parent.animated-hover(href=url_for(trim(val.split('||')[0])))
|
||||
if val.split('||')[1]
|
||||
- var icon_val = trim(val.split('||')[1])
|
||||
- var anima_val = val.split('||')[2] ? trim(val.split('||')[2]) : 'faa-tada'
|
||||
if icon_val.substring(0,2)=="fa"
|
||||
i(class=icon_val + ' ' + anima_val)
|
||||
else if (icon_val.startsWith("icon"))
|
||||
svg.icon(aria-hidden="true" class=anima_val)
|
||||
use(xlink:href=`#`+ icon_val)
|
||||
else if (icon_val.startsWith("anzhiyu"))
|
||||
i.anzhiyufont(style="font-size: 0.9em;" class=icon_val + ' ' + anima_val)
|
||||
span=' '+ lab
|
||||
@@ -0,0 +1,61 @@
|
||||
- const { darkmode } = theme
|
||||
nav#nav
|
||||
#nav-group
|
||||
span#blog_name
|
||||
if theme.nav.enable
|
||||
.back-home-button
|
||||
i.anzhiyufont.anzhiyu-icon-grip-vertical
|
||||
.back-menu-list-groups
|
||||
each group in theme.nav.menu
|
||||
.back-menu-list-group
|
||||
.back-menu-list-title= group.title
|
||||
.back-menu-list
|
||||
each item in group.item
|
||||
a.back-menu-item(href=url_for(item.link), title=item.name)
|
||||
img.back-menu-item-icon(src=item.icon alt=item.name)
|
||||
span.back-menu-item-text= item.name
|
||||
a#site-name(href=url_for('/') accesskey="h")
|
||||
.title #[=config.title]
|
||||
i.anzhiyufont.anzhiyu-icon-house-chimney
|
||||
if (theme.nav.clock)
|
||||
!=partial('includes/anzhiyu/clock', {}, {cache: true})
|
||||
|
||||
div.mask-name-container
|
||||
#name-container
|
||||
a#page-name(href="javascript:anzhiyu.scrollToDest(0, 500)") PAGE_NAME
|
||||
|
||||
#menus
|
||||
!=partial('includes/header/menu_item', {}, {cache: true})
|
||||
#nav-right
|
||||
if theme.nav.travelling
|
||||
.nav-button.only-home#travellings_button(title='随机前往一个开往项目网站')
|
||||
a.site-page(onclick='anzhiyu.totraveling()', title='随机前往一个开往项目网站', href='javascript:void(0);', rel='external nofollow', data-pjax-state='external')
|
||||
i.anzhiyufont.anzhiyu-icon-train
|
||||
.nav-button#randomPost_button
|
||||
a.site-page(onclick='toRandomPost()', title='随机前往一个文章', href='javascript:void(0);')
|
||||
i.anzhiyufont.anzhiyu-icon-dice
|
||||
if (theme.algolia_search.enable || theme.local_search.enable || theme.docsearch.enable)
|
||||
div.nav-button#search-button
|
||||
a.site-page.social-icon.search(href='javascript:void(0);', title='搜索🔍' accesskey="s")
|
||||
i.anzhiyufont.anzhiyu-icon-magnifying-glass
|
||||
span=' '+_p('search.title')
|
||||
|
||||
if theme.centerConsole.enable
|
||||
input#center-console(type="checkbox")
|
||||
label.widget(for="center-console" title=_p("中控台") onclick="anzhiyu.switchConsole();")
|
||||
i.left
|
||||
i.widget.center
|
||||
i.widget.right
|
||||
|
||||
!=partial('includes/anzhiyu/console', {}, {cache:true})
|
||||
|
||||
div.nav-button#nav-totop
|
||||
a.totopbtn(href='javascript:void(0);')
|
||||
i.anzhiyufont.anzhiyu-icon-arrow-up
|
||||
span#percent(onclick="anzhiyu.scrollToDest(0,500)") 0
|
||||
|
||||
#toggle-menu
|
||||
a.site-page(href='javascript:void(0);' title="切换")
|
||||
i.anzhiyufont.anzhiyu-icon-bars
|
||||
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
- let comments = theme.comments
|
||||
#post-info
|
||||
#post-firstinfo
|
||||
.meta-firstline
|
||||
if (page.copyright_author && page.copyright_author !== config.author)
|
||||
a.post-meta-original 转载
|
||||
else
|
||||
a.post-meta-original 原创
|
||||
if (theme.post_meta.post.categories && page.categories && page.categories.data.length > 0)
|
||||
span.post-meta-categories
|
||||
if (theme.post_meta.post.date_type)
|
||||
span.post-meta-separator
|
||||
|
||||
each item, index in page.categories.data
|
||||
i.anzhiyufont.anzhiyu-icon-inbox.post-meta-icon
|
||||
a(href=url_for(item.path) itemprop="url").post-meta-categories #[=item.name]
|
||||
if (index < page.categories.data.length - 1)
|
||||
i.anzhiyufont.anzhiyu-icon-angle-right.post-meta-separator
|
||||
if (theme.post_meta.page.tags)
|
||||
span.article-meta.tags
|
||||
each item, index in page.tags.data
|
||||
a(href=url_for(item.path) tabindex="-1" itemprop="url").article-meta__tags
|
||||
span
|
||||
i.anzhiyufont.anzhiyu-icon-hashtag
|
||||
=item.name
|
||||
|
||||
h1.post-title(itemprop="name headline")= page.title || _p('no_title')
|
||||
if (theme.post_edit.enable && (theme.post_edit.github !== false))
|
||||
a.post-edit-link(href=theme.post_edit.url + page.source title=_p('post.edit.github') + ' - ' + page.title target="_blank")
|
||||
i.anzhiyufont.anzhiyu-icon-pencil
|
||||
if (theme.post_edit.enable && (theme.post_edit.yuque !== false))
|
||||
a.post-edit-link(href=theme.post_edit.yuque + page.id + '/edit/' title=_p('post.edit.yuque') + ' - ' + page.title target="_blank")
|
||||
i.anzhiyufont.anzhiyu-icon-pencil
|
||||
|
||||
#post-meta
|
||||
.meta-firstline
|
||||
if (theme.post_meta.post.date_type)
|
||||
span.post-meta-date
|
||||
if (theme.post_meta.post.date_type === 'both')
|
||||
i.anzhiyufont.anzhiyu-icon-calendar-days.post-meta-icon
|
||||
span.post-meta-label= _p('post.created')
|
||||
time.post-meta-date-created(itemprop="dateCreated datePublished" datetime=date_xml(page.date) title=_p('post.created') + ' ' + full_date(page.date))=date(page.date, config.date_format)
|
||||
span.post-meta-separator
|
||||
i.anzhiyufont.anzhiyu-icon-history.post-meta-icon
|
||||
span.post-meta-label= _p('post.updated')
|
||||
time.post-meta-date-updated(itemprop="dateCreated datePublished" datetime=date_xml(page.updated) title=_p('post.updated') + ' ' + full_date(page.updated))=date(page.updated, config.date_format)
|
||||
else
|
||||
- let data_type_update = theme.post_meta.post.date_type === 'updated'
|
||||
- let date_type = data_type_update ? 'updated' : 'date'
|
||||
- let date_icon = data_type_update ? 'anzhiyu-icon-history' :'anzhiyu-icon-calendar-days'
|
||||
- let date_title = data_type_update ? _p('post.updated') : _p('post.created')
|
||||
i.post-meta-icon.anzhiyufont(class=date_icon)
|
||||
span.post-meta-label= date_title
|
||||
time(itemprop="dateCreated datePublished" datetime=date_xml(page[date_type]) title=date_title + ' ' + full_date(page[date_type]))=date(page[date_type], config.date_format)
|
||||
|
||||
.meta-secondline
|
||||
- let postWordcount = theme.wordcount.enable && (theme.wordcount.post_wordcount || theme.wordcount.min2read)
|
||||
if (postWordcount)
|
||||
span.post-meta-separator
|
||||
span.post-meta-wordcount
|
||||
if theme.wordcount.post_wordcount
|
||||
i.anzhiyufont.anzhiyu-icon-file-word.post-meta-icon(title="文章字数")
|
||||
span.post-meta-label(title="文章字数")= _p('post.wordcount') + ':'
|
||||
span.word-count(title="文章字数")= wordcount(page.content)
|
||||
if theme.wordcount.min2read
|
||||
span.post-meta-separator
|
||||
if theme.wordcount.min2read
|
||||
i.anzhiyufont.anzhiyu-icon-clock.post-meta-icon(title="阅读时长")
|
||||
span.post-meta-label(title="阅读时长")= _p('post.min2read') + ':'
|
||||
span= min2read(page.content, {cn: 350, en: 160}) + _p('post.min2read_unit')
|
||||
|
||||
//- for pv and count
|
||||
mixin pvBlock(parent_id,parent_class,parent_title)
|
||||
span.post-meta-separator
|
||||
span(class=parent_class id=parent_id data-flag-title=page.title)
|
||||
i.anzhiyufont.anzhiyu-icon-fw-eye.post-meta-icon
|
||||
span.post-meta-label(title="阅读量")=_p('post.page_pv') + ':'
|
||||
if block
|
||||
block
|
||||
|
||||
- const commentUse = comments.use
|
||||
if page.comments !== false && commentUse && !comments.lazyload
|
||||
if commentUse[0] === 'Valine' && theme.valine.visitor
|
||||
+pvBlock(url_for(page.path),'leancloud_visitors',page.title)
|
||||
span.leancloud-visitors-count(title="访问量")
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
else if commentUse[0] === 'Waline' && theme.waline.pageview
|
||||
+pvBlock('','','')
|
||||
span.waline-pageview-count(data-path=url_for(page.path) title="访问量")
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
else if commentUse[0] === 'Twikoo' && theme.twikoo.visitor
|
||||
+pvBlock('','','')
|
||||
span#twikoo_visitors(title="访问量")
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
else if commentUse[0] === 'Artalk' && theme.artalk.visitor
|
||||
+pvBlock('','','')
|
||||
span#ArtalkPV
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
else if theme.busuanzi.page_pv
|
||||
+pvBlock('','post-meta-pv-cv','')
|
||||
span#busuanzi_value_page_pv
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
else if theme.busuanzi.page_pv
|
||||
+pvBlock('','post-meta-pv-cv','')
|
||||
span#busuanzi_value_page_pv
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
- let location = page.location ? page.location : theme.post_copyright.location
|
||||
if theme.post_copyright.enable && location
|
||||
span.post-meta-separator
|
||||
span.post-meta-position(title="作者IP属地为" + location)
|
||||
i.anzhiyufont.anzhiyu-icon-location-dot
|
||||
=location
|
||||
|
||||
if comments.count && !comments.lazyload && page.comments !== false && comments.use
|
||||
- var whichCount = comments.use[0]
|
||||
|
||||
mixin countBlock
|
||||
span.post-meta-separator
|
||||
span.post-meta-commentcount
|
||||
i.anzhiyufont.anzhiyu-icon-comments.post-meta-icon
|
||||
span.post-meta-label= _p('post.comments') + ':'
|
||||
if block
|
||||
block
|
||||
|
||||
case whichCount
|
||||
when 'Valine'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment' itemprop="discussionUrl")
|
||||
span.valine-comment-count(data-xid=url_for(page.path) itemprop="commentCount")
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
when 'Waline'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment')
|
||||
span.waline-comment-count(data-path=url_for(page.path))
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
when 'Twikoo'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment' tabindex="-1")
|
||||
span#twikoo-count
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
when 'Artalk'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment')
|
||||
span.artalk-count
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
@@ -0,0 +1,12 @@
|
||||
each value, title in theme.social
|
||||
a.social-icon.faa-parent.animated-hover(href=url_for(trim(value.split('||')[0])) target="_blank" title=title === undefined ? '' : trim(title))
|
||||
if value.split('||')[1]
|
||||
- var icon_value = trim(value.split('||')[1])
|
||||
- var anima_value = value.split('||')[2] ? trim(value.split('||')[2]) : 'faa-tada'
|
||||
if (icon_value.startsWith("fa"))
|
||||
i(class=icon_value + ' ' + anima_value)
|
||||
else if (icon_value.startsWith("icon"))
|
||||
svg.icon(aria-hidden="true" class=anima_value)
|
||||
use(xlink:href=`#`+ icon_value)
|
||||
else if (icon_value.startsWith("anzhiyu"))
|
||||
i.anzhiyufont(class=icon_value)
|
||||
Reference in New Issue
Block a user