This commit is contained in:
2024-07-30 21:41:51 +08:00
commit 192ef21b12
574 changed files with 70686 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
extends includes/layout.pug
block content
include ./includes/mixins/article-sort.pug
#archive
.article-sort-title= `${_p('page.articles')} - ${getArchiveLength()}`
+articleSort(page.posts, page.current)
include includes/pagination.pug

View File

@@ -0,0 +1,23 @@
extends includes/layout.pug
block content
if theme.category_ui == 'index'
include ./includes/mixins/post-ui.pug
#recent-posts.recent-posts.category_ui
+postUI
include includes/pagination.pug
else
include ./includes/mixins/article-sort.pug
#category
#catalog-bar
i.anzhiyufont.anzhiyu-icon-shapes
#catalog-list
.catalog-list-item
a(href="/") 首页
!=catalog_list("categories")
.category-bar-next#category-bar-next(onclick="anzhiyu.scrollCategoryBarToRight()")
i.anzhiyufont.anzhiyu-icon-angle-double-right
a.catalog-more(href="/categories/")!= '更多'
.article-sort-title= _p('page.category') + ' - ' + page.category
+articleSort(page.posts, page.current)
include includes/pagination.pug

View File

@@ -0,0 +1,36 @@
- let error_404_top_img = theme.error_404.background || theme.default_top_img
- let error_404_bg_img = `background-image: url('${url_for(error_404_top_img)}')`
#body-wrap.error
include ./header/index.pug
.error-box
#error-wrap
.error-content
.error-img(style=error_404_bg_img)
.error-info
h1.error_title= '404'
.error_subtitle= theme.error_404.subtitle
a.button--animated(href=config.root)
i.anzhiyufont.anzhiyu-icon-rocket
= _p('回到主页')
.aside-list
.aside-list-group
- let postLimit = theme.aside.card_recent_post.limit === 0 ? site.posts.length : theme.related_post.limit || 6
- let sort = theme.aside.card_recent_post.sort === 'updated' ? 'updated' : 'date'
- site.posts.sort(sort, -1).limit(postLimit).each(function(article){
- let link = article.link || article.path
- let title = article.title || _p('no_title')
- let no_cover = article.cover === false || !theme.cover.aside_enable ? 'no-cover' : ''
- let post_cover = article.cover
.aside-list-item(class=no_cover)
if post_cover && theme.cover.aside_enable
a.thumbnail(href=url_for(link) title=title)
img(src=url_for(post_cover) onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'` alt=title)
.content
a.title(href=url_for(link) title=title)= title
if theme.aside.card_recent_post.sort === 'updated'
time(datetime=date_xml(article.updated) title=_p('post.updated') + ' ' + full_date(article.updated)) #[=date(article.updated, config.date_format)]
else
time(datetime=date_xml(article.date) title=_p('post.created') + ' ' + full_date(article.date)) #[=date(article.date, config.date_format)]
- })

View File

@@ -0,0 +1,131 @@
div
script(src=url_for(theme.asset.utils))
script(src=url_for(theme.asset.main))
if theme.translate.enable
script(src=url_for(theme.asset.translate))
if theme.medium_zoom
script(src=url_for(theme.asset.medium_zoom))
else if theme.fancybox
script(src=url_for(theme.asset.fancybox))
if theme.instantpage
script(src=url_for(theme.asset.instantpage), type='module')
if theme.lazyload.enable
script(src=url_for(theme.asset.lazyload))
if theme.snackbar.enable
script(src=url_for(theme.asset.snackbar))
if theme.pangu.enable
!= partial("includes/third-party/pangu.pug", {}, { cache: true })
if theme.asset.meting_api
script.
var meting_api = "!{theme.asset.meting_api}";
//- 深色模式粒子效果canvas
if theme.universe.enable
canvas(id="universe")
script(async src="https://npm.elemecdn.com/anzhiyu-theme-static@1.0.0/dark/dark.js")
//- 控制台打印信息
if theme.console.enable
!= partial("includes/anzhiyu/log-js.pug", {}, { cache: true })
//- 随机文章
script(async src="/anzhiyu/random.js")
//- 页脚计时器
if theme.footer.runtime.enable
!= partial("includes/third-party/runtime/runtime-js.pug", {}, { cache: true })
//- search
if theme.algolia_search.enable
script(src=url_for(theme.asset.algolia_search))
script(src=url_for(theme.asset.instantsearch))
script(src=url_for(theme.asset.algolia_js))
else if theme.local_search.enable
script(src=url_for(theme.asset.local_search))
.js-pjax
if theme.peoplecanvas.enable && is_home()
script.
if (typeof gsap === "object") {
getScript("!{url_for(theme.asset.people_js)}", {defer:true})
} else {
getScript("!{url_for(theme.asset.gsap_js)}").then(()=>{
getScript("!{url_for(theme.asset.people_js)}", {defer:true})
});
}
if needLoadCountJs
!= partial("includes/third-party/card-post-count/index", {}, { cache: true })
if loadSubJs
include ./third-party/subtitle.pug
include ./third-party/math/index.pug
if commentsJsLoad
include ./third-party/comments/js.pug
input(type="hidden" name="page-type" id="page-type" value=(page.type ? page.type : (is_post() ? "post" : (is_category() ? "categories" : "anzhiyu"))))
//- 评论弹幕
if theme.comment_barrage_config.enable && theme.comments.use == 'Twikoo' && page.comments
script(async src=url_for(theme.asset.comment_barrage_js))
!= partial("includes/third-party/prismjs", {}, { cache: true })
if theme.aside.enable && theme.newest_comments.enable
if theme.pjax.enable
!= partial("includes/third-party/newest-comments/index", {}, { cache: true })
else if (!is_post() && page.aside !== false)
!= partial("includes/third-party/newest-comments/index", {}, { cache: true })
//- 气泡效果
if theme.bubble.enable
script(async data-pjax src="https://npm.elemecdn.com/anzhiyu-theme-static@1.0.1/bubble/bubble.js")
if theme.visitorMail.enable
- const mail = theme.visitorMail.mail
script.
var visitorMail = "#{mail}";
//- 即刻依赖waterfall
script(async data-pjax src=url_for(theme.asset.waterfall))
//- 文章二维码
script(src='https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/qrcodejs/1.0.0/qrcode.min.js')
//- 右键菜单
if (theme.rightClickMenu && theme.rightClickMenu.enable)
script(src=url_for(theme.asset.right_click_menu_js))
//- iconfont依赖
link(rel="stylesheet" href=url_for(theme.asset.ali_iconfont_css))
if (theme.icons && theme.icons.ali_iconfont_js)
script(async src=url_for(theme.icons.ali_iconfont_js))
!= fragment_cache('injectBottom', function(){return injectHtml(theme.inject.bottom)})
!= partial("includes/third-party/effect", {}, { cache: true })
!= partial("includes/third-party/chat/index", {}, { cache: true })
if theme.aplayerInject && theme.aplayerInject.enable
if theme.pjax.enable || theme.aplayerInject.per_page
include ./third-party/aplayer.pug
else if page.aplayer
include ./third-party/aplayer.pug
if theme.pjax.enable
!= partial("includes/third-party/pjax", {}, { cache: true })
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
script(async data-pjax src= theme.asset.busuanzi || '//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js')
if theme.accesskey.enable
script(charset="UTF-8" src=url_for(theme.asset.accesskey_js))
if is_current("/") && theme.greetingBox.enable
#greetingBox

View File

@@ -0,0 +1,26 @@
- let pageFillDescription = get_page_fill_description()
- let gptName = theme.post_head_ai_description.gptName
- let mode = theme.post_head_ai_description.mode
- let switchBtn = theme.post_head_ai_description.switchBtn
if (pageFillDescription && page.ai)
.post-ai-description
.ai-title
i.anzhiyufont.anzhiyu-icon-bilibili
.ai-title-text AI-摘要
if (switchBtn)
#ai-Toggle 切换
i.anzhiyufont.anzhiyu-icon-arrow-rotate-right
i.anzhiyufont.anzhiyu-icon-circle-dot(title="朗读摘要")
#ai-tag
if mode == "tianli"
= "Tianli GPT"
else
= gptName + " GPT"
.ai-explanation AI初始化中...
.ai-btn-box
.ai-btn-item 介绍自己 🙈
.ai-btn-item 生成本文简介 👋
.ai-btn-item 推荐相关文章 📖
.ai-btn-item 前往主页 🏠
.ai-btn-item#go-tianli-blog 前往爱发电购买
script(data-pjax src=url_for(theme.asset.ai_abstract_js))

View File

@@ -0,0 +1,29 @@
#he-plugin-simple
script.
var WIDGET = {
"CONFIG": {
"modules": "0124",
"background": "2",
"tmpColor": "FFFFFF",
"tmpSize": "16",
"cityColor": "FFFFFF",
"citySize": "16",
"aqiColor": "E8D87B",
"aqiSize": "16",
"weatherIconSize": "24",
"alertIconSize": "18",
"padding": "10px 10px 10px 10px",
"shadow": "0",
"language": "auto",
"borderRadius": "20",
"fixed": "true",
"vertical": "top",
"horizontal": "left",
"left": "20",
"top": "7.1",
"key": "df245676fb434a0691ead1c63341cd94"
}
}
link(rel="stylesheet", href="https://widget.qweather.net/simple/static/css/he-simple.css?v=1.4.0")
script(src="https://widget.qweather.net/simple/static/js/he-simple.js?v=1.4.0")

View File

@@ -0,0 +1,47 @@
#console
.console-card-group-reward
ul.reward-all.console-card
each item in theme.reward.QR_code
li.reward-item
a(href=url_for(item.link || item.img), target='_blank')
img.post-qr-code-img(alt=item.text, src=url_for(item.img))
.post-qr-code-desc=item.text
.console-card-group
.console-card-group-left
!=partial('includes/widget/card_newest_comment', {}, {cache: true})
.console-card-group-right
.console-card.tags
.card-content
if theme.nav_music.enable && theme.nav_music.console_widescreen_music
.author-content-item-tips 音乐
span.author-content-item-title 灵魂的碰撞💥
else
.author-content-item-tips 兴趣点
span.author-content-item-title 寻找你感兴趣的领域
!=partial('includes/widget/card_console_tags', {}, {cache: true})
.console-card.history
.item-headline
i.anzhiyufont.anzhiyu-icon-box-archiv
span 文章
!=partial('includes/widget/card_console_archives', {}, {cache: true})
.button-group
if theme.darkmode.enable
.console-btn-item
a.darkmode_switchbutton(title='显示模式切换', href='javascript:void(0);')
i.anzhiyufont.anzhiyu-icon-moon
.console-btn-item#consoleHideAside(onclick='anzhiyu.hideAsideBtn()', title='边栏显示控制')
a.asideSwitch
i.anzhiyufont.anzhiyu-icon-arrows-left-right
if theme.comment_barrage_config.enable
.console-btn-item.on#consoleCommentBarrage(onclick='anzhiyu.switchCommentBarrage()', title='热评开关')
a.commentBarrage
i.anzhiyufont.anzhiyu-icon-message
if theme.nav_music.enable
.console-btn-item#consoleMusic(onclick='anzhiyu.musicToggle()', title='音乐开关')
a.music-switch
i.anzhiyufont.anzhiyu-icon-music
if theme.shortcutKey.enable
.console-btn-item#consoleKeyboard(onclick='anzhiyu.keyboardToggle()', title='快捷键开关')
a.keyboard-switch
i.anzhiyufont.anzhiyu-icon-keyboard
.console-mask(onclick='anzhiyu.hideConsole()', href='javascript:void(0);')

View File

@@ -0,0 +1,78 @@
- let author = config.author
- let launch_time = theme.footer.runtime.launch_time
- let since = theme.footer.owner.since
- let version = get_version("tags")
script.
// 消除控制台打印
var HoldLog = console.log;
console.log = function () {};
let now1 = new Date();
queueMicrotask(() => {
const Log = function () {
HoldLog.apply(console, arguments);
}; //在恢复前输出日志
const grt = new Date("#{launch_time}"); //此处修改你的建站时间或者网站上线时间
now1.setTime(now1.getTime() + 250);
const days = (now1 - grt) / 1000 / 60 / 60 / 24;
const dnum = Math.floor(days);
const ascll = [
`欢迎使用安知鱼!`,
`生活明朗, 万物可爱`,
`
█████╗ ███╗ ██╗███████╗██╗ ██╗██╗██╗ ██╗██╗ ██╗
██╔══██╗████╗ ██║╚══███╔╝██║ ██║██║╚██╗ ██╔╝██║ ██║
███████║██╔██╗ ██║ ███╔╝ ███████║██║ ╚████╔╝ ██║ ██║
██╔══██║██║╚██╗██║ ███╔╝ ██╔══██║██║ ╚██╔╝ ██║ ██║
██║ ██║██║ ╚████║███████╗██║ ██║██║ ██║ ╚██████╔╝
╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝
`,
"已上线",
dnum,
"天",
"©#{since} By 安知鱼 V#{version}",
];
const ascll2 = [`NCC2-036`, `调用前置摄像头拍照成功,识别为【小笨蛋】.`, `Photo captured: `, `🤪`];
setTimeout(
Log.bind(
console,
`\n%c${ascll[0]} %c ${ascll[1]} %c ${ascll[2]} %c${ascll[3]}%c ${ascll[4]}%c ${ascll[5]}\n\n%c ${ascll[6]}\n`,
"color:#425AEF",
"",
"color:#425AEF",
"color:#425AEF",
"",
"color:#425AEF",
""
)
);
setTimeout(
Log.bind(
console,
`%c ${ascll2[0]} %c ${ascll2[1]} %c \n${ascll2[2]} %c\n${ascll2[3]}\n`,
"color:white; background-color:#4fd953",
"",
"",
'background:url("https://npm.elemecdn.com/anzhiyu-blog@1.1.6/img/post/common/tinggge.gif") no-repeat;font-size:450%'
)
);
setTimeout(Log.bind(console, "%c WELCOME %c 你好,小笨蛋.", "color:white; background-color:#4f90d9", ""));
setTimeout(
console.warn.bind(
console,
"%c ⚡ Powered by 安知鱼 %c 你正在访问 #{author} 的博客.",
"color:white; background-color:#f0ad4e",
""
)
);
setTimeout(Log.bind(console, "%c W23-12 %c 你已打开控制台.", "color:white; background-color:#4f90d9", ""));
setTimeout(
console.warn.bind(console, "%c S013-782 %c 你现在正处于监控中.", "color:white; background-color:#d9534f", "")
);
});

View File

@@ -0,0 +1,82 @@
- const { translate } = theme
#rightMenu
.rightMenu-group.rightMenu-small
.rightMenu-item#menu-backward
i.anzhiyufont.anzhiyu-icon-arrow-left
.rightMenu-item#menu-forward
i.anzhiyufont.anzhiyu-icon-arrow-right
.rightMenu-item#menu-refresh
i.anzhiyufont.anzhiyu-icon-arrow-rotate-right(style="font-size: 1rem;")
.rightMenu-item#menu-top
i.anzhiyufont.anzhiyu-icon-arrow-up
.rightMenu-group.rightMenu-line.rightMenuPlugin
.rightMenu-item#menu-copytext
i.anzhiyufont.anzhiyu-icon-copy
span 复制选中文本
.rightMenu-item#menu-pastetext
i.anzhiyufont.anzhiyu-icon-paste
span 粘贴文本
a.rightMenu-item#menu-commenttext
i.anzhiyufont.anzhiyu-icon-comment-medical
span 引用到评论
.rightMenu-item#menu-newwindow
i.anzhiyufont.anzhiyu-icon-window-restore
span 新窗口打开
.rightMenu-item#menu-copylink
i.anzhiyufont.anzhiyu-icon-link
span 复制链接地址
.rightMenu-item#menu-copyimg
i.anzhiyufont.anzhiyu-icon-images
span 复制此图片
.rightMenu-item#menu-downloadimg
i.anzhiyufont.anzhiyu-icon-download
span 下载此图片
.rightMenu-item#menu-newwindowimg
i.anzhiyufont.anzhiyu-icon-window-restore
span 新窗口打开图片
.rightMenu-item#menu-search
i.anzhiyufont.anzhiyu-icon-magnifying-glass
span 站内搜索
.rightMenu-item#menu-searchBaidu
i.anzhiyufont.anzhiyu-icon-magnifying-glass
span 百度搜索
.rightMenu-item#menu-music-toggle
i.anzhiyufont.anzhiyu-icon-play
span 播放音乐
.rightMenu-item#menu-music-back
i.anzhiyufont.anzhiyu-icon-backward
span 切换到上一首
.rightMenu-item#menu-music-forward
i.anzhiyufont.anzhiyu-icon-forward
span 切换到下一首
- const nav_music_all_playlist = theme.nav_music.all_playlist
.rightMenu-item#menu-music-playlist(onclick=`window.open("${nav_music_all_playlist}", "_blank");`, style='display: none;')
i.anzhiyufont.anzhiyu-icon-radio
span 查看所有歌曲
.rightMenu-item#menu-music-copyMusicName
i.anzhiyufont.anzhiyu-icon-copy
span 复制歌名
.rightMenu-group.rightMenu-line.rightMenuOther
a.rightMenu-item.menu-link#menu-randomPost
i.anzhiyufont.anzhiyu-icon-shuffle
span 随便逛逛
a.rightMenu-item.menu-link(href='/categories/')
i.anzhiyufont.anzhiyu-icon-cube
span 博客分类
a.rightMenu-item.menu-link(href='/tags/')
i.anzhiyufont.anzhiyu-icon-tags
span 文章标签
.rightMenu-group.rightMenu-line.rightMenuOther
a.rightMenu-item#menu-copy(href='javascript:void(0);')
i.anzhiyufont.anzhiyu-icon-copy
span 复制地址
a.rightMenu-item#menu-commentBarrage(href='javascript:void(0);')
i.anzhiyufont.anzhiyu-icon-message
span.menu-commentBarrage-text 关闭热评
a.rightMenu-item#menu-darkmode(href='javascript:void(0);')
i.anzhiyufont.anzhiyu-icon-circle-half-stroke
span.menu-darkmode-text 深色模式
a.rightMenu-item#menu-translate(href='javascript:void(0);')
i.anzhiyufont.anzhiyu-icon-language
span=translate.rightMenuMsgDefault
#rightmenu-mask

View File

@@ -0,0 +1,20 @@
if site.data.creativity
#skills-tags-group-all
.tags-group-wrapper
each i in site.data.creativity
- const evenNum = i.creativity_list.filter((x, index) => index % 2 === 0);
- const oddNum = i.creativity_list.filter((x, index) => index % 2 === 1);
each item, index in i.creativity_list
if ((index+1 <= evenNum.length) && (index+1 <= oddNum.length))
.tags-group-icon-pair
.tags-group-icon(style=`background: ${evenNum[index].color}`)
img.no-lightbox(title=evenNum[index].name, src=evenNum[index].icon, size="60px" alt=evenNum[index].name)
.tags-group-icon(style=`background: ${oddNum[index].color}`)
img.no-lightbox(title=oddNum[index].name, src=oddNum[index].icon, size="60px" alt=oddNum[index].name)
each item, index in i.creativity_list
if ((index+1 <= evenNum.length) && (index+1 <= oddNum.length))
.tags-group-icon-pair
.tags-group-icon(style=`background: ${evenNum[index].color}`)
img.no-lightbox(title=evenNum[index].name, src=evenNum[index].icon, size="60px" alt=evenNum[index].name)
.tags-group-icon(style=`background: ${oddNum[index].color}`)
img.no-lightbox(title=oddNum[index].name, src=oddNum[index].icon, size="60px" alt=oddNum[index].name)

View File

@@ -0,0 +1,17 @@
if site.data.essay
each i in site.data.essay
if i.home_essay
- let onclick_value = theme.pjax.enable ? `pjax.loadUrl("/essay/");` : '';
- let href_value = theme.pjax.enable ? 'javascript:void(0);' : `/essay/`;
#bbTimeList.bbTimeList.container
i.anzhiyufont.anzhiyu-icon-jike.bber-logo.fontbold(onclick=onclick_value, title="即刻短文", href=href_value, aria-hidden="true")
#bbtalk.swiper-container.swiper-no-swiping.essay_bar_swiper_container(tabindex="-1")
#bber-talk.swiper-wrapper(onclick=onclick_value)
each i in site.data.essay
each item, index in i.essay_list
if index < 10
- var contentText = item.image ? item.content + ' [图片]' : (item.video ? item.content + ' [视频]' : item.content)
a.li-style.swiper-slide(href=href_value)= contentText
a.bber-gotobb.anzhiyufont.anzhiyu-icon-circle-arrow-right( onclick=onclick_value, href=href_value, title="查看全文")
script(src=url_for(theme.home_top.swiper.swiper_js))

View File

@@ -0,0 +1,2 @@
//- 随机背景
script(src=url_for("https://npm.elemecdn.com/anzhiyu-theme-static@1.0.0/biliBg/biliBg.js"), data-pjax)

View File

@@ -0,0 +1,10 @@
#categoryBar
#category-bar.category-bar
#catalog-bar
#catalog-list
.catalog-list-item(id='首页')
a(href="/") 首页
!=catalog_list("categories")
.category-bar-next#category-bar-next(onclick="anzhiyu.scrollCategoryBarToRight()")
i.anzhiyufont.anzhiyu-icon-angle-double-right
a.catalog-more(href="/categories/")!= '更多'

View File

@@ -0,0 +1,93 @@
#footer-wrap
if theme.footer.socialBar.enable
- let centerImg = theme.footer.socialBar.centerImg ? theme.footer.socialBar.centerImg : theme.avatar.img
- let leftInfo = theme.footer.socialBar.left
- let rightInfo = theme.footer.socialBar.right
#footer_deal
each item, index in leftInfo
a.deal_link(href=url_for(item.link) title=item.title)
if (item.icon.startsWith("fa"))
i(class=`${item.icon}`)
else if (item.icon.startsWith("icon"))
svg.icon(aria-hidden="true")
use(xlink:href=`#`+ item.icon)
else if (item.icon.startsWith("anzhiyu"))
i.anzhiyufont(class=`${item.icon}`)
img.footer_mini_logo(title="返回顶部", alt="返回顶部" onclick="anzhiyu.scrollToDest(0, 500)", src=centerImg, size="50px")
each item, index in rightInfo
a.deal_link(href=url_for(item.link) title=item.title)
if (item.icon.startsWith("fa"))
i(class=`${item.icon}`)
else if (item.icon.startsWith("icon"))
svg.icon(aria-hidden="true")
use(xlink:href=`#`+ item.icon)
else if (item.icon.startsWith("anzhiyu"))
i.anzhiyufont(class=`${item.icon}`)
if theme.footer.owner.enable && !theme.footer.footerBar.enable
- var nowYear = new Date().getFullYear()
if theme.footer.owner.since && theme.footer.owner.since != nowYear
.copyright!= `&copy;${theme.footer.owner.since} - ${nowYear} By ${config.author}`
else
.copyright!= `&copy;${nowYear} By ${config.author}`
- let work_img = theme.footer.runtime.work_img
- let work_description = theme.footer.runtime.work_description
if theme.footer.runtime.enable
#workboard
if work_img != null
img(src=`${work_img}`, alt=`${work_description}`, title=`${work_description}`, class="workSituationImg boardsign")
#runtimeTextTip
if theme.footer.custom_text
.footer_custom_text!=`${theme.footer.custom_text}`
if theme.footer.list.enable
- let projectList = theme.footer.list.project
#anzhiyu-footer
each item, index in projectList
.footer-group
.footer-title=item.title
.footer-links
each iten, indey in item.links
a.footer-item(title=iten.title href=url_for(iten.link))=iten.title
if theme.footer.list.randomFriends > 0
.footer-group
.footer-title-group
.footer-title 友链
a.random-friends-btn#footer-random-friends-btn(href="javascript:addFriendLinksInFooter();" title="换一批友情链接")
i.anzhiyufont.anzhiyu-icon-arrow-rotate-right
.footer-links#friend-links-in-footer
if theme.footer.bdageitem.enable
p#ghbdages
each item in theme.footer.bdageitem.list
a.github-badge(target='_blank' href=item.link style='margin-inline:5px' data-title=item.message title=item.message)
img(src=item.shields alt=item.message)
if theme.footer.footerBar && theme.footer.footerBar.enable
#footer-bar
.footer-bar-links
.footer-bar-left
#footer-bar-tips
if theme.footer.owner.enable
- var nowYear = new Date().getFullYear()
- let authorLink = theme.footer.footerBar.authorLink ? theme.footer.footerBar.authorLink : config.url
if theme.footer.owner.since && theme.footer.owner.since != nowYear
.copyright!= `&copy;${theme.footer.owner.since} - ${nowYear} By `
a.footer-bar-link(href=url_for(authorLink) title=config.author target="_blank")=config.author
else
.copyright!= `&copy;${nowYear} By `
a.footer-bar-link(href=url_for(authorLink) title=config.author target="_blank")=config.author
#footer-type-tips
if theme.footer.footerBar && theme.footer.footerBar.subTitle && theme.footer.footerBar.subTitle.enable
.js-pjax
include ./third-party/footerBarSubtitle.pug
.footer-bar-right
each item in theme.footer.footerBar.linkList
a.footer-bar-link(href=url_for(item.link) title=item.text)=item.text
if theme.footer.footerBar.cc.enable
a.footer-bar-link.cc(href=url_for(theme.footer.footerBar.cc.link) title="cc协议")
i.anzhiyufont.anzhiyu-icon-copyright-line
i.anzhiyufont.anzhiyu-icon-creative-commons-by-line
i.anzhiyufont.anzhiyu-icon-creative-commons-nc-line
i.anzhiyufont.anzhiyu-icon-creative-commons-nd-line

View File

@@ -0,0 +1,92 @@
- var pageTitle
- is_archive() ? page.title = findArchivesTitle(page, theme.menu, date) : ''
- if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag
- else if (is_category()) pageTitle = _p('page.category') + ': ' + page.category
- else if (is_current('/404.html', [strict])) pageTitle = _p('error404')
- else pageTitle = page.title || config.title || ''
- var isSubtitle = config.subtitle ? ' - ' + config.subtitle : ''
- var tabTitle = is_home() || !pageTitle ? config.title + isSubtitle : pageTitle + ' | ' + config.title
- var pageKeywords
- if (page.keywords) pageKeywords = Array.isArray(page.keywords) ? (page.keywords).join(',') : ([]).join(',') || page.keywords
- else if (page.tags && page.tags.length) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',')
- else pageKeywords = Array.isArray(config.keywords) ? (config.keywords).join(','): ([]).join(',') || config.keywords
- var pageAuthor = config.email ? config.author + ',' + config.email : config.author
- var pageCopyright = config.copyright || config.author
- var themeColorLight = theme.theme_color && theme.theme_color.enable && theme.theme_color.meta_theme_color_light || '#ffffff'
- var themeColorDark = theme.theme_color && theme.theme_color.enable && theme.theme_color.meta_theme_color_dark || '#0d0d0d'
- var themeColor = theme.display_mode === 'dark' ? themeColorDark : themeColorLight
meta(charset='UTF-8')
meta(http-equiv="X-UA-Compatible" content="IE=edge")
meta(name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no")
title= tabTitle
if pageKeywords
meta(name="keywords" content=pageKeywords)
meta(name="author" content=pageAuthor)
meta(name="copyright" content=pageCopyright)
meta(name ="format-detection" content="telephone=no")
meta(name="theme-color" content=themeColor)
meta(name="mobile-web-app-capable", content="yes")
meta(name="apple-touch-fullscreen", content="yes")
meta(name="apple-mobile-web-app-title", content=pageTitle)
meta(name="application-name", content=pageTitle)
meta(name="apple-mobile-web-app-capable", content="yes")
meta(name="apple-mobile-web-app-status-bar-style", content=themeColor)
//- Open_Graph
include ./head/Open_Graph.pug
!=favicon_tag(theme.favicon || config.favicon)
link(rel="canonical" href=urlNoIndex())
//- 預解析
!=partial('includes/head/preconnect', {}, {cache: true})
//- 網站驗證
!=partial('includes/head/site_verification', {}, {cache: true})
//- PWA
if (theme.pwa && theme.pwa.enable)
!=partial('includes/head/pwa', {}, {cache: true})
//- animation依赖
if (theme.icons && theme.icons.fontawesome_animation_css)
link(rel="stylesheet", href=url_for(theme.icons.fontawesome_animation_css))
//- main css
link(rel='stylesheet', href=url_for(theme.asset.main_css))
if (theme.icons && theme.icons.fontawesome)
link(rel='stylesheet', href=url_for(theme.asset.fontawesome) media="print" onload="this.media='all'")
if (theme.snackbar && theme.snackbar.enable)
link(rel='stylesheet', href=url_for(theme.asset.snackbar_css) media="print" onload="this.media='all'")
if theme.fancybox
link(rel='stylesheet' href=url_for(theme.asset.fancybox_css) media="print" onload="this.media='all'")
if site.data.essay || theme.home_top.swiper.enable
link(rel='stylesheet' href=url_for(theme.home_top.swiper.swiper_css) media="print" onload="this.media='all'")
//- google_adsense
!=partial('includes/head/google_adsense', {}, {cache: true})
//- analytics
!=partial('includes/head/analytics', {}, {cache: true})
//- font
if theme.blog_title_font && theme.blog_title_font.font_link
link(rel='stylesheet' href=url_for(theme.blog_title_font.font_link) media="print" onload="this.media='all'")
//- global config
!=partial('includes/head/config', {}, {cache: true})
include ./head/config_site.pug
include ./head/noscript.pug
!=fragment_cache('injectHeadJs', function(){return inject_head_js()})
!=fragment_cache('injectHead', function(){return injectHtml(theme.inject.head)})

View File

@@ -0,0 +1,18 @@
if theme.Open_Graph_meta
- let contentType = is_post() ? 'article' : 'website'
- let metaImage = (page.cover || theme.avatar.img) ? full_url_for(page.cover || theme.avatar.img) : ''
meta(property="og:type", content=contentType)
meta(property="og:title", content=pageTitle)
meta(property="og:url", content=theme.post_copyright.decode ? decodeURI(url) : url)
meta(property="og:site_name", content=config.title)
meta(property="og:description", content=page_description())
meta(property="og:locale", content=config.language)
meta(property="og:image", content=metaImage)
meta(property="article:author" content=config.author)
meta(property="article:tag" content=config.keywords)
meta(name="twitter:card", content="summary")
meta(name="twitter:image", content=metaImage)
meta(name="description" content=page_description())

View File

@@ -0,0 +1,31 @@
if theme.baidu_analytics
script.
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?!{theme.baidu_analytics}";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
if theme.google_analytics
script(async src=`https://www.googletagmanager.com/gtag/js?id=${theme.google_analytics}`)
script.
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '!{theme.google_analytics}');
if theme.cnzz_analytics
script(async data-pjax src=`https://s4.cnzz.com/z_stat.php?id=${theme.cnzz_analytics}&web_id=${theme.cnzz_analytics}`)
if theme.cloudflare_analytics
script(defer data-pjax src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon=`{"token": "${theme.cloudflare_analytics}"}`)
if theme.microsoft_clarity
script.
(function(c,l,a,r,i,t,y){
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "!{theme.microsoft_clarity}");

View File

@@ -0,0 +1,217 @@
-
let algolia = 'undefined';
let env = process.env;
if (theme.algolia_search.enable) {
algolia = JSON.stringify({
appId: env.ALGOLIA_APP_ID || config.algolia.appId || config.algolia.applicationID,
apiKey: env.ALGOLIA_API_KEY || config.algolia.apiKey,
indexName: env.ALGOLIA_INDEX_NAME || config.algolia.indexName,
hits: theme.algolia_search.hits,
// search languages
languages: {
input_placeholder: _p("search.algolia_search.input_placeholder"),
hits_empty: _p("search.algolia_search.hits_empty"),
hits_stats: _p("search.algolia_search.hits_stats"),
}
})
}
let localSearch = 'undefined';
if (theme.local_search && theme.local_search.enable) {
localSearch = JSON.stringify({
path: theme.local_search.CDN ? theme.local_search.CDN : config.root + config.search.path,
preload: theme.local_search.preload,
languages: {
// search languages
hits_empty: _p("search.local_search.hits_empty"),
}
})
}
let translate = 'undefined';
if (theme.translate && theme.translate.enable){
translate = JSON.stringify({
defaultEncoding: theme.translate.defaultEncoding,
translateDelay: theme.translate.translateDelay,
msgToTraditionalChinese: theme.translate.msgToTraditionalChinese,
msgToSimplifiedChinese: theme.translate.msgToSimplifiedChinese,
rightMenuMsgToTraditionalChinese: theme.translate.rightMenuMsgToTraditionalChinese,
rightMenuMsgToSimplifiedChinese: theme.translate.rightMenuMsgToSimplifiedChinese
})
}
let copyright = 'undefined';
if (theme.copy.enable){
copyright = JSON.stringify({
copy: theme.copy.enable,
copyrightEbable: theme.copy.copyright.enable,
limitCount: theme.copy.copyright.limit_count,
languages: {
author: _p("copy_copyright.author") + ': ' + config.author,
link: _p("copy_copyright.link") + ': ',
source: _p("copy_copyright.source") + ': ' + config.title,
info: _p("copy_copyright.info"),
copySuccess: _p("copy_copyright.copySuccess")
}
})
}
let Snackbar = 'undefined';
if (theme.snackbar && theme.snackbar.enable) {
Snackbar = JSON.stringify({
chs_to_cht: _p("Snackbar.chs_to_cht"),
cht_to_chs: _p("Snackbar.cht_to_chs"),
day_to_night: _p("Snackbar.day_to_night"),
night_to_day: _p("Snackbar.night_to_day"),
bgLight: theme.snackbar.bg_light,
bgDark: theme.snackbar.bg_dark,
position: theme.snackbar.position,
})
}
let noticeOutdate = 'undefined';
if (theme.noticeOutdate && theme.noticeOutdate.enable) {
noticeOutdate = JSON.stringify({
limitDay: theme.noticeOutdate.limit_day,
position: theme.noticeOutdate.position,
messagePrev: theme.noticeOutdate.message_prev,
messageNext: theme.noticeOutdate.message_next,
})
}
let highlight = 'undefined';
let syntaxHighlighter = config.syntax_highlighter;
let highlightEnable = syntaxHighlighter ? ['highlight.js', 'prismjs'].includes(syntaxHighlighter) : (config.highlight.enable || config.prismjs.enable);
if (highlightEnable) {
highlight = JSON.stringify({
plugin: syntaxHighlighter ? syntaxHighlighter : config.highlight.enable ? 'highlight.js' : 'prismjs',
highlightCopy: theme.highlight_copy,
highlightLang: theme.highlight_lang,
highlightHeightLimit: theme.highlight_height_limit
})
}
let friends_vue_info = 'undefined'
if (theme.friends_vue && theme.friends_vue.enable) {
friends_vue_info = JSON.stringify({
apiurl: theme.friends_vue.apiurl
})
}
let mainTone = 'undefined'
if (theme.mainTone && theme.mainTone.enable) {
mainTone = JSON.stringify({
mode: theme.mainTone.mode,
api: theme.mainTone.api,
cover_change: theme.mainTone.cover_change,
})
}
let authorStatus = 'undefined'
if (theme.author_status && theme.author_status.enable) {
authorStatus = JSON.stringify({
skills: theme.author_status.skills
})
}
let preloader = 'undefined'
if (theme.preloader && theme.preloader.enable) {
preloader = JSON.stringify({
source: theme.preloader.source
})
}
let commentBarrageConfig = 'undefined'
if (theme.comment_barrage_config && theme.comment_barrage_config.enable) {
commentBarrageConfig = JSON.stringify(theme.comment_barrage_config)
}
let greetingBox = 'undefined'
if (theme.greetingBox && theme.greetingBox.enable) {
greetingBox = JSON.stringify(theme.greetingBox)
}
let LA51 = 'undefined'
if (theme.LA && theme.LA.enable) {
LA51 = JSON.stringify(theme.LA)
}
let shortcutKey = 'undefined'
if (theme.shortcutKey && theme.shortcutKey.enable) {
shortcutKey = JSON.stringify(theme.shortcutKey)
}
let diytitle = 'undefined'
if (theme.diytitle && theme.diytitle.enable) {
diytitle = JSON.stringify(theme.diytitle)
}
let postHeadAiDescription = 'undefined'
if (theme.post_head_ai_description && theme.post_head_ai_description.enable) {
postHeadAiDescription = JSON.stringify(theme.post_head_ai_description)
}
let linkPageTop = 'undefined'
if (theme.linkPageTop && theme.linkPageTop.enable) {
linkPageTop = JSON.stringify(theme.linkPageTop)
}
let peoplecanvas = 'undefined'
if (theme.peoplecanvas && theme.peoplecanvas.enable) {
peoplecanvas = JSON.stringify(theme.peoplecanvas)
}
script.
const GLOBAL_CONFIG = {
linkPageTop: !{linkPageTop},
peoplecanvas: !{peoplecanvas},
postHeadAiDescription: !{postHeadAiDescription},
diytitle: !{diytitle},
LA51: !{LA51},
greetingBox: !{greetingBox},
twikooEnvId: '!{theme.twikoo.envId}',
commentBarrageConfig:!{commentBarrageConfig},
root: '!{config.root}',
preloader: !{preloader},
friends_vue_info: !{friends_vue_info},
navMusic: !{theme.nav_music.enable},
mainTone: !{mainTone},
authorStatus: !{authorStatus},
algolia: !{algolia},
localSearch: !{localSearch},
translate: !{translate},
noticeOutdate: !{noticeOutdate},
highlight: !{highlight},
copy: {
success: '!{_p("copy.success")}',
error: '!{_p("copy.error")}',
noSupport: '!{_p("copy.noSupport")}'
},
relativeDate: {
homepage: !{theme.post_meta.page.date_format === 'relative'},
simplehomepage: !{theme.post_meta.page.date_format === 'simple'},
post: !{theme.post_meta.post.date_format === 'relative'}
},
runtime: '!{theme.runtimeshow.enable ? _p("aside.card_webinfo.runtime.unit") : ""}',
date_suffix: {
just: '!{_p("date_suffix.just")}',
min: '!{_p("date_suffix.min")}',
hour: '!{_p("date_suffix.hour")}',
day: '!{_p("date_suffix.day")}',
month: '!{_p("date_suffix.month")}'
},
copyright: !{copyright},
lightbox: '!{ theme.medium_zoom ? "mediumZoom" : (theme.fancybox ? "fancybox" : "null" )}',
Snackbar: !{Snackbar},
source: {
justifiedGallery: {
js: '!{url_for(theme.asset.flickr_justified_gallery_js)}',
css: '!{url_for(theme.asset.flickr_justified_gallery_css)}'
}
},
isPhotoFigcaption: !{theme.photofigcaption},
islazyload: !{theme.lazyload.enable},
isAnchor: !{theme.anchor},
shortcutKey: !{shortcutKey},
autoDarkmode: !{theme.darkmode.enable && theme.darkmode.autoChangeMode === 1}
}

View File

@@ -0,0 +1,34 @@
-
const titleVal = pageTitle.replace(/'/ig,"\\'")
let isHighlightShrink
if (theme.highlight_shrink == 'none') isHighlightShrink = 'undefined'
else if (page.highlight_shrink === true || page.highlight_shrink === false) isHighlightShrink = page.highlight_shrink
else isHighlightShrink = theme.highlight_shrink
var showToc = false
if (theme.aside.enable && page.aside !== false) {
let tocEnable = false
if (is_post()) {
if (theme.toc.post) tocEnable = true
} else if (is_page()) {
if (theme.toc.page) tocEnable = true
}
const pageToc = page.toc === true || page.toc === false ? page.toc : tocEnable
showToc = pageToc && (toc(page.content) !== '' || page.encrypt == true )
}
-
script#config-diff.
var GLOBAL_CONFIG_SITE = {
configTitle: '!{config.title}',
title: '!{titleVal}',
postAI: '!{page.ai}',
pageFillDescription: '!{get_page_fill_description()}',
isPost: !{is_post()},
isHome: !{is_home()},
isHighlightShrink: !{isHighlightShrink},
isToc: !{showToc},
postUpdate: '!{full_date(page.updated)}',
postMainColor: '!{page.main_color}',
}

View File

@@ -0,0 +1,9 @@
if (theme.google_adsense && theme.google_adsense.enable)
script(async src=theme.google_adsense.js)
if theme.google_adsense.auto_ads
script.
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: '!{theme.google_adsense.client}',
enable_page_level_ads: '!{theme.google_adsense.enable_page_level_ads}'
});

View File

@@ -0,0 +1,14 @@
noscript.
<style type="text/css">
#nav {
opacity: 1
}
.justified-gallery img {
opacity: 1
}
#recent-posts time,
#post-meta time {
display: inline !important
}
</style>

View File

@@ -0,0 +1,39 @@
-
const { internal_provider, third_party_provider, custom_format } = theme.CDN
const providers = {
'jsdelivr': '//cdn.jsdelivr.net',
'cdnjs': '//cdnjs.cloudflare.com',
'unpkg': '//unpkg.com',
'elemecdn': '//npm.elemecdn.com',
'onmicrosoft': '//npm.onmicrosoft.cn',
'cbd': '//cdn.cbd.int',
'anheyu': '//cdn.anheyu.com',
'custom': custom_format && custom_format.match(/^((https?:)?(\/\/[^/]+)|([^/]+))(\/|$)/)[1]
}
-
if internal_provider === third_party_provider && internal_provider !== 'local'
link(rel="preconnect" href=providers[internal_provider])
else
if internal_provider !== 'local'
link(rel="preconnect" href=providers[internal_provider])
if third_party_provider !== 'local'
link(rel="preconnect" href=providers[third_party_provider])
if theme.google_analytics
link(rel="preconnect" href="//www.google-analytics.com" crossorigin='')
if theme.baidu_analytics
link(rel="preconnect" href="//hm.baidu.com")
if theme.cloudflare_analytics
link(rel="preconnect" href="//static.cloudflareinsights.com")
if theme.microsoft_clarity
link(rel="preconnect" href="//www.clarity.ms")
if theme.blog_title_font && theme.blog_title_font.font_link && theme.blog_title_font.font_link.indexOf('//fonts.googleapis.com') != -1
link(rel="preconnect" href="//fonts.googleapis.com" crossorigin='')
if !theme.asset.busuanzi && (theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv)
link(rel="preconnect" href="//busuanzi.ibruce.info")

View File

@@ -0,0 +1,59 @@
link(rel="manifest" href=url_for(theme.pwa.manifest))
if(theme.pwa.theme_color)
meta(name="msapplication-TileColor" content=theme.pwa.theme_color)
if(theme.pwa.mask_icon)
link(rel="mask-icon" href=url_for(theme.pwa.mask_icon) color="#5bbad5")
if(theme.pwa.apple_touch_icon)
link(rel="apple-touch-icon" sizes="180x180" href=url_for(theme.pwa.apple_touch_icon))
link(rel="apple-touch-icon-precomposed", sizes="180x180", href=url_for(theme.pwa.apple_touch_icon))
if(theme.pwa.favicon_32_32)
link(rel="icon" type="image/png" sizes="32x32" href=url_for(theme.pwa.favicon_32_32))
if(theme.pwa.favicon_16_16)
link(rel="icon" type="image/png" sizes="16x16" href=url_for(theme.pwa.favicon_16_16))
if(theme.pwa.bookmark_icon)
link(rel="bookmark", href=url_for(theme.pwa.bookmark_icon))
if(theme.pwa.startup_image_enable)
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2048-2732.jpg", media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2732-2048.jpg", media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1668-2388.jpg", media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2388-1668.jpg", media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1536-2048.jpg", media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2048-1536.jpg", media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1668-2224.jpg", media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2224-1668.jpg", media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1620-2160.jpg", media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2160-1620.jpg", media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1290-2796.jpg", media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2796-1290.jpg", media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1179-2556.jpg", media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2556-1179.jpg", media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1284-2778.jpg", media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2778-1284.jpg", media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1170-2532.jpg", media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2532-1170.jpg", media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1125-2436.jpg", media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2436-1125.jpg", media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1242-2688.jpg", media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2688-1242.jpg", media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-828-1792.jpg", media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1792-828.jpg", media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1242-2208.jpg", media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2208-1242.jpg", media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-750-1334.jpg", media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1334-750.jpg", media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-640-1136.jpg", media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)")
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1136-640.jpg", media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)")
//- script.
//- if ('serviceWorker' in navigator) {
//- if (navigator.serviceWorker.controller) {
//- navigator.serviceWorker.addEventListener('controllerchange', function() {
//- location.reload()
//- })
//- }
//- window.addEventListener('load', function() {
//- navigator.serviceWorker.register('/service-worker.js')
//- })
//- }

View File

@@ -0,0 +1,3 @@
if theme.site_verification
each item in theme.site_verification
meta(name=item.name content=item.content)

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -0,0 +1,91 @@
- var htmlClassHideAside = theme.aside.enable && theme.aside.hide ? 'hide-aside' : ''
- page.aside = is_archive() ? theme.aside.display.archive: is_category() ? theme.aside.display.category : is_tag() ? theme.aside.display.tag : page.aside
- var hideAside = !theme.aside.enable || page.aside === false ? 'hide-aside' : ''
- var pageType = is_post() ? 'post' : 'page'
doctype html
html(lang=config.language data-theme=theme.display_mode class=htmlClassHideAside)
head
include ./head.pug
body(data-type="anzhiyu")
#web_bg
#an_music_bg
if theme.preloader.enable
!=partial('includes/loading/index', {}, {cache: true})
if (theme.mourn.enable && is_home_first_page())
include ./mourn.pug
if page.type !== '404'
#body-wrap(class=pageType)
include ./header/index.pug
main#blog-container
if (is_home())
include ./bbTimeList.pug
if is_current("/")
include ./top/top.pug
if page.top_single
- let background = page.top_single_background
- let tip = page.top_single_tip
- let subTitle = page.top_single_subtitle
- let btn_link = page.top_single_btn_link
- let btn_text = page.top_single_btn_text
#single_top
.author-content.author-content-item.single(style=`${background ? `background: url(${background}) top / cover no-repeat;` : ""}`)
.card-content
.author-content-item-tips=subTitle
span.author-content-item-title=page.title
.content-bottom
.tips=tip
.banner-button-group
a.banner-button(onclick=`pjax.loadUrl("${url_for(btn_link ? btn_link : '/about')}")`)
i.anzhiyufont.anzhiyu-icon-arrow-circle-right(style='font-size: 1.5rem')
span.banner-button-text=btn_text ? btn_text : "关于我"
#content-inner.layout(class=hideAside)
if body
div!= body
else
block content
if theme.aside.enable && page.aside !== false
include widget/index.pug
- var footerBg = theme.footer_bg
if (footerBg)
if (footerBg === true)
- var footer_bg = bg_img
else
- var footer_bg = theme.footer_bg.indexOf('/') !== -1 ? `background-image: url('${url_for(footerBg)}')` : `background: ${footerBg}`
else
- var footer_bg = ''
footer#footer(style=footer_bg)
!=partial('includes/footer', {}, {cache: true})
if (theme.agreementPopup && theme.agreementPopup.enable && is_home_first_page())
- let agreementPopupUrl = theme.agreementPopup.url
script(defer).
var hasShownPopup = sessionStorage.getItem('sessionNegotiatePopupShown');
if (!hasShownPopup) {
setTimeout(() => {
anzhiyuPopupManager && anzhiyuPopupManager.enqueuePopup('协议提醒助手', '查看本站为你的个人隐私做出的努力', '#{agreementPopupUrl}', 4000);
sessionStorage.setItem('sessionNegotiatePopupShown', 'true');
}, 1000);
}
else
include ./404.pug
!=partial('includes/sidebar', {}, {cache: true})
if theme.shortcutKey.enable
!=partial('includes/shortcutKey', {}, {cache: true})
include ./rightside.pug
if (theme.nav_music.enable || theme.nav_music.console_widescreen_music)
include ./music.pug
!=partial('includes/third-party/search/index', {}, {cache: true})
!=partial('includes/anzhiyu/rightmenu', {}, {cache:true})
include ./additional-js.pug
//- 弹窗通知
!=partial('includes/popup/index', {}, {cache: true})

View File

@@ -0,0 +1,21 @@
- loading_img = theme.preloader.avatar ? theme.preloader.avatar : theme.avatar.img
#loading-box(onclick='document.getElementById("loading-box").classList.add("loaded")')
.loading-bg
img.loading-img(alt="加载头像" class='nolazyload' src=url_for(loading_img))
.loading-image-dot
script.
const preloader = {
endLoading: () => {
document.getElementById('loading-box').classList.add("loaded");
},
initLoading: () => {
document.getElementById('loading-box').classList.remove("loaded")
}
}
window.addEventListener('load',()=> { preloader.endLoading() })
setTimeout(function(){preloader.endLoading();},10000)
if (!{theme.pjax && theme.pjax.enable}) {
document.addEventListener('pjax:send', () => { preloader.initLoading() })
document.addEventListener('pjax:complete', () => { preloader.endLoading() })
}

View File

@@ -0,0 +1,7 @@
if theme.preloader.source === 1
include ./fullpage-loading.pug
else if theme.preloader.source === 2
include ./pace.pug
else
include ./fullpage-loading.pug
include ./pace.pug

View File

@@ -0,0 +1,2 @@
link(rel="stylesheet", href=url_for(theme.preloader.pace_css_url || theme.asset.pace_default_css))
script(async src=url_for(theme.asset.pace_js), data-pace-options='{ "restartOnRequestAfter":false,"eventLag":false}')

View File

@@ -0,0 +1,37 @@
mixin articleSort(posts, current)
.article-sort
- var year
- let modifiedUrl
- posts.each(function (article, post_index) {
- let tempYear = date(article.date, 'YYYY')
- let no_cover = article.cover === false || !theme.cover.archives_enable ? 'no-article-cover' : ''
- let title = article.title || _p('no_title')
- let pageThumbnailSuffix = theme.pageThumbnailSuffix
if (pageThumbnailSuffix && theme.pageThumbnailSuffix.startsWith("!") && article.cover && article.cover.includes("!"))
- let imageUrl = article.cover.substring(0, article.cover.indexOf("!"))
- modifiedUrl = imageUrl + pageThumbnailSuffix
else
- modifiedUrl = article.cover
if tempYear !== year
- year = tempYear
.article-sort-item.year
span= year
.article-sort-item(class=no_cover)
if article.cover && theme.cover.archives_enable
a.article-sort-item-img(href=url_for(article.path) title=title)
img(src=url_for(modifiedUrl) alt=title onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'`)
.article-sort-item-info
a.article-sort-item-title(href=url_for(article.path) title=title)= title
span.article-sort-item-index= (current - 1) * config.per_page + post_index + 1
.article-meta-wrap
if (theme.post_meta.page.tags && article.tags.data.length > 0)
span.article-sort-item-tags
each item, index in article.tags.data
a(href=url_for(item.path) tabindex="-1").article-meta__tags
span
i.anzhiyufont.anzhiyu-icon-hashtag
=item.name
.article-sort-item-time
i.anzhiyufont.anzhiyu-icon-calendar-alt
time.post-meta-date-created(datetime=date_xml(article.date) title=_p('post.created') + ' ' + full_date(article.date))= date(article.date, config.date_format)
- })

View File

@@ -0,0 +1,122 @@
- let maxDate = 0
each item in site.posts.data
if item.date > maxDate
- maxDate = item.date
mixin postUI(posts)
each article , index in page.posts.data
- let link = article.link || article.path
div(class = (index === 0 ? 'recent-post-item lastestpost-item' : 'recent-post-item') onclick=`pjax.loadUrl('${url_for(link)}')`)
-
let title = article.title || _p('no_title')
const position = theme.cover.position
let leftOrRight = position === 'both'
? index%2 == 0 ? 'left' : 'right'
: position === 'left' ? 'left' : 'right'
let post_cover = article.cover
let no_cover = article.cover === false || !theme.cover.index_enable ? 'no-cover' : ''
-
- const new_post = is_current('/') && (maxDate === article.date)
if post_cover && theme.cover.index_enable
.post_cover(class=leftOrRight)
a(href=url_for(link) title=title style='display: flex;height: 100%;')
img.post_bg(src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'` alt=title style='pointer-events: none')
.recent-post-info(class=no_cover)
.recent-post-info-top
.recent-post-info-top-tips
if (is_home() && (article.top || article.sticky > 0))
span.article-meta.sticky-warp
i.anzhiyufont.anzhiyu-icon-thumbtack.sticky
span.sticky= _p('sticky')
if (theme.post_meta.page.categories && article.categories.data.length > 0)
each item, index in article.categories.data
.article-categories-original=item.name
if new_post
span.newPost 最新
a.unvisited-post(href=url_for(link) title=title) 未读
a.article-title(href=url_for(link) title=title)= title
.article-meta-wrap
if (theme.post_meta.page.date_type)
span.post-meta-date
if (theme.post_meta.page.date_type === 'both')
i.anzhiyufont.anzhiyu-icon-calendar-alt(style=`${theme.post_meta.page.date_format==="simple" ? "display:none":""}`)
span.article-meta-label=_p('post.created')
time.post-meta-date-created(datetime=date_xml(article.date) title=_p('post.created') + ' ' + full_date(article.date) time=full_date(article.date))=date(article.date, config.date_format)
span.article-meta-separator
i.anzhiyufont.anzhiyu-icon-history(style=`font-size: 15px; ${theme.post_meta.page.date_format==="simple" ? "display:none":""}`)
span.article-meta-label=_p('post.updated')
time.post-meta-date-updated(datetime=date_xml(article.updated) title=_p('post.updated') + ' ' + full_date(article.updated) time=full_date(article.updated))=date(article.updated, config.date_format)
else
- let data_type_updated = theme.post_meta.page.date_type === 'updated'
- let date_type = data_type_updated ? 'updated' : 'date'
- let date_type_other = data_type_updated ? 'date' : 'updated'
- let date_icon = data_type_updated ? 'anzhiyu-icon-history' :'anzhiyu-icon-calendar-days'
- let date_title = data_type_updated ? _p('post.updated') : _p('post.created')
- let date_title_other = data_type_updated ? _p('post.created') : _p('post.updated')
i.anzhiyufont(class=date_icon style=`font-size: 15px; ${theme.post_meta.page.date_format==="simple" ? "display:none":""}`)
span.article-meta-label=date_title
time(datetime=date_xml(article[date_type]) title=date_title + ' ' + full_date(article[date_type]) time=full_date(article[date_type]))=date(article[date_type], config.date_format)
time(datetime=date_xml(article[date_type_other]), class="time_hidden", title=date_title_other + ' ' + full_date(article[date_type_other]) time=full_date(article[date_type_other]))=date(article[date_type_other], config.date_format)
if (theme.post_meta.page.tags && article.tags.data.length > 0)
span.article-meta.tags
each item, index in article.tags.data
a(href=url_for(item.path) event.cancelbubble onclick="window.event.cancelBubble=true;").article-meta__tags
span
i.anzhiyufont.anzhiyu-icon-hashtag
=item.name
mixin countBlockInIndex
- needLoadCountJs = true
span.article-meta
span.article-meta-separator
i.anzhiyufont.anzhiyu-icon-comments
if block
block
span.article-meta-label= ' ' + _p('card_post_count')
if theme.comments.card_post_count
case theme.comments.use[0]
when 'Valine'
+countBlockInIndex
a(href=url_for(link) + '#post-comment')
span.valine-comment-count(data-xid=url_for(link))
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
when 'Waline'
+countBlockInIndex
a(href=url_for(link) + '#post-comment')
span.waline-comment-count(id=url_for(link))
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
when 'Twikoo'
+countBlockInIndex
a.twikoo-count(href=url_for(link) + '#post-comment' tabindex="-1")
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
when 'Artalk'
+countBlockInIndex
a(href=url_for(link) + '#post-comment')
span.artalk-count(data-page-key=url_for(link))
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
//- Display the article introduction on homepage
case theme.index_post_content.method
when false
- break
when 1
.content!= article.description
when 2
if article.description
.content!= article.description
else
- const content = strip_html(article.content)
- let expert = content.substring(0, theme.index_post_content.length)
- content.length > theme.index_post_content.length ? expert += ' ...' : ''
.content!= expert
default
- const content = strip_html(article.content)
- let expert = content.substring(0, theme.index_post_content.length)
- content.length > theme.index_post_content.length ? expert += ' ...' : ''
.content!= expert
if theme.ad && theme.ad.index
if (index + 1) % 3 == 0
.recent-post-item.ads-wrap!=theme.ad.index

View File

@@ -0,0 +1,9 @@
script.
function initMourn() {
const date = new Date();
const today = (date.getMonth() + 1) + "-" + date.getDate()
const mourn_days = !{JSON.stringify(theme.mourn.days)}
if (mourn_days.includes(today)) {
document.documentElement.style.filter = "grayscale(1)";
}}
initMourn();

View File

@@ -0,0 +1,7 @@
- const nav_music_id = theme.nav_music.id
- const nav_music_server = theme.nav_music.server
- const nav_music_volume = theme.nav_music.volume
#nav-music
a#nav-music-hoverTips(onclick='anzhiyu.musicToggle()' accesskey="m") 播放音乐
#console-music-bg
meting-js(id=nav_music_id server=nav_music_server type="playlist" mutex="true" preload="none" theme="var(--anzhiyu-main)" data-lrctype="0" order="random" volume=nav_music_volume)

View File

@@ -0,0 +1,430 @@
if site.data.about
- let aboutData = site.data.about
each item in aboutData
- let subtitle = item.subtitle || config.subtitle
- let avatarImg = item.avatarImg || theme.avatar.img
- let aboutName = item.name || theme.author
- let aboutDescription = item.description || config.description
- let helloAbout = item.helloAbout
- let skillsTips = item.skillsTips
- let careers = item.careers
- let crrList = careers.list
- let crrItem = careers.item
- let avatarSkills = item.avatarSkills
#about-page
.author-box
if avatarSkills
.author-tag-left
each item in avatarSkills.left
span.author-tag=item
.author-img
img.no-lightbox(src=url_for(avatarImg) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt="avatar")
if avatarSkills
.author-tag-right
each item in avatarSkills.right
span.author-tag=item
p.p.center.logo.large 关于我
p.p.center.small=subtitle
.author-content
.author-content-item.myInfoAndSayHello
.title1 你好,很高兴认识你👋
.title2
| 我叫
span.inline-word=aboutName
.title1=aboutDescription
.aboutsiteTips.author-content-item
- let { tips, title1, title2, word } = item.aboutsiteTips
.author-content-item-tips= tips
h2
= title1
br
= title2
.mask
each wordItem, index in word
if index < word.length - 2
span(class=(index === 0 ? 'first-tips' : ''))= wordItem
span(data-up)= word[word.length - 2]
|
span(data-show)= word[word.length - 1]
.hello-about
.cursor(style='translate:none;rotate:none;scale:none;transform:translate(721px,180px)')
.shapes
.shape.shape-1(style='translate:none;rotate:none;scale:none;transform:translate(721px,180px)')
.shape.shape-2(style='translate:none;rotate:none;scale:none;transform:translate(721px,180px)')
.shape.shape-3(style='translate:none;rotate:none;scale:none;transform:translate(721px,180px)')
.content
h1=helloAbout
.author-content
.author-content-item.skills
.card-content
.author-content-item-tips=skillsTips.tips
span.author-content-item-title=skillsTips.title
.skills-style-group
include ../anzhiyu/tags-group-all.pug
if site.data.creativity
.skills-list
each i in site.data.creativity
each item, index in i.creativity_list
.skill-info
.skill-icon(style=`background: ${item.color}`)
img.no-lightbox(title=item.name, src=item.icon, alt=item.name)
.skill-name
span=item.name
.etc ...
.author-content-item.careers
.card-content
.author-content-item-tips=careers.tips
span.author-content-item-title=careers.title
.careers-group
if crrList
each career in crrList
.career-item
.circle(style=`background:${career.color ? career.color : "#357ef5"}`)
.name=career.desc
else
.careers-none
if careers.img
img.author-content-img.no-lightbox(alt=careers.tips, src=url_for(careers.img) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'`)
.author-content
if theme.LA.enable
- let cover = item.statistic.cover
.about-statistic.author-content-item(style=`background: url(${cover}) top / cover no-repeat;`)
.card-content
.author-content-item-tips 数据
span.author-content-item-title 访问统计
#statistic
.post-tips
| 统计信息来自
a(href='https://invite.51.la/1NzKqTeb?target=V6', target='_blank', rel='noopener nofollow') 51la网站统计
.banner-button-group
- let link = item.statistic.link
- let text = item.statistic.text
a.banner-button(onclick=`pjax.loadUrl("${link}")`)
i.anzhiyufont.anzhiyu-icon-arrow-circle-right
|
span.banner-button-text=text
.author-content-item-group.column.mapAndInfo
- let mapBackground = item.map.background
- let mapBackgroundDark = item.map.backgroundDark
style.
.author-content-item.map {
background-image: url(#{mapBackground});
}
[data-theme='dark'] .author-content-item.map {
background-image: url(#{mapBackgroundDark});
}
.author-content-item.map.single
- let mapTitle = item.map.title
- let mapStrengthenTitle = item.map.StrengthenTitle
span.map-title=mapTitle
b=mapStrengthenTitle
.author-content-item.selfInfo.single
- let { selfInfoTips1, selfInfoContentYear, selfInfoTips2, selfInfoContent2, selfInfoTips3, selfInfoContent3 } = item.selfInfo
div
span.selfInfo-title=selfInfoTips1
|
span.selfInfo-content#selfInfo-content-year(style='color:#43a6c6')=selfInfoContentYear
div
span.selfInfo-title=selfInfoTips2
|
span.selfInfo-content(style='color:#c69043')=selfInfoContent2
div
span.selfInfo-title=selfInfoTips3
|
span.selfInfo-content(style='color:#b04fe6')=selfInfoContent3
.author-content
.author-content-item.personalities
- let {author_name, personality_type, photo_url, personality_img, name_url, personality_type_color} = item.personalities
.author-content-item-tips 性格
span.author-content-item-title= author_name
.title2(style=`color:${personality_type_color ? personality_type_color : "#ac899c"}`)= personality_type
.post-tips
| 在
a(href='https://www.16personalities.com/', target='_blank', rel='noopener nofollow') 16personalities
| 了解更多关于
a(target='_blank', rel='noopener external nofollow', href= name_url)= author_name
.image
img.no-lightbox(src=url_for(personality_img), alt='人格')
.author-content-item.myphoto
img.author-content-img.no-lightbox(alt='自拍', src=url_for(photo_url))
.author-content
.author-content-item.maxim
- let {maxim_tips, maxim_top, maxim_bottom} = item.maxim
.author-content-item-tips=maxim_tips
span.maxim-title
span(style='opacity:.6;margin-bottom:8px')=maxim_top
|
span=maxim_bottom
.author-content-item.buff
.card-content
- let {buff_tips, buff_top, buff_bottom} = item.buff
.author-content-item-tips=buff_tips
span.buff-title
span(style='opacity:.6;margin-bottom:8px')=buff_top
|
span=buff_bottom
.card-background-icon
i.anzhiyufont.anzhiyu-icon-dice-d20
.author-content
- let {game_tips, game_title, game_uid, game_bg} = item.game
.author-content-item.game-yuanshen(style=`background: url(${game_bg}) top / cover no-repeat;`)
.card-content
.author-content-item-tips=game_tips
span.author-content-item-title=game_title
.content-bottom
.icon-group
.loading-bar(role='presentation', aria-hidden='true' style=`${game_title != "原神" ? "display: none": ""}`)
.tips.game-yuanshen-uid=game_uid
.author-content-item.comic-content
.card-content
- let {comic_tips, comic_title, comic_list} = item.comic
.author-content-item-tips=comic_tips
.author-content-item-title=comic_title
.comic-box
if comic_list
each i in comic_list
a.comic-item(href=i.href, target="_blank", title=i.name)
.comic-item-cover
img(src=i.cover, alt=i.name)
.author-content
- let {music_tips, music_title, music_link, music_bg} = item.music
- let {like_tips, like_title, like_bottom, like_bg} = item.like
.author-content-item.like-technology(style=`background: url(${like_bg}) top / cover no-repeat;`)
.card-content
.author-content-item-tips=like_tips
span.author-content-item-title=like_title
.content-bottom
.tips=like_bottom
.author-content-item.like-music(style=`background: url(${music_bg}) top / cover no-repeat;`)
.card-content
.author-content-item-tips=music_tips
span.author-content-item-title=music_title
.content-bottom
.tips=`跟 ${aboutName} 一起欣赏更多音乐`
.banner-button-group
a.banner-button(onclick=`pjax.loadUrl("${music_link}")`)
i.anzhiyufont.anzhiyu-icon-arrow-circle-right
|
span.banner-button-text 更多推荐
if page.content
.author-content
.create-site-post.author-content-item.single
!= page.content
- let rawData = item.reward_list
if rawData
- let sortedByDate = rawData.slice().sort((a, b) => new Date(b.datatime) - new Date(a.datatime));
.author-content
.author-content-item.single.reward#about-reward
.author-content-item-tips 致谢
span.author-content-item-title 赞赏名单
.author-content-item-description 感谢因为有你们,让我更加有创作的动力。
.reward-list-all
- let reward_list_amount = item.reward_list.sort((a,b)=>b.amount - a.amount)
each item, index in reward_list_amount
.reward-list-item
.reward-list-item-name=item.name
.reward-list-bottom-group
if item.amount >= 50
.reward-list-item-money(style='background:var(--anzhiyu-yellow)')=`¥${item.amount}`
else
.reward-list-item-money=`¥${item.amount + (item.suffix ? item.suffix : "")}`
.datatime.reward-list-item-time(datatime=item.datatime)=new Date(item.datatime).toISOString().slice(0, -14)
.reward-list-updateDate
| 最新更新时间:
time.datatime.reward-list-updateDate-time(datatime=sortedByDate[0].datatime)=new Date(sortedByDate[0].datatime).toISOString().slice(0, -14)
.about-reward
#con
#TA-con(onclick="anzhiyu.rewardShowConsole()")
#text-con
#linght
#TA 为TA充电
#tube-con
svg(viewBox='0 0 1028 385', fill='none', xmlns='http://www.w3.org/2000/svg')
path(d='M1 77H234.226L307.006 24H790', stroke='#e5e9ef', stroke-width='20')
path(d='M0 140H233.035L329.72 71H1028', stroke='#e5e9ef', stroke-width='20')
path(d='M1 255H234.226L307.006 307H790', stroke='#e5e9ef', stroke-width='20')
path(d='M0 305H233.035L329.72 375H1028', stroke='#e5e9ef', stroke-width='20')
rect(y='186', width='236', height='24', fill='#e5e9ef')
ellipse(cx='790', cy='25.5', rx='25', ry='25.5', fill='#e5e9ef')
circle(r='14', transform='matrix(1 0 0 -1 790 25)', fill='white')
ellipse(cx='790', cy='307.5', rx='25', ry='25.5', fill='#e5e9ef')
circle(r='14', transform='matrix(1 0 0 -1 790 308)', fill='white')
#mask
svg(viewBox='0 0 1028 385', fill='none', xmlns='http://www.w3.org/2000/svg')
path(d='M1 77H234.226L307.006 24H790', stroke='#f25d8e', stroke-width='20')
path(d='M0 140H233.035L329.72 71H1028', stroke='#f25d8e', stroke-width='20')
path(d='M1 255H234.226L307.006 307H790', stroke='#f25d8e', stroke-width='20')
path(d='M0 305H233.035L329.72 375H1028', stroke='#f25d8e', stroke-width='20')
rect(y='186', width='236', height='24', fill='#f25d8e')
ellipse(cx='790', cy='25.5', rx='25', ry='25.5', fill='#f25d8e')
circle(r='14', transform='matrix(1 0 0 -1 790 25)', fill='white')
ellipse(cx='790', cy='307.5', rx='25', ry='25.5', fill='#f25d8e')
circle(r='14', transform='matrix(1 0 0 -1 790 308)', fill='white')
#orange-mask
svg(viewBox='0 0 1028 385', fill='none', xmlns='http://www.w3.org/2000/svg')
path(d='M1 77H234.226L307.006 24H790', stroke='#ffd52b', stroke-width='20')
path(d='M0 140H233.035L329.72 71H1028', stroke='#ffd52b', stroke-width='20')
path(d='M1 255H234.226L307.006 307H790', stroke='#ffd52b', stroke-width='20')
path(d='M0 305H233.035L329.72 375H1028', stroke='#ffd52b', stroke-width='20')
rect(y='186', width='236', height='24', fill='#ffd52b')
ellipse(cx='790', cy='25.5', rx='25', ry='25.5', fill='#ffd52b')
circle(r='14', transform='matrix(1 0 0 -1 790 25)', fill='white')
ellipse(cx='790', cy='307.5', rx='25', ry='25.5', fill='#ffd52b')
circle(r='14', transform='matrix(1 0 0 -1 790 308)', fill='white')
p#people
| 共
b=item.reward_list.length
| 人
script(src=url_for(theme.asset.countup_js))
- const ck = theme.LA.ck
script(defer).
function initAboutPage() {
fetch("https://v6-widget.51.la/v6/#{ck}/quote.js")
.then(res => res.text())
.then(data => {
let title = ["最近活跃", "今日人数", "今日访问", "昨日人数", "昨日访问", "本月访问", "总访问量"];
let num = data.match(/(<\/span><span>).*?(\/span><\/p>)/g);
num = num.map(el => {
let val = el.replace(/(<\/span><span>)/g, "");
let str = val.replace(/(<\/span><\/p>)/g, "");
return str;
});
let statisticEl = document.getElementById("statistic");
// 自定义不显示哪个或者显示哪个,如下为不显示 最近活跃访客 和 总访问量
let statistic = [];
for (let i = 0; i < num.length; i++) {
if (!statisticEl) return;
if (i == 0) continue;
statisticEl.innerHTML +=
"<div><span>" + title[i] + "</span><span id=" + title[i] + ">" + num[i] + "</span></div>";
queueMicrotask(() => {
statistic.push(
new CountUp(title[i], 0, num[i], 0, 2, {
useEasing: true,
useGrouping: true,
separator: ",",
decimal: ".",
prefix: "",
suffix: "",
})
);
});
}
let statisticElement = document.querySelector(".about-statistic.author-content-item");
function statisticUP() {
if (!statisticElement) return;
const callback = (entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
for (let i = 0; i < num.length; i++) {
if (i == 0) continue;
queueMicrotask(() => {
statistic[i - 1].start();
});
}
observer.disconnect(); // 停止观察元素,因为不再需要触发此回调
}
});
};
const options = {
root: null,
rootMargin: "0px",
threshold: 0
};
const observer = new IntersectionObserver(callback, options);
observer.observe(statisticElement);
}
const selfInfoContentYear = new CountUp("selfInfo-content-year", 0, #{selfInfoContentYear}, 0, 2, {
useEasing: true,
useGrouping: false,
separator: ",",
decimal: ".",
prefix: "",
suffix: "",
});
let selfInfoContentYearElement = document.querySelector(".author-content-item.selfInfo.single");
function selfInfoContentYearUp() {
if (!selfInfoContentYearElement) return;
const callback = (entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
selfInfoContentYear.start();
observer.disconnect(); // 停止观察元素,因为不再需要触发此回调
}
});
};
const options = {
root: null,
rootMargin: "0px",
threshold: 0
};
const observer = new IntersectionObserver(callback, options);
observer.observe(selfInfoContentYearElement);
}
selfInfoContentYearUp();
statisticUP()
});
var pursuitInterval = null;
pursuitInterval = setInterval(function () {
const show = document.querySelector("span[data-show]");
const next = show.nextElementSibling || document.querySelector(".first-tips");
const up = document.querySelector("span[data-up]");
if (up) {
up.removeAttribute("data-up");
}
show.removeAttribute("data-show");
show.setAttribute("data-up", "");
next.setAttribute("data-show", "");
}, 2000);
document.addEventListener("pjax:send", function () {
pursuitInterval && clearInterval(pursuitInterval);
});
var helloAboutEl = document.querySelector(".hello-about");
helloAboutEl.addEventListener("mousemove", evt => {
const mouseX = evt.offsetX;
const mouseY = evt.offsetY;
gsap.set(".cursor", {
x: mouseX,
y: mouseY,
});
gsap.to(".shape", {
x: mouseX,
y: mouseY,
stagger: -0.1,
});
});
}
if (typeof gsap === "object") {
initAboutPage()
} else {
getScript("!{url_for(theme.asset.gsap_js)}").then(initAboutPage);
}

View File

@@ -0,0 +1,22 @@
#album
- let album_background = page.top_background
.author-content.author-content-item.album.single(style=`${album_background ? `background: url(${album_background}) top / cover no-repeat;` : ""}`)
.card-content
.author-content-item-tips 相册集
span.author-content-item-title 这里是我的相册集哦😯
.content-bottom
.tips 每一张照片都是一次美好的记忆。
.banner-button-group
a.banner-button(onclick='pjax.loadUrl("/about/")')
i.anzhiyufont.anzhiyu-icon-arrow-circle-right(style='font-size: 1.5rem')
span.banner-button-text 关于本人
.card-album
each i in site.data.album
.card(onclick=`pjax.loadUrl("${i.path_name}")`)
img.card_cover(src=i.cover)
.card__content
p.card__category=i.class_name
h3.card__heading=i.description
.album-content-nocover
.album-content-nocover
.album-content-nocover

View File

@@ -0,0 +1,89 @@
#album_detail
each i in site.data.album
- let path_name = (is_current(i.path_name)) ? true : false
- type = i.type
- let album_detail_background = i.top_background
- let album_detail_top_link = i.top_link
- let album_detail_top_btn_text = i.top_btn_text
if (path_name && i.album_list)
.author-content.author-content-item.album.single(style=`${album_detail_background ? `background: url(${album_detail_background}) top / cover no-repeat;` : ""}`)
.card-content
.author-content-item-tips 相册集
span.author-content-item-title=i.class_name
.content-bottom
.tips=i.description
.banner-button-group
a.banner-button(onclick=`pjax.loadUrl("${url_for(album_detail_top_link ? album_detail_top_link : '/about')}")`, data-pjax-state)
i.anzhiyufont.anzhiyu-icon-arrow-circle-right(style='font-size: 1.5rem')
span.banner-button-text=album_detail_top_btn_text ? album_detail_top_btn_text : "关于我"
section.timeline.page-1
if type == 1
ul#waterfall.list
each item, index in i.album_list
li.album-item
.album-content
p.datacont= item.content
if item.image
.album-container-img
each iten, indey in item.image
a.album-content-img(href=item.image[indey], target="_blank", data-fancybox="gallery", data-caption="")
img(src=item.image[indey])
.album-content-noimg
.album-content-noimg
.album-content-noimg
if item.aplayer
.album-music
.aplayer.no-destroy(data-id=item.aplayer.id data-server=item.aplayer.server data-type="song" data-order="list" data-preload="none" data-autoplay="false" data-mutex="true" data-theme='var(--anzhiyu-main)')
hr
.album-bottom
.album-info
.album-info-time
- var datedata = new Date(item.date).toISOString()
i.anzhiyufont.anzhiyu-icon-instagram
time.datatime(datetime= item.date)= datedata
if item.link
a.album-content-link(target="_blank", title="跳转到短文指引的链接", href=item.link, rel="external nofollow")
i.anzhiyufont.anzhiyu-icon-link
| 链接
if item.address
.album-info-address
i.anzhiyufont.anzhiyu-icon-location-dot
span=item.address
if item.from
.album-info-from
i.anzhiyufont.anzhiyu-icon-fw-fire
span=item.from
.album-reply(onclick="rm.rightMenuCommentText(" + `'${item.content}'` + ")")
i.anzhiyufont.anzhiyu-icon-message
else if type == 2
.type-gallery
- const rowHeight = i.rowHeight != "undefined" ? i.rowHeight : 220
- const limit = i.limit != "undefined" ? i.limit : 10
- const lazyload = i.lazyload != "undefined" ? i.lazyload : true
- const lazyloadClass = lazyload == true ? "lazyload" : "";
- const btn = i.btnLazyload != "undefined" ? i.btnLazyload : false
- const btnLazyloadClass = btn == true ? " btn_album_detail_lazyload" : "";
- const imgType = i.url ? " url" : " data";
- let dataStr = []
- let durl = i.url ?? false
each item, index in i.album_list
each iten, indey in item.image
- let obj = {}
- obj.url = iten
- obj.alt = item.content
- obj.title = item.content
- obj.address = item.address
- dataStr.push(obj)
.gallery
.fj-gallery(data-rowHeight=rowHeight data-limit=limit class=`${lazyloadClass + btnLazyloadClass + imgType}`)
if durl
span.gallery-data=durl
else
span.gallery-data=JSON.stringify(dataStr)
if btn
button.gallery-load-more
span=_p('load_more')
i.anzhiyufont.anzhiyu-icon-arrow-down
else
#album_detail_gallery_load_more

View File

@@ -0,0 +1,2 @@
#tag
.category-lists#tag-page-tags!= tags_page_list("categories")

View File

@@ -0,0 +1,2 @@
#article-container
!= page.content

View File

@@ -0,0 +1,32 @@
#equipment
if site.data.equipment
each i in site.data.equipment
.author-content.author-content-item.fcirclePage.single(style = `background: url(${i.top_background}) left 37% / cover no-repeat !important;`)
.card-content
.author-content-item-tips=i.class_name
span.author-content-item-title=i.description
.content-bottom
.tips=i.tip
each item in i.good_things
.goodthings-item
h2.goodthings-title= item.title
.goodthings-item-description= item.description
.equipment-item
.equipment-item-content
each iten, indey in item.equipment_list
.equipment-item-content-item
.equipment-item-content-item-cover
img.equipment-item-content-item-image(data-lazy-src=url_for(iten.image) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=iten.name)
.equipment-item-content-item-info
.equipment-item-content-item-name(onclick=`rm.rightmenuCopyText("${iten.name}");anzhiyu.snackbarShow("${_p('Snackbar.copy_equipment_name') + " 【" + iten.name + "】"}");` title=iten.name)= iten.name
.equipment-item-content-item-specification= iten.specification
.equipment-item-content-item-description= iten.description
.equipment-item-content-item-toolbar
if iten.link.includes('https://') || iten.link.includes('http://')
a.equipment-item-content-item-link(href= iten.link, target='_blank') 详情
.bber-reply(onclick="rm.rightMenuCommentText(" + `'${iten.name + " " + iten.specification + " " + iten.description}'` + ")")
i.anzhiyufont.anzhiyu-icon-message
else
a.equipment-item-content-item-link(href= iten.link, target='_blank') 查看文章
.bber-reply(onclick="rm.rightMenuCommentText(" + `'${iten.name + " " + iten.specification + " " + iten.description}'` + ")")
i.anzhiyufont.anzhiyu-icon-message

View File

@@ -0,0 +1,67 @@
if site.data.essay
each i in site.data.essay
#essay_page
.author-content.author-content-item.essayPage.single(style = i.top_background ? `background: url(${i.top_background}) left 28% / cover no-repeat;` : "")
.card-content
.author-content-item-tips=i.title
span.author-content-item-title=i.subTitle
.content-bottom
.tips=i.tips
.banner-button-group
a.banner-button(href=i.buttonLink)
i.anzhiyufont.anzhiyu-icon-arrow-circle-right
span.banner-button-text=i.buttonText
#bber
section.timeline.page-1
ul#waterfall.list
each item, index in i.essay_list
if index < i.limit
li.bber-item
.bber-content
p.datacont= item.content
if item.image
.bber-container-img
each iten, indey in item.image
a.bber-content-img(href=url_for(item.image[indey]), target="_blank", data-fancybox="gallery", data-caption="")
img(src=url_for(item.image[indey]))
.bber-content-noimg
.bber-content-noimg
.bber-content-noimg
if item.video
.bber-container-img
each iten, indey in item.video
if (item.video[indey].includes('player.bilibili.com'))
div(style="position: relative; padding: 30% 45%;margin-top: 10px;margin-bottom: 10px;")
iframe(style="position: absolute; width: 100%; height: 100%; left: 0; top: 0;margin: 0;border-radius: 12px;border: var(--style-border);" src=url_for(item.video[indey]) scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true")
else
a.bber-content-video(href=url_for(item.video[indey]) data-fancybox="gallery", data-caption="")
video(src=url_for(item.video[indey]))
.bber-content-noimg
.bber-content-noimg
.bber-content-noimg
if item.aplayer
.bber-music
meting-js(id=item.aplayer.id, server=item.aplayer.server, type="song", mutex="true",preload="none", theme="var(--anzhiyu-main)", data-lrctype="0", order="list")
hr
.bber-bottom
.bber-info
.bber-info-time
- var datedata = new Date(item.date).toISOString()
i.anzhiyufont.anzhiyu-icon-clock
time.datatime(datetime= item.date)= datedata
if item.link
a.bber-content-link(title="跳转到短文指引的链接", href=url_for(item.link), rel="external nofollow")
i.anzhiyufont.anzhiyu-icon-link
| 链接
if item.from
.bber-info-from
i.anzhiyufont.anzhiyu-icon-fw-fire
span=item.from
if item.address
.bber-info-from
i.anzhiyufont.anzhiyu-icon-location-dot
span=item.address
.bber-reply(onclick="rm.rightMenuCommentText(" + `'${item.content}'` + ")")
i.anzhiyufont.anzhiyu-icon-message
#bber-tips(style='color: var(--anzhiyu-secondtext);')
="- 只展示最近" + i.limit + "条短文 -"

View File

@@ -0,0 +1,25 @@
if theme.friends_vue.enable
.fcircle_page
.author-content.author-content-item.fcirclePage.single(style = `background: url(${theme.friends_vue.top_background}) left 28% / cover no-repeat !important;`)
.card-content
.author-content-item-tips 友链
span.author-content-item-title 最新文章订阅
.content-bottom
.tips=theme.friends_vue.top_tips
.banner-button-group
a.banner-button(onclick='pjax.loadUrl("/about")')
i.anzhiyufont.anzhiyu-icon-arrow-circle-right(style='font-size: 22px; margin-right: 0.25rem')
span.banner-button-text 关于本人
.title-h2-a
.title-h2-a-left
h2(style='padding-top:0;margin:.6rem 0 .6rem') 🎣 钓鱼
a.random-post-start(href='javascript:fetchRandomPost();')
i.anzhiyufont.anzhiyu-icon-arrow-rotate-right
.title-h2-a-right
a.random-post-all(href='/link/') 全部友链
#random-post
#hexo-circle-of-friends-root
if (theme.friends_vue.apiurl)
script(defer data-pjax src=url_for(theme.asset.random_friends_post_js))
script(defer data-pjax src=url_for(theme.friends_vue.vue_js))

View File

@@ -0,0 +1,131 @@
#article-container
if theme.linkPageTop && theme.linkPageTop.enable
#flink-banners
.banner-top-box
.flink-banners-title
.banners-title-small 友情链接
.banners-title-big=theme.linkPageTop ? theme.linkPageTop.title : "与数百名博主无限进步"
.banner-button-group
if (theme.friends_vue.apiurl)
a.banner-button.secondary.no-text-decoration(onclick="friendChainRandomTransmission()")
i.anzhiyufont.anzhiyu-icon-paper-plane1
span.banner-button-text 随机访问
if theme.linkPageTop.addFriendPlaceholder && theme.comments.use == 'Twikoo' && theme.twikoo.envId
a.banner-button.no-text-decoration(onclick="anzhiyu.addFriendLink()")
i.anzhiyufont.anzhiyu-icon-arrow-circle-right
span.banner-button-text 申请友链
#skills-tags-group-all
.tags-group-wrapper
- function getAvatarWithoutExclamationMark(url) {
- const index = url.indexOf('!');
- return index !== -1 ? url.substring(0, index) : url;
- }
each y in [1,2]
each i, index in site.data.link.slice(0, 15)
- const link_list = i.link_list.slice()
- const hundredSuffix = i.hundredSuffix ? i.hundredSuffix : ""
- const evenNum = link_list.filter((x, index) => index % 2 === 0);
- const oddNum = link_list.filter((x, index) => index % 2 === 1);
each item, index2 in link_list.slice(0, Math.min(evenNum.length, oddNum.length))
- const index = index2 * 2
if (index <= 15 && typeof evenNum[index] !== 'undefined' && typeof oddNum[index] !== 'undefined')
- let oddNumAvatar = getAvatarWithoutExclamationMark(oddNum[index].avatar);
- let evenNumAvatar = getAvatarWithoutExclamationMark(evenNum[index].avatar);
.tags-group-icon-pair
a.tags-group-icon.no-text-decoration(href=url_for(evenNum[index].link), title=evenNum[index].name)
img.no-lightbox(title=evenNum[index].name, src=url_for(evenNumAvatar + hundredSuffix) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=evenNum[index].name)
a.tags-group-icon.no-text-decoration(href=url_for(oddNum[index].link), title=oddNum[index].name)
img.no-lightbox(title=oddNum[index].name, src=url_for(oddNumAvatar + hundredSuffix) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=oddNum[index].name)
.title-h2-a
.title-h2-a-left
h2(style='padding-top:0;margin:.6rem 0 .6rem') 🎣 钓鱼
a.random-post-start.no-text-decoration(href='javascript:fetchRandomPost();')
i.anzhiyufont.anzhiyu-icon-arrow-rotate-right
.title-h2-a-right
a.random-post-all.no-text-decoration(href='/link/') 全部友链
#random-post
script(defer data-pjax src=url_for(theme.asset.random_friends_post_js))
.flink
if site.data.link
each i in site.data.link
if i.class_name
h2!= i.class_name + "(" + i.link_list.length + ")"
if i.class_desc
.flink-desc!=i.class_desc
if i.flink_style === 'anzhiyu'
div(class=i.lost_contact ? 'anzhiyu-flink-list cf-friends-lost-contact' : 'anzhiyu-flink-list')
if i.link_list
each item in i.link_list
- let color = item.color || ""
- let tag = item.tag || ""
.flink-list-item
if color == "vip" && tag
span.site-card-tag.vip #[=tag]
i.light
else if color == "speed" && tag
span.site-card-tag.speed #[=tag]
else if tag
span.site-card-tag(style=`background-color: ${color}`) #[=tag]
else if item.recommend
span.site-card-tag 荐
if i.lost_contact
a.cf-friends-link(href=url_for(item.link) title=item.name target="_blank")
if theme.lazyload.enable
img.no-lightbox(data-lazy-src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name )
else
img.cf-friends-avatar.no-lightbox(src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name )
.flink-item-info
.flink-item-name.cf-friends-name-lost-contact= item.name
else
a.cf-friends-link(href=url_for(item.link) cf-href=url_for(item.link) title=item.name target="_blank")
if theme.lazyload.enable
img.cf-friends-avatar.no-lightbox(data-lazy-src=url_for(item.avatar), cf-src=url_for(item.avatar), onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name )
else
img.cf-friends-avatar.no-lightbox(src=url_for(item.avatar) cf-src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name )
.flink-item-info
.flink-item-name.cf-friends-name= item.name
.flink-item-desc(title=item.descr)= item.descr
else if i.flink_style === 'telescopic'
.telescopic-site-card-group
each item in i.link_list
- let color = item.color || ""
- let tag = item.tag || ""
- let siteshot = item.siteshot || `https://image.thum.io/get/width/400/crop/800/allowJPG/wait/20/noanimate/${item.link}` || theme.default_img
.site-card
if color == "vip" && tag
span.site-card-tag.vip #[=tag]
i.light
else if color == "speed" && tag
span.site-card-tag.speed #[=tag]
else if tag
span.site-card-tag(style=`background-color: ${color}`) #[=tag]
else if item.recommend
span.site-card-tag 荐
a.img.no-text-decoration(target='_blank', title=`${item.name}`, href=`${item.link}`, rel='external nofollow')
img.flink-avatar(data-lazy-src=siteshot, onerror=`this.onerror=null;this.src='${theme.default_img}'`, alt=item.name, style="pointer-events: none;", src=`${siteshot}`)
a.info.cf-friends-link.no-text-decoration(target='_blank', title=`${item.name}`, href=`${item.link}`, cf-href=url_for(item.link), rel='external nofollow')
.site-card-avatar
img.flink-avatar.cf-friends-avatar.no-fancybox(data-lazy-src=item.avatar, cf-src=url_for(item.avatar), onerror=`this.onerror=null;this.src='${theme.default_img}'`, alt=item.name, src=item.avatar)
.site-card-text
span.title.cf-friends-name #[=item.name]
span.desc(title=`${item.descr}`) #[=item.descr]
else if i.flink_style === 'flexcard'
.flexcard-flink-list
each item in i.link_list
a.flink-list-card.cf-friends-link(href=url_for(item.link) cf-href=url_for(item.link) target='_blank' data-title=item.descr)
.wrapper.cover
- var siteshot = item.siteshot ? url_for(item.siteshot) : 'https://image.thum.io/get/width/400/crop/800/allowJPG/wait/20/noanimate/' + item.link
if theme.lazyload.enable
img.cover.fadeIn(data-lazy-src=siteshot onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.post_page) + `'` alt='cover' )
else
img.cover.fadeIn(src=siteshot onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.post_page) + `'` alt='cover' )
.info
if theme.lazyload.enable
img.cf-friends-avatar.no-lightbox.flink-avatar(data-lazy-src=url_for(item.avatar) cf-src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt='cover' )
else
img.cf-friends-avatar.no-lightbox(src=url_for(item.avatar) cf-src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt='cover' )
span.flink-sitename.cf-friends-name= item.name
!= page.content

View File

@@ -0,0 +1,8 @@
#anMusic-page
#anMusicBtnGetSong(title="随机周董单曲,打开异世界的大梦")
i(class="anzhiyufont anzhiyu-icon-shuffle")
#anMusicRefreshBtn(title="立即刷新最新歌单")
i(class="anzhiyufont anzhiyu-icon-arrows-rotate")
#anMusicSwitching(title="切换歌单")
i(class="anzhiyufont anzhiyu-icon-repeat")
#anMusic-page-meting

View File

@@ -0,0 +1,278 @@
#room_page
div.house#h
div.h-lights
div.h-light
div.h-light
div.h-light
div.h-light
div.h-light
div.h-light
div.h-shadow
//---------------------
div.alt
div.alt__front.face
div.alt__back.face
div.alt__right.face
div.alt__left.face
div.alt__top.face
div.light
div.light
div.light
div.light
div.light
div.light
div.light
div.light
div.light
div.alt__bottom.face
div.alb
div.alb__front.face
div.alb__back.face
div.alb__right.face
div.alb__left.face
div.alb__top.face
div.alb__bottom.face
div.arb
div.arb__front.face
div.arb__back.face
div.arb__right.face
div.arb__left.face
div.arb__top.face
div.arb__bottom.face
//---------------------
div.blt
div.blt__front.face
div.blt__back.face
div.blt__right.face
div.blt__left.face
div.blt__top.face
div.blt__bottom.face
div.blt2
div.blt2__front.face
div.blt2__back.face
div.blt2__right.face
div.blt2__left.face
div.blt2__top.face
div.blt2__bottom.face
div.blb
div.blb__front.face
div.blb__back.face
div.blb__right.face
div.blb__left.face
div.blb__top.face
div.blb__bottom.face
div.blb2
div.blb2__front.face
div.blb2__back.face
div.blb2__right.face
div.blb2__left.face
div.blb2__top.face
div.blb2__bottom.face
//---------------------
div.puerta-c
div.puerta
div.puerta__front.face
div.puerta__back.face
div.puerta__right.face
div.puerta__left.face
div.puerta__top.face
div.puerta__bottom.face
div.puerta-l
div.puerta-l__front.face
div.puerta-l__back.face
div.puerta-l__right.face
div.puerta-l__left.face
div.puerta-l__top.face
div.puerta-l__bottom.face
div.puerta-r
div.puerta-r__front.face
div.puerta-r__back.face
div.puerta-r__right.face
div.puerta-r__left.face
div.puerta-r__top.face
div.puerta-r__bottom.face
div.puerta-t
div.puerta-t__front.face
div.puerta-t__back.face
div.puerta-t__right.face
div.puerta-t__left.face
div.puerta-t__top.face
div.puerta-t__bottom.face
div.cuadro-l
div.cuadro-l__front.face
div.cuadro-l__back.face
div.cuadro-l__right.face
div.cuadro-l__left.face
div.cuadro-l__top.face
div.cuadro-l__bottom.face
div.cuadro-r
div.cuadro-r__front.face
div.cuadro-r__back.face
div.cuadro-r__right.face
div.cuadro-r__left.face
div.cuadro-r__top.face
div.cuadro-r__bottom.face
div.librero
div.librero__front.face
div.librero__back.face
div.librero__right.face
div.librero__left.face
div.librero__top.face
div.librero__bottom.face
div.libros
- let lb = 0
while lb < 6
div.libro
div.libro__front.face
div.libro__back.face
div.libro__right.face
div.libro__left.face
div.libro__top.face
div.libro__bottom.face
- lb++
div.fotos
- let ft = 0
while ft < 2
div.foto
div.foto__front.face
div.foto__back.face
div.foto__right.face
div.foto__left.face
div.foto__top.face
div.foto__bottom.face
- ft++
div.cajas
- let cj = 0
while cj < 3
div.caja
div.caja__front.face
div.caja__back.face
div.caja__right.face
div.caja__left.face
div.caja__top.face
div.caja__bottom.face
- cj++
div.tv
div.tv__front.face
div.tv__back.face
div.tv__right.face
div.tv__left.face
div.tv__top.face
div.tv__bottom.face
div.repisa-t
div.repisa-t__front.face
div.repisa-t__back.face
div.repisa-t__right.face
div.repisa-t__left.face
div.repisa-t__top.face
div.repisa-t__bottom.face
div.repisa-b
div.repisa-b__front.face
div.repisa-b__back.face
div.repisa-b__right.face
div.repisa-b__left.face
div.repisa-b__top.face
div.repisa-b__bottom.face
div.bocina-l
div.bocina-l__front.face
div.bocina-l__back.face
div.bocina-l__right.face
div.bocina-l__left.face
div.bocina-l__top.face
div.bocina-l__bottom.face
div.bocina-r
div.bocina-r__front.face
div.bocina-r__back.face
div.bocina-r__right.face
div.bocina-r__left.face
div.bocina-r__top.face
div.bocina-r__bottom.face
div.muro
div.muro__front.face
div.muro__back.face
div.muro__right.face
div.muro__left.face
div.muro__top.face
div.muro__bottom.face
div.sillon-c
div.sillon-b
div.sillon-b__front.face
div.sillon-b__back.face
div.sillon-b__right.face
div.sillon-b__left.face
div.sillon-b__top.face
div.sillon-b__bottom.face
div.sillon-t
div.sillon-t__front.face
div.sillon-t__back.face
div.sillon-t__right.face
div.sillon-t__left.face
div.sillon-t__top.face
div.sillon-t__bottom.face
div.sillon-l
div.sillon-l__front.face
div.sillon-l__back.face
div.sillon-l__right.face
div.sillon-l__left.face
div.sillon-l__top.face
div.sillon-l__bottom.face
div.sillon-r
div.sillon-r__front.face
div.sillon-r__back.face
div.sillon-r__right.face
div.sillon-r__left.face
div.sillon-r__top.face
div.sillon-r__bottom.face
div.mesa-c
div.mesa
div.mesa__front.face
div.mesa__back.face
div.mesa__right.face
div.mesa__left.face
div.mesa__top.face
div.mesa__bottom.face
- let np = 0
while np < 4
div.mesa-p
div.mesa-p__front.face
div.mesa-p__back.face
div.mesa-p__right.face
div.mesa-p__left.face
div.mesa-p__top.face
div.mesa-p__bottom.face
- np++
div.mesa-shadow
div.tablet
div.tablet__front.face
div.tablet__back.face
div.tablet__right.face
div.tablet__left.face
div.tablet__top.face
div.tablet__bottom.face
.description
span 哇,被你发现了,这里是我的小房间,要一起玩游戏🎮嘛
.banner-button-group
a.banner-button(onclick='pjax.loadUrl("/about/")')
i.anzhiyufont.anzhiyu-icon-arrow-circle-right(style='font-size: 1.5rem')
span.banner-button-text 立刻玩
script(async).
const h = document.querySelector("#h");
const b = document.body;
let base = e => {
var x = e.pageX / window.innerWidth - 0.5;
var y = e.pageY / window.innerHeight - 0.5;
h.style.transform = `
perspective(90vw)
rotateX(${y * 4 + 75}deg)
rotateZ(${-x * 12 + 45}deg)
translateZ(-9vw)
translateX(-50%)
`;
};
b.addEventListener("pointermove", base);

View File

@@ -0,0 +1,4 @@
.tag-cloud-list.is-center
#tag
#tag-page-tags
!=tags_page_list("tags")

View File

@@ -0,0 +1,42 @@
-
var options = {
prev_text: '<i class="anzhiyufont anzhiyu-icon-chevron-left fa-fw" style="font-weight: inherit; font-size: 1rem;"></i><div class="pagination_tips_prev">上页</div>',
next_text: '<div class="pagination_tips_next">下页</div><i style="font-weight: inherit; font-size: 1rem;" class="anzhiyufont anzhiyu-icon-chevron-right fa-fw"></i>',
mid_size: 1,
escape: false
}
if is_post()
- let prev = theme.post_pagination === 1 || theme.post_pagination === 3 || theme.post_pagination === 4 ? page.prev : page.next
- let next = theme.post_pagination === 1 || theme.post_pagination === 3 || theme.post_pagination === 4 ? page.next : page.prev
nav#pagination.pagination-post
if(prev)
- var hasPageNext = next ? 'pull-left' : 'pull-full'
.prev-post(class=hasPageNext)
- var pagination_cover = prev.cover === false ? prev.randomcover : prev.cover
a(href=url_for(prev.path))
img.prev-cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` alt='cover of previous post')
.pagination-info
.label=_p('pagination.prev')
.prev_info=prev.title
if(next)
- var hasPagePrev = prev ? 'pull-right' : 'pull-full'
- var pagination_cover = next.cover == false ? next.randomcover : next.cover
.next-post(class=hasPagePrev)
a(href=url_for(next.path))
img.next-cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` alt='cover of next post')
.pagination-info
.label=_p('pagination.next')
.next_info=next.title
else
nav#pagination
.pagination
if is_home()
- options.format = 'page/%d/#content-inner'
!=paginator(options)
if is_home()
div(class="toPageGroup")
input(id="toPageText" oninput="value=value.replace(/[^0-9]/g,'')" maxlength="3" onkeyup="this.value=this.value.replace(/[^u4e00-u9fa5w]/g,'')" aria-label="toPage")
a(id="toPageButton" onclick="anzhiyu.toPage()")
i.anzhiyufont.anzhiyu-icon-angles-right(style="font-weight: inherit; font-size: 1rem;")

View File

@@ -0,0 +1,7 @@
#popup-window
.popup-window-title 通知
.popup-window-divider
.popup-window-content
.popup-tip 你好呀
.popup-link
i.anzhiyufont.anzhiyu-icon-arrow-circle-right

View File

@@ -0,0 +1,63 @@
if theme.post_copyright.enable && page.copyright !== false
- let author = page.copyright_author || config.author
- let url = page.copyright_url || page.permalink
- let info = page.copyright_info || _p('post.copyright.copyright_content', theme.post_copyright.license_url, theme.post_copyright.license, config.url, config.title)
.post-copyright
.copyright-cc-box
i.anzhiyufont.anzhiyu-icon-copyright
.post-copyright__author_box
- let copyright_author_img_back = theme.post_copyright.copyright_author_img_back ? theme.post_copyright.copyright_author_img_back : theme.avatar.img
- let copyright_author_img_front = theme.post_copyright.copyright_author_img_front ? theme.post_copyright.copyright_author_img_front : theme.avatar.img
- let copyright_author_link = theme.post_copyright.copyright_author_link ? theme.post_copyright.copyright_author_link : '/'
a.post-copyright__author_img(href=url_for(copyright_author_link) title='头像')
img.post-copyright__author_img_back(src=url_for(copyright_author_img_back) title='头像' alt='头像')
img.post-copyright__author_img_front(src=url_for(copyright_author_img_front) title="头像" alt='头像')
.post-copyright__author_name=author
.post-copyright__author_desc=config.subtitle
.post-copyright__post__info
if (page.copyright_author && page.copyright_author !== config.author)
a.post-copyright__reprint(title="该文章为转载文章,注意版权协议" href=url_for(url)) 转载
else
a.post-copyright__original(title="该文章为原创文章,注意版权协议" href=url_for(url)) 原创
a.post-copyright-title
span(onclick=`rm.copyPageUrl('${theme.post_copyright.decode ? decodeURI(url) : url}')`)=pageTitle
//- ptool
if theme.ptool.enable
include ./ptool.pug
.post-copyright__notice
span.post-copyright-info!= info
.post-tools-right
if (!theme.ptool.categories)
.tag_share
.post-meta__box
if (theme.post_meta.post.tags)
.post-meta__box__tag-list
each item, index in page.tags.data
a(href=url_for(item.path)).post-meta__box__tags
span.tags-punctuation
i.anzhiyufont.anzhiyu-icon-tag
=item.name
span.tagsPageCount=item.length
!=partial('includes/third-party/share/index.pug', {}, {cache: true})
else
.tag_share
.post-meta__box
if (page.categories.data.length > 0)
.post-meta__box__category-list
each item, index in page.categories.data
a(href=url_for(item.path)).post-meta__box__categoryes
span.categoryes-punctuation
i.anzhiyufont.anzhiyu-icon-inbox
=item.name
span.categoryesPageCount=item.length
if (theme.post_meta.post.tags)
.post-meta__box__tag-list
each item, index in page.tags.data
a(href=url_for(item.path)).post-meta__box__tags
span.tags-punctuation
i.anzhiyufont.anzhiyu-icon-tag
=item.name
span.tagsPageCount=item.length
!=partial('includes/third-party/share/index.pug', {}, {cache: true})

View File

@@ -0,0 +1,54 @@
- let url = page.copyright_url || page.permalink
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
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 site_title = page.title || page.tag || page.category || config.title
#post-tools.post-tools
.post-tools-left
div.rewardLeftButton
if theme.reward.enable && theme.reward.QR_code
!=partial('includes/post/reward', {}, {cache: true})
if theme.ptool.mode
.reward-link.mode
a.reward-link-button(href=url_for(theme.ptool.mode))
i.anzhiyufont.anzhiyu-icon-plant-fill
| 运营模式与责任
div.shareRight
if theme.ptool.share_mobile
.share-link.mobile
.share-qrcode
.share-button(title='使用手机访问这篇文章')
i.anzhiyufont.anzhiyu-icon-qrcode
.share-main
.share-main-all
#qrcode(title=url)
.reward-dec 使用手机访问这篇文章
if theme.ptool.share_weibo
.share-link.weibo
a.share-button(target='_blank' href=`https://service.weibo.com/share/share.php?title=${site_title}&url=${url}&pic=${bg_img}` rel='external nofollow noreferrer noopener')
i.anzhiyufont.anzhiyu-icon-weibo
if theme.ptool.share_copyurl
script.
function copyCurrentPageUrl() {
var currentPageUrl = window.location.href;
var input = document.createElement("input");
input.setAttribute("value", currentPageUrl);
document.body.appendChild(input);
input.select();
input.setSelectionRange(0, 99999);
document.execCommand("copy");
document.body.removeChild(input);
}
.share-link.copyurl
#post-share-url.share-button(title='复制链接' onclick='copyCurrentPageUrl()')
i.anzhiyufont.anzhiyu-icon-link

View File

@@ -0,0 +1,18 @@
.post-reward(onclick='anzhiyu.addRewardMask()')
.reward-button.button--animated(title='赞赏作者')
i.anzhiyufont.anzhiyu-icon-hand-heart-fill
| 打赏作者
.reward-main
.reward-all
span.reward-title 感谢你赐予我前进的力量
ul.reward-group
each item in theme.reward.QR_code
- var clickTo = item.link ? item.link : item.img
li.reward-item
a(href=url_for(clickTo) target='_blank')
img.post-qr-code-img(src=url_for(item.img) alt=item.text)
.post-qr-code-desc=item.text
a.reward-main-btn(href='/about/#about-reward' target='_blank')
.reward-text 赞赏者名单
.reward-dec 因为你们的支持让我意识到写文章的价值🙏
#quit-box(onclick="anzhiyu.removeRewardMask()" style="display: none")

View File

@@ -0,0 +1,63 @@
- const { readmode, translate, darkmode, aside, chat_btn } = theme
mixin rightsideItem(array)
each item in array
case item
when 'readmode'
if is_post() && readmode
button#readmode(type="button" title=_p('rightside.readmode_title'))
i.anzhiyufont.anzhiyu-icon-book-open
when 'translate'
if translate.enable
button#translateLink(type="button" title=_p('rightside.translate_title'))= translate.default
when 'darkmode'
if darkmode.enable && darkmode.button
button#darkmode(type="button" title=_p('rightside.night_mode_title'))
i.anzhiyufont.anzhiyu-icon-circle-half-stroke
when 'hideAside'
if aside.enable && aside.button && page.aside !== false
button#hide-aside-btn(type="button" title=_p('rightside.aside'))
i.anzhiyufont.anzhiyu-icon-arrows-left-right
when 'toc'
if showToc
button#mobile-toc-button.close(type="button" title=_p("rightside.toc"))
i.anzhiyufont.anzhiyu-icon-list-ul
when 'chat'
if chat_btn && (theme.chatra.enable || theme.tidio.enable || theme.daovoice.enable || theme.crisp.enable)
button#chat-btn(type="button" title=_p("rightside.chat"))
i.anzhiyufont.anzhiyu-icon-comment-sms
when 'comment'
if commentsJsLoad
a#to_comment(href="#post-comment" title=_p("rightside.scroll_to_comment"))
i.anzhiyufont.anzhiyu-icon-comments
if theme.comment_barrage_config && theme.comment_barrage_config.enable
a#switch-commentBarrage(href="javascript:anzhiyu.switchCommentBarrage();" title="开关弹幕")
i.anzhiyufont.anzhiyu-icon-danmu
#rightside
- const { enable, hide, show } = theme.rightside_item_order
- const hideArray = enable ? hide && hide.split(',') : ['readmode','translate','darkmode','hideAside']
- const showArray = enable ? show && show.split(',') : ['toc','chat','comment']
#rightside-config-hide
if hideArray
+rightsideItem(hideArray)
#rightside-config-show
if enable
if hide
button#rightside-config(type="button" title=_p("rightside.setting"))
i.anzhiyufont.anzhiyu-icon-gear
else
if is_post()
if (readmode || translate.enable || (darkmode.enable && darkmode.button))
button#rightside-config(type="button" title=_p("rightside.setting"))
i.anzhiyufont.anzhiyu-icon-gear
else if translate.enable || (darkmode.enable && darkmode.button)
button#rightside-config(type="button" title=_p("rightside.setting"))
i.anzhiyufont.anzhiyu-icon-gear
if showArray
+rightsideItem(showArray)
button#go-up(type="button" title=_p("rightside.back_to_top"))
i.anzhiyufont.anzhiyu-icon-arrow-up

View File

@@ -0,0 +1,11 @@
#keyboard-tips(class='')
.keyboardTitle 博客快捷键
.keybordList
each item in ["K 关闭快捷键功能", "A 打开/关闭中控台", "M 播放/暂停音乐", "D 深色/浅色显示模式", "S 站内搜索", "R 随机访问", "H 返回首页", "F 友链鱼塘", "L 友链页面", "P 关于本站", "I 原版/本站右键菜单"]
- let key = item.split(" ")[0]
- let content = item.split(" ")[1]
.keybordItem
.keyGroup
.key= "shift " + key
.keyContent
.content= content

View File

@@ -0,0 +1,50 @@
#sidebar
#menu-mask
#sidebar-menus
if theme.sidebar && theme.sidebar.site_data
.sidebar-site-data.site-data.is-center
if theme.sidebar.site_data.archive
a(href=url_for(config.archive_dir) + '/', title='archive')
.headline= _p('aside.articles')
.length-num= site.posts.length
if theme.sidebar.site_data.tag
a(href=url_for(config.tag_dir) + '/', title='tag' )
.headline= _p('aside.tags')
.length-num= site.tags.length
if theme.sidebar.site_data.category
a(href=url_for(config.category_dir) + '/', title='category')
.headline= _p('aside.categories')
.length-num= site.categories.length
if theme.sidebar && theme.sidebar.display_mode
span.sidebar-menu-item-title=_p("aside.function")
.sidebar-menu-item
a.darkmode_switchbutton.menu-child(href='javascript:void(0);' title=_p("aside.display_mode"))
i.anzhiyufont.anzhiyu-icon-circle-half-stroke
span=_p("aside.display_mode")
if theme.sidebar && theme.sidebar.nav_menu_project
.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
if theme.sidebar && theme.sidebar.menus_items
!=partial('includes/header/menu_item', {}, {cache: true})
if theme.sidebar && theme.sidebar.tags_cloud
span.sidebar-menu-item-title 标签
if theme.aside.card_tags.enable
if site.tags.length
.card-tags
.item-headline
- let tagLimit = theme.aside.card_tags.limit === 0 ? 0 : theme.aside.card_tags.limit || 40
if theme.aside.card_tags.color
.card-tag-cloud!= cloudTags({source: site.tags, minfontsize: 0.875, maxfontsize: 0.875, limit: tagLimit, unit: 'rem', color: true, highlightTags: theme.aside.card_tags.highlightTags})
else
.card-tag-cloud!= cloudTags({source: site.tags, minfontsize: 0.875, maxfontsize: 0.875, limit: tagLimit, unit: 'rem', color: false, highlightTags: theme.aside.card_tags.highlightTags})
hr

View File

@@ -0,0 +1,3 @@
link(rel='stylesheet' href=url_for(theme.asset.aplayer_css) media="print" onload="this.media='all'")
script(src=url_for(theme.asset.aplayer_js))
script(src=url_for(theme.asset.meting_js))

View File

@@ -0,0 +1,19 @@
- const { server, site } = theme.artalk
script.
(() => {
const getArtalkCount = () => {
const runWidget = () => {
Artalk.loadCountWidget({
server: '!{server}',
site: '!{site}',
countEl: '.artalk-count'
})
}
if (typeof Artalk === 'function') runWidget()
else getScript('!{theme.asset.artalk_js}').then(runWidget)
}
window.pjax ? getArtalkCount() : window.addEventListener('load', getArtalkCount)
})()

View File

@@ -0,0 +1,9 @@
case theme.comments.use[0]
when 'Twikoo'
include ./twikoo.pug
when 'Valine'
include ./valine.pug
when 'Waline'
include ./waline.pug
when 'Artalk'
include ./artalk.pug

View File

@@ -0,0 +1,37 @@
script.
(() => {
const getCommentUrl = () => {
const eleGroup = document.querySelectorAll('#recent-posts .article-title')
let urlArray = []
eleGroup.forEach(i=>{
urlArray.push(i.getAttribute('href'))
})
return urlArray
}
const getCount = () => {
const runTwikoo = () => {
twikoo.getCommentsCount({
envId: '!{theme.twikoo.envId}',
region: '!{theme.twikoo.region}',
urls: getCommentUrl(),
includeReply: false
}).then(function (res) {
document.querySelectorAll('#recent-posts .twikoo-count').forEach((item,index) => {
item.textContent = res[index].count
})
}).catch(function (err) {
console.log(err)
})
}
if (typeof twikoo === 'object') {
runTwikoo()
} else {
getScript('!{url_for(theme.asset.twikoo)}').then(runTwikoo)
}
}
window.pjax ? getCount() : window.addEventListener('load', getCount)
})()

View File

@@ -0,0 +1,20 @@
script.
(() => {
function loadValine () {
function initValine () {
let initData = {
el: '#vcomment',
appId: '#{theme.valine.appId}',
appKey: '#{theme.valine.appKey}',
serverURLs: '#{theme.valine.serverURLs}'
}
const valine = new Valine(initData)
}
if (typeof Valine === 'function') initValine()
else getScript('!{url_for(theme.asset.valine)}').then(initValine)
}
window.pjax ? loadValine() : window.addEventListener('load', loadValine)
})()

View File

@@ -0,0 +1,21 @@
- const serverURL = theme.waline.serverURL.replace(/\/$/, '')
script.
(() => {
async function loadWaline () {
try {
const eleGroup = document.querySelectorAll('#recent-posts .waline-comment-count')
const keyArray = Array.from(eleGroup).map(i => i.getAttribute('data-path'))
const res = await fetch(`!{serverURL}/api/comment?type=count&url=${keyArray}`, { method: 'GET' })
const result = await res.json()
result.data.forEach((count, index) => {
eleGroup[index].textContent = count
})
} catch (err) {
console.error(err)
}
}
window.pjax ? loadWaline() : window.addEventListener('load', loadWaline)
})()

View File

@@ -0,0 +1,50 @@
//- https://chatra.io/help/api/
script.
(() => {
const isChatBtn = !{theme.chat_btn}
const isChatHideShow = !{theme.chat_hide_show}
if (isChatBtn) {
const close = () => {
Chatra('minimizeWidget')
Chatra('hide')
}
const open = () => {
Chatra('openChat', true)
Chatra('show')
}
window.ChatraSetup = {
startHidden: true
}
window.chatBtnFn = () => {
const isShow = document.getElementById('chatra').classList.contains('chatra--expanded')
isShow ? close() : open()
}
} else if (isChatHideShow) {
window.chatBtn = {
hide: () => {
Chatra('hide')
},
show: () => {
Chatra('show')
}
}
}
(function(d, w, c) {
w.ChatraID = '#{theme.chatra.id}'
var s = d.createElement('script')
w[c] = w[c] || function() {
(w[c].q = w[c].q || []).push(arguments)
}
s.async = true
s.src = 'https://call.chatra.io/chatra.js'
if (d.head) d.head.appendChild(s)
})(document, window, 'Chatra')
})()

View File

@@ -0,0 +1,45 @@
script.
(() => {
window.$crisp = [];
window.CRISP_WEBSITE_ID = "!{theme.crisp.website_id}";
(function () {
d = document;
s = d.createElement("script");
s.src = "https://client.crisp.chat/l.js";
s.async = 1;
d.getElementsByTagName("head")[0].appendChild(s);
})();
$crisp.push(["safe", true])
const isChatBtn = !{theme.chat_btn}
const isChatHideShow = !{theme.chat_hide_show}
if (isChatBtn) {
const open = () => {
$crisp.push(["do", "chat:show"])
$crisp.push(["do", "chat:open"])
}
const close = () => {
$crisp.push(["do", "chat:hide"])
}
close()
$crisp.push(["on", "chat:closed", function() {
close()
}])
window.chatBtnFn = () => {
$crisp.is("chat:visible") ? close() : open()
}
} else if (isChatHideShow) {
window.chatBtn = {
hide: () => {
$crisp.push(["do", "chat:hide"])
},
show: () => {
$crisp.push(["do", "chat:show"])
}
}
}
})()

View File

@@ -0,0 +1,40 @@
//- https://guide.daocloud.io/daovoice/javascript-api-5869833.html
script.
(() => {
(function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/!{theme.daovoice.app_id}.js","daovoice")
const isChatBtn = !{theme.chat_btn}
const isChatHideShow = !{theme.chat_hide_show}
daovoice('init', {
app_id: '!{theme.daovoice.app_id}',},{
launcher: {
disableLauncherIcon: isChatBtn
},
});
daovoice('update');
if (isChatBtn) {
window.chatBtnFn = () => {
const isShow = document.getElementById('daodream-messenger').classList.contains('daodream-messenger-active')
isShow ? daovoice('hide') : daovoice('show')
}
} else if (isChatHideShow) {
window.chatBtn = {
hide: () => {
daovoice('update', {},{
launcher: {
disableLauncherIcon: true
}
})
},
show: () => {
daovoice('update', {}, {
launcher: {
disableLauncherIcon: false
}
})
}
}
}
})()

View File

@@ -0,0 +1,8 @@
if theme.chatra && theme.chatra.enable
include ./chatra.pug
else if theme.tidio && theme.tidio.enable
include ./tidio.pug
else if theme.daovoice && theme.daovoice.enable
include ./daovoice.pug
else if theme.crisp && theme.crisp.enable
include ./crisp.pug

View File

@@ -0,0 +1,47 @@
script(src=`//code.tidio.co/${theme.tidio.public_key}.js` async)
script.
(() => {
const isChatBtn = !{theme.chat_btn}
const isChatHideShow = !{theme.chat_hide_show}
if (isChatBtn) {
let isShow = false
const close = () => {
window.tidioChatApi.hide()
isShow = false
document.body.style.position = 'relative';
document.documentElement.style.overflow = 'auto'
}
const open = () => {
window.tidioChatApi.open()
window.tidioChatApi.show()
isShow = true
}
const onTidioChatApiReady = () => {
window.tidioChatApi.hide()
window.tidioChatApi.on("close", close)
}
if (window.tidioChatApi) {
window.tidioChatApi.on("ready", onTidioChatApiReady)
} else {
document.addEventListener("tidioChat-ready", onTidioChatApiReady)
}
window.chatBtnFn = () => {
if (!window.tidioChatApi) return
isShow ? close() : open()
}
} else if (isChatHideShow) {
window.chatBtn = {
hide: () => {
window.tidioChatApi && window.tidioChatApi.hide()
},
show: () => {
window.tidioChatApi && window.tidioChatApi.show()
}
}
}
})()

View File

@@ -0,0 +1,63 @@
- const { server, site, option } = theme.artalk
- const { use, lazyload, count } = theme.comments
script.
(() => {
const initArtalk = () => {
window.artalkItem = new Artalk(Object.assign({
el: '#artalk-wrap',
server: '!{server}',
site: '!{site}',
pageKey: location.pathname,
darkMode: document.documentElement.getAttribute('data-theme') === 'dark',
countEl: '.artalk-count'
},!{JSON.stringify(option)}))
if (GLOBAL_CONFIG.lightbox === 'null') return
window.artalkItem.use(ctx => {
ctx.on('list-loaded', () => {
ctx.getCommentList().forEach(comment => {
const $content = comment.getRender().$content
anzhiyu.loadLightbox($content.querySelectorAll('img:not([atk-emoticon])'))
})
})
})
}
const loadArtalk = async () => {
if (typeof window.artalkItem === 'object') {
initArtalk()
!{count ? 'GLOBAL_CONFIG_SITE.isPost && getCount()' : ''}
} else {
await getCSS('!{theme.asset.artalk_css}')
await getScript('!{theme.asset.artalk_js}')
initArtalk()
!{count ? 'GLOBAL_CONFIG_SITE.isPost && getCount()' : ''}
}
}
const getCount = () => {
Artalk.loadCountWidget({
server: '!{server}',
site: '!{site}',
countEl: '.artalk-count'
})
}
const artalkChangeMode = theme => {
const artalkWrap = document.getElementById('artalk-wrap')
if (!(artalkWrap && artalkWrap.children.length)) return
const isDark = theme === 'dark'
window.artalkItem.setDarkMode(isDark)
}
anzhiyu.addGlobalFn('themeChange', artalkChangeMode, 'artalk')
if ('!{use[0]}' === 'Artalk' || !!{lazyload}) {
if (!{lazyload}) anzhiyu.loadComment(document.getElementById('artalk-wrap'), loadArtalk)
else loadArtalk()
} else {
window.loadOtherComment = loadArtalk
}
})()

View File

@@ -0,0 +1,35 @@
- let defaultComment = theme.comments.use[0]
hr
#post-comment
.comment-head
.comment-headline
i.anzhiyufont.anzhiyu-icon-comments
span= ' ' + _p('comment')
.comment-randomInfo
a(onclick="anzhiyu.addRandomCommentInfo()" href="javascript:void(0)" style=theme.visitorMail.enable ? "" : "display: none") 匿名评论
a(href=url_for('/privacy') style="margin-left: 4px") 隐私政策
if theme.comments.use.length > 1
.comment-switch
span.first-comment=defaultComment
span#switch-btn
span.second-comment=theme.comments.use[1]
if defaultComment == "Twikoo"
.comment-tips#comment-tips
span ✅ 你无需删除空行,直接评论以获取最佳展示效果
.comment-wrap
each name in theme.comments.use
div
case name
when 'Valine'
#vcomment.vcomment
when 'Twikoo'
#twikoo-wrap
when 'Waline'
#waline-wrap
when 'Artalk'
#artalk-wrap
.comment-barrage

View File

@@ -0,0 +1,10 @@
each name in theme.comments.use
case name
when 'Valine'
!=partial('includes/third-party/comments/valine', {}, {cache: true})
when 'Twikoo'
!=partial('includes/third-party/comments/twikoo', {}, {cache: true})
when 'Waline'
!=partial('includes/third-party/comments/waline', {}, {cache: true})
when 'Artalk'
!=partial('includes/third-party/comments/artalk', {}, {cache: true})

View File

@@ -0,0 +1,50 @@
- const { envId, region, option } = theme.twikoo
- const { use, lazyload, count } = theme.comments
script.
(() => {
const init = () => {
twikoo.init(Object.assign({
el: '#twikoo-wrap',
envId: '!{envId}',
region: '!{region}',
onCommentLoaded: () => {
anzhiyu.loadLightbox(document.querySelectorAll('#twikoo .tk-content img:not(.tk-owo-emotion)'))
}
}, !{JSON.stringify(option)}))
}
const loadTwikoo = () => {
if (typeof twikoo === 'object') setTimeout(runFn,0)
else getScript('!{url_for(theme.asset.twikoo)}').then(runFn)
}
const getCount = () => {
const countELement = document.getElementById('twikoo-count')
if(!countELement) return
twikoo.getCommentsCount({
envId: '!{envId}',
region: '!{region}',
urls: [window.location.pathname],
includeReply: false
}).then(res => {
countELement.textContent = res[0].count
}).catch(err => {
console.error(err)
})
}
const runFn = () => {
init();
!{count ? 'GLOBAL_CONFIG_SITE.isPost && getCount()' : ''}
}
if ('!{use[0]}' === 'Twikoo' || !!{lazyload}) {
if (!{lazyload}) anzhiyu.loadComment(document.getElementById('twikoo-wrap'), loadTwikoo)
else {
loadTwikoo()
}
} else {
window.loadOtherComment = loadTwikoo
}
})()

View File

@@ -0,0 +1,37 @@
- const { use, lazyload } = theme.comments
- const { appId, appKey, avatar, serverURLs, visitor, option } = theme.valine
- let emojiMaps = '""'
if site.data.valine
- emojiMaps = JSON.stringify(site.data.valine)
script.
(() => {
const initValine = () => {
const valine = new Valine(Object.assign({
el: '#vcomment',
appId: '#{appId}',
appKey: '#{appKey}',
avatar: '#{avatar}',
serverURLs: '#{serverURLs}',
emojiMaps: !{emojiMaps},
path: window.location.pathname,
visitor: #{visitor}
}, !{JSON.stringify(option)}))
}
const loadValine = async () => {
if (typeof Valine === 'function') initValine()
else {
await getScript('!{url_for(theme.asset.valine)}')
initValine()
}
}
if ('!{use[0]}' === 'Valine' || !!{lazyload}) {
if (!{lazyload}) anzhiyu.loadComment(document.getElementById('vcomment'),loadValine)
else setTimeout(loadValine, 0)
} else {
window.loadOtherComment = loadValine
}
})()

View File

@@ -0,0 +1,32 @@
- const { serverURL, option, pageview } = theme.waline
- const { lazyload, count, use } = theme.comments
script.
(() => {
const initWaline = () => {
const waline = Waline.init(Object.assign({
el: '#waline-wrap',
serverURL: '!{serverURL}',
pageview: !{lazyload ? false : pageview},
dark: 'html[data-theme="dark"]',
path: window.location.pathname,
comment: !{lazyload ? false : count},
}, !{JSON.stringify(option)}))
}
const loadWaline = async () => {
if (typeof Waline === 'object') initWaline()
else {
await getCSS('!{url_for(theme.asset.waline_css)}')
await getScript('!{url_for(theme.asset.waline_js)}')
initWaline()
}
}
if ('!{use[0]}' === 'Waline' || !!{lazyload}) {
if (!{lazyload}) anzhiyu.loadComment(document.getElementById('waline-wrap'),loadWaline)
else setTimeout(loadWaline, 0)
} else {
window.loadOtherComment = loadWaline
}
})()

View File

@@ -0,0 +1,35 @@
if theme.fireworks && theme.fireworks.enable
canvas.fireworks(mobile=`${theme.fireworks.mobile}`)
script(src=url_for(theme.asset.fireworks))
if (theme.canvas_ribbon && theme.canvas_ribbon.enable)
script(defer id="ribbon" src=url_for(theme.asset.canvas_ribbon) size=theme.canvas_ribbon.size
alpha=theme.canvas_ribbon.alpha zIndex=theme.canvas_ribbon.zIndex mobile=`${theme.canvas_ribbon.mobile}` data-click=`${theme.canvas_ribbon.click_to_change}`)
if (theme.canvas_fluttering_ribbon && theme.canvas_fluttering_ribbon.enable)
script(defer id="fluttering_ribbon" mobile=`${theme.canvas_fluttering_ribbon.mobile}` src=url_for(theme.asset.canvas_fluttering_ribbon))
if (theme.canvas_nest && theme.canvas_nest.enable)
script#canvas_nest(defer color=theme.canvas_nest.color opacity=theme.canvas_nest.opacity zIndex=theme.canvas_nest.zIndex count=theme.canvas_nest.count mobile=`${theme.canvas_nest.mobile}` src=url_for(theme.asset.canvas_nest))
if theme.activate_power_mode.enable
script(src=url_for(theme.asset.activate_power_mode))
script.
POWERMODE.colorful = !{theme.activate_power_mode.colorful};
POWERMODE.shake = !{theme.activate_power_mode.shake};
POWERMODE.mobile = !{theme.activate_power_mode.mobile};
document.body.addEventListener('input', POWERMODE);
//- 鼠標特效
if theme.click_heart && theme.click_heart.enable
script#click-heart(src=url_for(theme.asset.click_heart) async mobile=`${theme.click_heart.mobile}`)
if theme.ClickShowText && theme.ClickShowText.enable
script#click-show-text(
src= url_for(theme.asset.ClickShowText)
data-mobile= `${theme.ClickShowText.mobile}`
data-text= theme.ClickShowText.text.join(",")
data-fontsize= theme.ClickShowText.fontSize
data-random= `${theme.ClickShowText.random}`
async
)

View File

@@ -0,0 +1,128 @@
- const { effect,loop,source,sub,startDelay,typeSpeed,backSpeed } = theme.footer.footerBar.subTitle
- let subContent = sub || new Array()
case source
when 1
script.
function subtitleType () {
fetch('https://v1.hitokoto.cn')
.then(response => response.json())
.then(data => {
if (!{effect}) {
const from = '出自 ' + data.from
const sub = !{JSON.stringify(subContent)}
sub.unshift(data.hitokoto, from)
window.typed = new Typed('#footer-type-tips', {
strings: sub,
startDelay: !{startDelay},
typeSpeed: !{typeSpeed},
loop: !{loop},
backSpeed: !{backSpeed},
})
} else {
document.getElementById('footer-type-tips').innerHTML = data.hitokoto
}
})
}
if (!{effect}) {
if (typeof Typed === 'function') {
subtitleType()
} else {
getScript('!{url_for(theme.asset.typed)}').then(subtitleType)
}
} else {
subtitleType()
}
when 2
script.
function subtitleType () {
getScript('https://yijuzhan.com/api/word.php?m=js').then(() => {
const con = str[0]
if (!{effect}) {
const from = '出自 ' + str[1]
const sub = !{JSON.stringify(subContent)}
sub.unshift(con, from)
window.typed = new Typed('#footer-type-tips', {
strings: sub,
startDelay: !{startDelay},
typeSpeed: !{typeSpeed},
loop: !{loop},
backSpeed: !{backSpeed},
})
} else {
document.getElementById('footer-type-tips').innerHTML = con
}
})
}
if (!{effect}) {
if (typeof Typed === 'function') {
subtitleType()
} else {
getScript('!{url_for(theme.asset.typed)}').then(subtitleType)
}
} else {
subtitleType()
}
when 3
script.
function subtitleType () {
getScript('https://sdk.jinrishici.com/v2/browser/jinrishici.js').then(() => {
jinrishici.load(result =>{
if (!{effect}) {
const sub = !{JSON.stringify(subContent)}
const content = result.data.content
sub.unshift(content)
window.typed = new Typed('#footer-type-tips', {
strings: sub,
startDelay: !{startDelay},
typeSpeed: !{typeSpeed},
loop: !{loop},
backSpeed: !{backSpeed},
})
} else {
document.getElementById('footer-type-tips').innerHTML = result.data.content
}
})
})
}
if (!{effect}) {
if (typeof Typed === 'function') {
subtitleType()
} else {
getScript('!{url_for(theme.asset.typed)}').then(subtitleType)
}
} else {
subtitleType()
}
default
- subContent = subContent.length ? subContent : new Array(config.subtitle)
script.
function subtitleType () {
if (!{effect}) {
window.typed = new Typed("#footer-type-tips", {
strings: !{JSON.stringify(subContent)},
startDelay: !{startDelay},
typeSpeed: !{typeSpeed},
loop: !{loop},
backSpeed: !{backSpeed}
})
} else {
document.getElementById("footer-type-tips").innerHTML = '!{subContent[0]}'
}
}
if (!{effect}) {
if (typeof Typed === 'function') {
subtitleType()
} else {
getScript('!{url_for(theme.asset.typed)}').then(subtitleType)
}
} else {
subtitleType()
}

View File

@@ -0,0 +1,18 @@
if theme.mathjax && theme.mathjax.enable
if theme.mathjax.per_page
if is_post() || is_page()
include ./mathjax.pug
else
if page.mathjax
include ./mathjax.pug
if theme.katex && theme.katex.enable
if theme.katex.per_page
if is_post() || is_page()
include ./katex.pug
else
if page.katex
include ./katex.pug
if theme.mermaid.enable
include ./mermaid.pug

View File

@@ -0,0 +1,9 @@
link(rel="stylesheet" type="text/css" href=url_for(theme.asset.katex))
script(src=url_for(theme.asset.katex_copytex))
script.
(() => {
document.querySelectorAll('#article-container span.katex-display').forEach(item => {
anzhiyu.wrap(item, 'div', { class: 'katex-wrap'})
})
})()

View File

@@ -0,0 +1,38 @@
//- Mathjax 3
script.
if (!window.MathJax) {
window.MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']],
tags: 'ams'
},
chtml: {
scale: 1.1
},
options: {
renderActions: {
findScript: [10, doc => {
for (const node of document.querySelectorAll('script[type^="math/tex"]')) {
const display = !!node.type.match(/; *mode=display/)
const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display)
const text = document.createTextNode('')
node.parentNode.replaceChild(text, node)
math.start = {node: text, delim: '', n: 0}
math.end = {node: text, delim: '', n: 0}
doc.math.push(math)
}
}, '']
}
}
}
const script = document.createElement('script')
script.src = '!{url_for(theme.asset.mathjax)}'
script.id = 'MathJax-script'
script.async = true
document.head.appendChild(script)
} else {
MathJax.startup.document.state(0)
MathJax.texReset()
MathJax.typesetPromise()
}

View File

@@ -0,0 +1,38 @@
script.
(() => {
const $mermaid = document.querySelectorAll('#article-container .mermaid-wrap')
if ($mermaid.length === 0) return
const runMermaid = () => {
window.loadMermaid = true
const theme = document.documentElement.getAttribute('data-theme') === 'dark' ? '!{theme.mermaid.theme.dark}' : '!{theme.mermaid.theme.light}'
Array.from($mermaid).forEach((item, index) => {
const mermaidSrc = item.firstElementChild
const mermaidThemeConfig = '%%{init:{ \'theme\':\'' + theme + '\'}}%%\n'
const mermaidID = 'mermaid-' + index
const mermaidDefinition = mermaidThemeConfig + mermaidSrc.textContent
const renderFn = mermaid.render(mermaidID, mermaidDefinition)
const renderV10 = () => {
renderFn.then(({svg}) => {
mermaidSrc.insertAdjacentHTML('afterend', svg)
})
}
const renderV9 = svg => {
mermaidSrc.insertAdjacentHTML('afterend', svg)
}
typeof renderFn === 'string' ? renderV9(renderFn) : renderV10()
})
}
const loadMermaid = () => {
window.loadMermaid ? runMermaid() : getScript('!{url_for(theme.asset.mermaid)}').then(runMermaid)
}
anzhiyu.addGlobalFn('themeChange', runMermaid, 'mermaid')
window.pjax ? loadMermaid() : document.addEventListener('DOMContentLoaded', loadMermaid)
})()

View File

@@ -0,0 +1,110 @@
- const { server, site, option } = theme.artalk
- const avatarCdn = option !== null && option.gravatar && option.gravatar.mirror
- const avatarDefault = option !== null && option.gravatar && (option.gravatar.params || option.gravatar.default)
script.
window.addEventListener('load', () => {
const changeContent = (content) => {
if (content === '') return content
content = content.replace(/<img.*?src="(.*?)"?[^\>]+>/ig, '[!{_p("aside.card_newest_comments.image")}]') // replace image link
content = content.replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi, '[!{_p("aside.card_newest_comments.link")}]') // replace url
content = content.replace(/<pre><code>.*?<\/pre>/gi, '[!{_p("aside.card_newest_comments.code")}]') // replace code
content = content.replace(/<[^>]+>/g,"") // remove html tag
if (content.length > 150) {
content = content.substring(0,150) + '...'
}
return content
}
const generateHtml = array => {
let result = ''
if (array.length) {
for (let i = 0; i < array.length; i++) {
result += '<div class=\'aside-list-item\'>'
if (!{theme.newest_comments.avatar}) {
const name = '!{theme.lazyload.enable ? "data-lazy-src" : "src"}'
result += `<a href='${array[i].url}' class='thumbnail'><img ${name}='${array[i].avatar}' alt='${array[i].nick}'></a>`
}
result += `<div class='content'>
<a class='comment' href='${array[i].url}' title='${array[i].content}'>${array[i].content}</a>
<div class='name'><span>${array[i].nick} / </span><time datetime="${array[i].date}">${anzhiyu.diffDate(array[i].date, true)}</time></div>
</div></div>`
}
} else {
result += '!{_p("aside.card_newest_comments.zero")}'
}
let $dom = document.querySelector('#card-newest-comments .aside-list')
$dom && ($dom.innerHTML= result)
window.lazyLoadInstance && window.lazyLoadInstance.update()
window.pjax && window.pjax.refresh($dom)
}
const getSetting = async () => {
try {
const res = await fetch('!{server}/api/conf', { method: 'GET' })
return await res.json()
} catch (e) {
console.log(e)
}
}
const headerList = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Origin': window.location.origin
},
body: new URLSearchParams({
'site_name': '!{site}',
'limit': '!{theme.newest_comments.limit}',
'type':'latest_comments'
})
}
const getComment = async () => {
try {
const res = await fetch('!{server}/api/stat', headerList)
const result = await res.json()
const avatarStr = await getSetting()
const { mirror, params, default:defaults } = avatarStr.data.frontend_conf.gravatar
const avatarCdn = !{avatarCdn} || mirror
let avatarDefault = !{avatarDefault} || params || defaults
avatarDefault = avatarDefault.startsWith('d=') ? avatarDefault : `d=${avatarDefault}`
const artalk = result.data.map(function (e) {
return {
'avatar': `${avatarCdn}${e.email_encrypted}?${avatarDefault}`,
'content': changeContent(e.content_marked),
'nick': e.nick,
'url': e.page_url,
'date': e.date,
}
})
saveToLocal.set('artalk-newest-comments', JSON.stringify(artalk), !{theme.newest_comments.storage}/(60*24))
generateHtml(artalk)
} catch (e) {
console.log(e)
const $dom = document.querySelector('#card-newest-comments .aside-list')
$dom.innerHTML= "!{_p('aside.card_newest_comments.error')}"
}
}
const newestCommentInit = () => {
if (document.querySelector('#card-newest-comments .aside-list')) {
const data = saveToLocal.get('artalk-newest-comments')
if (data) {
generateHtml(JSON.parse(data))
} else {
getComment()
}
}
}
newestCommentInit()
document.addEventListener('pjax:complete', newestCommentInit)
})

View File

@@ -0,0 +1,13 @@
- let { use } = theme.comments
if use
- let forum,apiKey,userRepo
case use[0]
when 'Valine'
include ./valine.pug
when 'Waline'
include ./waline.pug
when 'Twikoo'
include ./twikoo-comment.pug
when 'Artalk'
include ./artalk.pug

View File

@@ -0,0 +1,90 @@
script.
window.addEventListener('load', () => {
const changeContent = (content) => {
if (content === '') return content
content = content.replace(/<img.*?src="(.*?)"?[^\>]+>/ig, '[!{_p("aside.card_newest_comments.image")}]') // replace image link
content = content.replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi, '[!{_p("aside.card_newest_comments.link")}]') // replace url
content = content.replace(/<pre><code>.*?<\/pre>/gi, '[!{_p("aside.card_newest_comments.code")}]') // replace code
content = content.replace(/<[^>]+>/g,"") // remove html tag
if (content.length > 150) {
content = content.substring(0,150) + '...'
}
return content
}
const getComment = () => {
const runTwikoo = () => {
twikoo.getRecentComments({
envId: '!{theme.twikoo.envId}',
region: '!{theme.twikoo.region}',
pageSize: !{theme.newest_comments.limit},
includeReply: true
}).then(function (res) {
const twikooArray = res.map(e => {
return {
'content': changeContent(e.comment),
'avatar': e.avatar,
'nick': e.nick,
'url': e.url + '#' + e.id,
'date': new Date(e.created).toISOString()
}
})
saveToLocal.set('twikoo-newest-comments', JSON.stringify(twikooArray), !{theme.newest_comments.storage}/(60*24))
generateHtml(twikooArray)
}).catch(function (err) {
const $dom = document.querySelector('#card-newest-comments .aside-list')
$dom.textContent= "!{_p('aside.card_newest_comments.error')}"
})
}
if (typeof twikoo === 'object') {
runTwikoo()
} else {
getScript('!{url_for(theme.asset.twikoo)}').then(runTwikoo)
}
}
const generateHtml = array => {
let result = ''
if (array.length) {
for (let i = 0; i < array.length; i++) {
result += '<div class=\'aside-list-item\'>'
if (!{theme.newest_comments.avatar}) {
const name = '!{theme.lazyload.enable ? "data-lazy-src" : "src"}'
result += `<a href='${array[i].url}' class='thumbnail'><img ${name}='${array[i].avatar}' alt='${array[i].nick}'><div class='name'><span>${array[i].nick} </span></div></a>`
}
result += `<div class='content'>
<a class='comment' href='${array[i].url}' title='${array[i].content}'>${array[i].content}</a>
<time datetime="${array[i].date}">${anzhiyu.diffDate(array[i].date, true)}</time></div>
</div>`
}
} else {
result += '!{_p("aside.card_newest_comments.zero")}'
}
let $dom = document.querySelector('#card-newest-comments .aside-list')
$dom && ($dom.innerHTML= result)
window.lazyLoadInstance && window.lazyLoadInstance.update()
window.pjax && window.pjax.refresh($dom)
}
const newestCommentInit = () => {
if (document.querySelector('#card-newest-comments .aside-list')) {
const data = saveToLocal.get('twikoo-newest-comments')
if (data) {
generateHtml(JSON.parse(data))
} else {
getComment()
}
}
}
newestCommentInit()
document.addEventListener('pjax:complete', newestCommentInit)
})

View File

@@ -0,0 +1,99 @@
- let default_avatar = theme.valine.avatar
script(src=url_for(theme.asset.blueimp_md5))
script.
window.addEventListener('load', () => {
const changeContent = (content) => {
if (content === '') return content
content = content.replace(/<img.*?src="(.*?)"?[^\>]+>/ig, '[!{_p("aside.card_newest_comments.image")}]') // replace image link
content = content.replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi, '[!{_p("aside.card_newest_comments.link")}]') // replace url
content = content.replace(/<pre><code>.*?<\/pre>/gi, '[!{_p("aside.card_newest_comments.code")}]') // replace code
content = content.replace(/<[^>]+>/g,"") // remove html tag
if (content.length > 150) {
content = content.substring(0,150) + '...'
}
return content
}
const getIcon = (icon, mail) => {
if (icon) return icon
let defaultIcon = '!{ default_avatar ? `?d=${default_avatar}` : ''}'
let iconUrl = `https://gravatar.loli.net/avatar/${md5(mail.toLowerCase()) + defaultIcon}`
return iconUrl
}
const generateHtml = array => {
let result = ''
if (array.length) {
for (let i = 0; i < array.length; i++) {
result += '<div class=\'aside-list-item\'>'
if (!{theme.newest_comments.avatar}) {
const name = '!{theme.lazyload.enable ? "data-lazy-src" : "src"}'
result += `<a href='${array[i].url}' class='thumbnail'><img ${name}='${array[i].avatar}' alt='${array[i].nick}'></a>`
}
result += `<div class='content'>
<a class='comment' href='${array[i].url}' title='${array[i].content}'>${array[i].content}</a>
<div class='name'><span>${array[i].nick} / </span><time datetime="${array[i].date}">${anzhiyu.diffDate(array[i].date, true)}</time></div>
</div></div>`
}
} else {
result += '!{_p("aside.card_newest_comments.zero")}'
}
let $dom = document.querySelector('#card-newest-comments .aside-list')
$dom && ($dom.innerHTML= result)
window.lazyLoadInstance && window.lazyLoadInstance.update()
window.pjax && window.pjax.refresh($dom)
}
const getComment = () => {
const serverURL = '!{theme.valine.serverURLs || `https://${theme.valine.appId.substring(0,8)}.api.lncldglobal.com` }'
var settings = {
"method": "GET",
"headers": {
"X-LC-Id": '!{theme.valine.appId}',
"X-LC-Key": '!{theme.valine.appKey}',
"Content-Type": "application/json"
},
}
fetch(`${serverURL}/1.1/classes/Comment?limit=!{theme.newest_comments.limit}&order=-createdAt`,settings)
.then(response => response.json())
.then(data => {
const valineArray = data.results.map(function (e) {
return {
'avatar': getIcon(e.QQAvatar, e.mail),
'content': changeContent(e.comment),
'nick': e.nick,
'url': e.url + '#' + e.objectId,
'date': e.updatedAt,
}
})
saveToLocal.set('valine-newest-comments', JSON.stringify(valineArray), !{theme.newest_comments.storage}/(60*24))
generateHtml(valineArray)
}).catch(e => {
const $dom = document.querySelector('#card-newest-comments .aside-list')
$dom.textContent= "!{_p('aside.card_newest_comments.error')}"
})
}
const newestCommentInit = () => {
if (document.querySelector('#card-newest-comments .aside-list')) {
const data = saveToLocal.get('valine-newest-comments')
if (data) {
generateHtml(JSON.parse(data))
} else {
getComment()
}
}
}
newestCommentInit()
document.addEventListener('pjax:complete', newestCommentInit)
})

View File

@@ -0,0 +1,81 @@
- const serverURL = theme.waline.serverURL.replace(/\/$/, '')
script.
window.addEventListener('load', () => {
const changeContent = content => {
if (content === '') return content
content = content.replace(/<img.*?src="(.*?)"?[^\>]+>/ig, '[!{_p("aside.card_newest_comments.image")}]') // replace image link
content = content.replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi, '[!{_p("aside.card_newest_comments.link")}]') // replace url
content = content.replace(/<pre><code>.*?<\/pre>/gi, '[!{_p("aside.card_newest_comments.code")}]') // replace code
content = content.replace(/<[^>]+>/g,"") // remove html tag
if (content.length > 150) {
content = content.substring(0,150) + '...'
}
return content
}
const generateHtml = array => {
let result = ''
if (array.length) {
for (let i = 0; i < array.length; i++) {
result += '<div class=\'aside-list-item\'>'
if (!{theme.newest_comments.avatar}) {
const name = '!{theme.lazyload.enable ? "data-lazy-src" : "src"}'
result += `<a href='${array[i].url}' class='thumbnail'><img ${name}='${array[i].avatar}' alt='${array[i].nick}'></a>`
}
result += `<div class='content'>
<a class='comment' href='${array[i].url}' title='${array[i].content}'>${array[i].content}</a>
<div class='name'><span>${array[i].nick} / </span><time datetime="${array[i].date}">${anzhiyu.diffDate(array[i].date, true)}</time></div>
</div></div>`
}
} else {
result += '!{_p("aside.card_newest_comments.zero")}'
}
let $dom = document.querySelector('#card-newest-comments .aside-list')
$dom && ($dom.innerHTML= result)
window.lazyLoadInstance && window.lazyLoadInstance.update()
window.pjax && window.pjax.refresh($dom)
}
const getComment = async () => {
try {
const res = await fetch('!{serverURL}/api/comment?type=recent&count=!{theme.newest_comments.limit}', { method: 'GET' })
const result = await res.json()
const walineArray = result.data.map(e => {
return {
'content': changeContent(e.comment),
'avatar': e.avatar,
'nick': e.nick,
'url': e.url + '#' + e.objectId,
'date': e.time || e.insertedAt
}
})
saveToLocal.set('waline-newest-comments', JSON.stringify(walineArray), !{theme.newest_comments.storage}/(60*24))
generateHtml(walineArray)
} catch (err) {
console.error(err)
const $dom = document.querySelector('#card-newest-comments .aside-list')
$dom.textContent= "!{_p('aside.card_newest_comments.error')}"
}
}
const newestCommentInit = () => {
if (document.querySelector('#card-newest-comments .aside-list')) {
const data = saveToLocal.get('waline-newest-comments')
if (data) {
generateHtml(JSON.parse(data))
} else {
getComment()
}
}
}
newestCommentInit()
document.addEventListener('pjax:complete', newestCommentInit)
})

View File

@@ -0,0 +1,20 @@
script.
function panguFn () {
if (typeof pangu === 'object') pangu.autoSpacingPage()
else {
getScript('!{url_for(theme.asset.pangu)}')
.then(() => {
pangu.autoSpacingPage()
})
}
}
function panguInit () {
if (!{theme.pangu.field === 'post'}){
GLOBAL_CONFIG_SITE.isPost && panguFn()
} else {
panguFn()
}
}
document.addEventListener('DOMContentLoaded', panguInit)

View File

@@ -0,0 +1,77 @@
- var pjaxExclude = 'a:not([target="_blank"])'
if theme.pjax.exclude
each val in theme.pjax.exclude
- pjaxExclude = pjaxExclude + `:not([href="${val}"])`
- let pjaxSelectors = ['head > title','#config-diff', '#body-wrap','#rightside-config-hide','#rightside-config-show','.js-pjax']
- let choose = theme.comments.use
if choose
if theme.Open_Graph_meta && (choose.includes('Twikoo'))
- pjaxSelectors.unshift('meta[property="og:image"]', 'meta[property="og:title"]', 'meta[property="og:url"]', 'meta[property="og:type"]', 'meta[property="og:site_name"]', 'meta[property="og:description"]')
script(src=url_for(theme.asset.pjax))
script.
let pjaxSelectors = !{JSON.stringify(pjaxSelectors)}
var pjax = new Pjax({
elements: '!{pjaxExclude}',
selectors: pjaxSelectors,
cacheBust: false,
analytics: !{theme.google_analytics ? true : false},
scrollRestoration: false
})
document.addEventListener('pjax:send', function () {
// removeEventListener scroll
anzhiyu.removeGlobalFnEvent('pjax')
anzhiyu.removeGlobalFnEvent('themeChange')
document.getElementById('rightside').classList.remove('rightside-show')
if (window.aplayers) {
for (let i = 0; i < window.aplayers.length; i++) {
if (!window.aplayers[i].options.fixed) {
window.aplayers[i].destroy()
}
}
}
typeof typed === 'object' && typed.destroy()
//reset readmode
const $bodyClassList = document.body.classList
$bodyClassList.contains('read-mode') && $bodyClassList.remove('read-mode')
})
document.addEventListener('pjax:complete', function () {
window.refreshFn()
document.querySelectorAll('script[data-pjax]').forEach(item => {
const newScript = document.createElement('script')
const content = item.text || item.textContent || item.innerHTML || ""
Array.from(item.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value))
newScript.appendChild(document.createTextNode(content))
item.parentNode.replaceChild(newScript, item)
})
GLOBAL_CONFIG.islazyload && window.lazyLoadInstance.update()
typeof panguInit === 'function' && panguInit()
// google analytics
typeof gtag === 'function' && gtag('config', '!{theme.google_analytics}', {'page_path': window.location.pathname});
// baidu analytics
typeof _hmt === 'object' && _hmt.push(['_trackPageview',window.location.pathname]);
typeof loadMeting === 'function' && document.getElementsByClassName('aplayer').length && loadMeting()
// prismjs
typeof Prism === 'object' && Prism.highlightAll()
})
document.addEventListener('pjax:error', e => {
if (e.request.status === 404) {
pjax.loadUrl('!{url_for("/404.html")}')
}
})

View File

@@ -0,0 +1,5 @@
if config.prismjs && config.prismjs.enable && !config.prismjs.preprocess
script(src=url_for(theme.asset.prismjs_js))
script(src=url_for(theme.asset.prismjs_autoloader))
if config.prismjs.line_number
script(src=url_for(theme.asset.prismjs_lineNumber_js))

View File

@@ -0,0 +1,66 @@
- let launch_time = theme.footer.runtime.launch_time
- let offduty_img = theme.footer.runtime.offduty_img
- let offduty_description = theme.footer.runtime.offduty_description
script(async=true).
(function () {
var grt = new Date("#{launch_time}"); //设置网站上线时间
var now = new Date();
var dnum;
var hnum;
var mnum;
var snum;
var nowHour;
// 计算并更新天数、小时数、分钟数和秒数
function updateTime() {
now = new Date(); // 更新 now 的值
nowHour = now.getHours(); // 更新 nowHour 的值
var days = (now - grt) / 1000 / 60 / 60 / 24;
dnum = Math.floor(days);
var hours = (now - grt) / 1000 / 60 / 60 - 24 * dnum;
hnum = Math.floor(hours);
if (String(hnum).length == 1) {
hnum = "0" + hnum;
}
var minutes = (now - grt) / 1000 / 60 - 24 * 60 * dnum - 60 * hnum;
mnum = Math.floor(minutes);
if (String(mnum).length == 1) {
mnum = "0" + mnum;
}
var seconds = (now - grt) / 1000 - 24 * 60 * 60 * dnum - 60 * 60 * hnum - 60 * mnum;
snum = Math.round(seconds);
if (String(snum).length == 1) {
snum = "0" + snum;
}
}
// 更新网页中显示的网站运行时间
function updateHtml() {
const footer = document.getElementById("footer");
if (!footer) return
let currentTimeHtml = "";
if (nowHour < 18 && nowHour >= 9) {
// 如果是上班时间,默认就是"安知鱼-上班摸鱼中.svg"图片,不需要更改
currentTimeHtml = `本站居然运行了 ${dnum} 天<span id='runtime'> ${hnum} 小时 ${mnum} 分 ${snum} 秒 </span><i class='anzhiyufont anzhiyu-icon-heartbeat' style='color:red'></i>`;
} else {
// 如果是下班时间,插入"安知鱼-下班啦.svg"图片
let img = document.querySelector("#workboard .workSituationImg");
if (img != null) {
img.src = "#{offduty_img}";
img.title = "#{offduty_description}";
img.alt = "#{offduty_description}";
}
currentTimeHtml = `本站居然运行了 ${dnum} 天<span id='runtime'> ${hnum} 小时 ${mnum} 分 ${snum} 秒 </span><i class='anzhiyufont anzhiyu-icon-heartbeat' style='color:red'></i>`;
}
if (document.getElementById("runtimeTextTip")) {
document.getElementById("runtimeTextTip").innerHTML = currentTimeHtml;
}
}
setInterval(() => {
updateTime();
updateHtml();
}, 1000);
})();

View File

@@ -0,0 +1,21 @@
#algolia-search
.search-dialog
nav.search-nav
span.search-dialog-title= _p('search.title')
button.search-close-button
i.anzhiyufont.anzhiyu-icon-xmark
.search-wrap
#algolia-search-input
hr
#algolia-search-results
#algolia-hits
if theme.algolia_search.enable && theme.algolia_search.tags
each item, index in theme.algolia_search.tags
a.tag-list(href=url_for("/tags/" + item), title=item)=item
#algolia-pagination
#algolia-info
.algolia-stats
.algolia-poweredBy
#search-mask

View File

@@ -0,0 +1,26 @@
- const { appId, apiKey, indexName, option } = theme.docsearch
.docsearch-wrap
#docsearch(style="display:none")
link(rel="stylesheet" href=url_for(theme.asset.docsearch_css))
script(src=url_for(theme.asset.docsearch_js))
script.
(() => {
docsearch(Object.assign({
appId: '!{appId}',
apiKey: '!{apiKey}',
indexName: '!{indexName}',
container: '#docsearch',
}, !{JSON.stringify(option)}))
const handleClick = () => {
document.querySelector('.DocSearch-Button').click()
}
const searchClickFn = () => {
anzhiyu.addEventListenerPjax(document.querySelector('#search-button > .search'), 'click', handleClick)
}
searchClickFn()
window.addEventListener('pjax:complete', searchClickFn)
})()

View File

@@ -0,0 +1,6 @@
if theme.algolia_search.enable
include ./algolia.pug
else if theme.local_search.enable
include ./local-search.pug
else if theme.docsearch.enable
include ./docsearch.pug

View File

@@ -0,0 +1,20 @@
#local-search
.search-dialog
nav.search-nav
span.search-dialog-title= _p('search.title')
span#loading-status
button.search-close-button
i.anzhiyufont.anzhiyu-icon-xmark
#loading-database.is-center
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-pulse-icon
span= ' ' + _p("search.load_data")
.search-wrap
#local-search-input
.local-search-box
input(placeholder=_p("search.local_search.input_placeholder") type="text").local-search-box--input
hr
#local-search-results
#search-mask

View File

@@ -0,0 +1,10 @@
.addtoany
.a2a_kit.a2a_kit_size_32.a2a_default_style
- let addtoanyItem = theme.addtoany.item.split(',')
each name in addtoanyItem
a(class="a2a_button_" + name)
a.a2a_dd(href="https://www.addtoany.com/share")
script(async src='https://static.addtoany.com/menu/page.js')

View File

@@ -0,0 +1,6 @@
if (theme.sharejs.enable || theme.addtoany.enable)
.post_share
if theme.sharejs.enable
include ./share-js.pug
else if theme.addtoany.enable
!=partial('includes/third-party/share/addtoany', {}, {cache: true})

View File

@@ -0,0 +1,3 @@
.social-share(data-image=url_for(page.cover|| theme.avatar.img) data-sites= theme.sharejs.sites)
link(rel='stylesheet' href=url_for(theme.asset.sharejs_css) media="print" onload="this.media='all'")
script(src=url_for(theme.asset.sharejs) defer)

View File

@@ -0,0 +1,128 @@
- const { effect,loop,source,sub,startDelay,typeSpeed,backSpeed } = theme.subtitle
- let subContent = sub || new Array()
case source
when 1
script.
function subtitleType () {
fetch('https://v1.hitokoto.cn')
.then(response => response.json())
.then(data => {
if (!{effect}) {
const from = '出自 ' + data.from
const sub = !{JSON.stringify(subContent)}
sub.unshift(data.hitokoto, from)
window.typed = new Typed('#subtitle', {
strings: sub,
startDelay: !{startDelay},
typeSpeed: !{typeSpeed},
loop: !{loop},
backSpeed: !{backSpeed},
})
} else {
document.getElementById('subtitle').innerHTML = data.hitokoto
}
})
}
if (!{effect}) {
if (typeof Typed === 'function') {
subtitleType()
} else {
getScript('!{url_for(theme.asset.typed)}').then(subtitleType)
}
} else {
subtitleType()
}
when 2
script.
function subtitleType () {
getScript('https://yijuzhan.com/api/word.php?m=js').then(() => {
const con = str[0]
if (!{effect}) {
const from = '出自 ' + str[1]
const sub = !{JSON.stringify(subContent)}
sub.unshift(con, from)
window.typed = new Typed('#subtitle', {
strings: sub,
startDelay: !{startDelay},
typeSpeed: !{typeSpeed},
loop: !{loop},
backSpeed: !{backSpeed},
})
} else {
document.getElementById('subtitle').innerHTML = con
}
})
}
if (!{effect}) {
if (typeof Typed === 'function') {
subtitleType()
} else {
getScript('!{url_for(theme.asset.typed)}').then(subtitleType)
}
} else {
subtitleType()
}
when 3
script.
function subtitleType () {
getScript('https://sdk.jinrishici.com/v2/browser/jinrishici.js').then(() => {
jinrishici.load(result =>{
if (!{effect}) {
const sub = !{JSON.stringify(subContent)}
const content = result.data.content
sub.unshift(content)
window.typed = new Typed('#subtitle', {
strings: sub,
startDelay: !{startDelay},
typeSpeed: !{typeSpeed},
loop: !{loop},
backSpeed: !{backSpeed},
})
} else {
document.getElementById('subtitle').innerHTML = result.data.content
}
})
})
}
if (!{effect}) {
if (typeof Typed === 'function') {
subtitleType()
} else {
getScript('!{url_for(theme.asset.typed)}').then(subtitleType)
}
} else {
subtitleType()
}
default
- subContent = subContent.length ? subContent : new Array(config.subtitle)
script.
function subtitleType () {
if (!{effect}) {
window.typed = new Typed("#subtitle", {
strings: !{JSON.stringify(subContent)},
startDelay: !{startDelay},
typeSpeed: !{typeSpeed},
loop: !{loop},
backSpeed: !{backSpeed}
})
} else {
document.getElementById("subtitle").innerHTML = '!{subContent[0]}'
}
}
if (!{effect}) {
if (typeof Typed === 'function') {
subtitleType()
} else {
getScript('!{url_for(theme.asset.typed)}').then(subtitleType)
}
} else {
subtitleType()
}

View File

@@ -0,0 +1,135 @@
- let home_top_config = theme.home_top
- let { title, subTitle, siteText,default_descr } = home_top_config
if home_top_config.enable
#home_top
.swiper_container_card(style='height: auto;width: 100%')
#bannerGroup
#random-banner
if theme.peoplecanvas.enable
canvas#peoplecanvas
else
.banners-title
.banners-title-big=title
.banners-title-big=subTitle
.banners-title-small=siteText
include ../anzhiyu/tags-group-all.pug
a#random-hover(href='javascript:toRandomPost()')
i.anzhiyufont.anzhiyu-icon-paper-plane
.bannerText 随便逛逛
i.anzhiyufont.anzhiyu-icon-arrow-right
.categoryGroup
each item in home_top_config.category
.categoryItem(style=`box-shadow:${item.shadow}`)
a.categoryButton(href=url_for(item.path) class=`${item.class}`)
span.categoryButtonText=item.name
if (item.icon.startsWith("fa"))
i(class=`${item.icon}`)
else if (item.icon.startsWith("icon"))
svg.icon(aria-hidden="true")
use(xlink:href=`#`+ item.icon)
else if (item.icon.startsWith("anzhiyu"))
i.anzhiyufont(class=`${item.icon}`)
if theme.home_top.swiper.enable
#swiper_container_blog
#swiper_container.blog-slider.swiper-container-fade.swiper-container-horizontal
.blog-slider__wrp.swiper-wrapper(style='transition-duration: 0ms;')
//- 文章卡片
- let swiper_list = sort_attr_post("swiper_list")
each item in swiper_list
.blog-slider__item.swiper-slide(style='width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;')
a.blog-slider__img(href=item.path, title=item.title)
img(width='48' height='48' src=item.cover alt='图片' onerror=`this.src=` + error_img + `; this.onerror = null;`)
.blog-slider__content
if (timemode === 'updated' )
span.blog-slider__code= item.updated.format('YYYY-MM-DD')
else
span.blog-slider__code= item.date.format('YYYY-MM-DD')
- const content = strip_html(item.content)
- let expert = content.substring(0, theme.index_post_content.length)
- content.length > theme.index_post_content.length ? expert += ' ...' : ''
a.blog-slider__title(href=item.path, alt=item.title)= item.title
.blog-slider__text= item.description ? item.description : expert
a.blog-slider__button(href=item.path, alt=item.title) 详情
//- 轮播图组件
.blog-slider__pagination.swiper-pagination-clickable.swiper-pagination-bullets
#topPostGroup
- let top_group_list = sort_attr_post("top_group_list").splice(0, 4)
each item in top_group_list
.top-group-list-item
.post_cover.left_radius
a(href=item.path title=item.title)
span.top-group-text 荐
img.post_bg(alt=item.title, src=item.cover, onerror=`this.src=` + error_img + `; this.onerror = null;`)
.top-group-info
a.article-title(href=item.path title=item.title)=item.title
.top-group-list-none
.top-group-list-none
.top-group-list-none
else
.topGroup
- let top_group_list = sort_attr_post("top_group_list").splice(0, 6)
- let top_group_banner_tips = theme.home_top.banner.tips
- let top_group_banner_title = theme.home_top.banner.title
- let top_group_banner_image = theme.home_top.banner.image
- let top_group_banner_link = url_for(theme.home_top.banner.link)
each item, index in top_group_list.slice(0, 6)
.recent-post-item(onclick=`pjax.loadUrl("${url_for(item.path)}")`)
.post_cover.left_radius
a(href=item.path, title=item.title)
span.recent-post-top-text 荐
img.post_bg(onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'`, alt='cover', src=item.cover)
.recent-post-info
a.article-title(href=item.path, title=item.title)=item.title
a#todayCard.todayCard(href=top_group_banner_link, style='z-index: 1;')
.todayCard-info
.todayCard-tips=top_group_banner_tips
.todayCard-title=top_group_banner_title
img.todayCard-cover(src=url_for(top_group_banner_image) onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'` alt='封面')
.banner-button-group
.banner-button(onclick='event.stopPropagation();event.preventDefault();anzhiyu.hideTodayCard();')
i.anzhiyufont.anzhiyu-icon-arrow-circle-right
span.banner-button-text 更多推荐
link(rel="stylesheet", href=theme.home_top.banner.top_group_banner_css)
if theme.home_top.swiper.enable
if !site.data.essay
script(src=url_for(theme.home_top.swiper.swiper_js))
script.
function initBlogSlider() {
var swiper = new Swiper(".blog-slider", {
passiveListeners: true,
spaceBetween: 30,
effect: "fade",
loop: true,
autoplay: {
disableOnInteraction: true,
delay: 3000,
},
mousewheel: {
passive: true, // 将 mousewheel 事件处理程序标记为被动的
},
// autoHeight: true,
pagination: {
el: ".blog-slider__pagination",
clickable: true,
},
});
var comtainer = document.getElementById("swiper_container");
if (comtainer !== null) {
comtainer.onmouseenter = function () {
swiper.autoplay.stop();
};
comtainer.onmouseleave = function () {
swiper.autoplay.start();
};
}
}
setTimeout(()=>{
initBlogSlider()
}, 100)

View File

@@ -0,0 +1,3 @@
if theme.ad && theme.ad.aside
.card-widget.ads-wrap
!= theme.ad.aside

View File

@@ -0,0 +1,6 @@
if theme.aside.card_announcement.enable
.card-widget.card-announcement
.item-headline
i.anzhiyufont.anzhiyu-icon-bullhorn.anzhiyu-shake
span= _p('aside.card_announcement')
.announcement_content!= theme.aside.card_announcement.content

Some files were not shown because too many files have changed in this diff Show More