Add solitude

This commit is contained in:
IF-chan
2024-07-05 21:01:19 +08:00
parent 26d71c4fbc
commit 71758b9fce
289 changed files with 23277 additions and 0 deletions
@@ -0,0 +1,166 @@
-
if (theme.search.enable) {
var localSearch = 'undefined';
var algolia = 'undefined';
switch (theme.search.type) {
case 'local':
localSearch = JSON.stringify({
preload: theme.search.local.preload,
path: theme?.search?.local?.CDN || '/search.xml'
});
break;
case 'algolia':
algolia = JSON.stringify({
appId: config.algolia.appId || config.algolia.applicationID,
apiKey: config.algolia.apiKey,
indexName: config.algolia.indexName,
hits: {
per_page: theme?.search?.algolia?.hits?.per_page || 10
}
});
break;
}
}
const sayhello2 = theme.aside?.card?.sayhello2?.map(item => `"${item}"`) || [];
const [hello_prefix, hello_back] = [_p('aside.hello'), _p('aside.back')];
let comment = false
if (theme.comment.use && theme.comment.commentBarrage) {
comment = {
avatar: theme.comment.avatar,
commentBarrage: theme.comment.commentBarrage,
}
}
let post_ai = false
if (theme.post_ai.enable) {
post_ai = JSON.stringify({
key: theme.post_ai.key,
talk: theme.post_ai.talk,
randomPost: theme.post_ai.randomPost,
})
}
let copyright = false;
if (theme.copy.enable && theme.copy.copyright.enable) {
copyright = JSON.stringify({
limit: theme.copy.copyright.limit,
author: _p("copy_copyright.author") + ': ' + config.author,
link: _p("copy_copyright.link") + ': ',
source: _p("copy_copyright.source") + ': ' + config.title,
info: _p("copy_copyright.info")
})
}
let lang = false
lang = {
theme: {
dark: _p('theme.dark'),
light: _p('theme.light'),
},
copy: {
success: _p('copy.success'),
error: _p('copy.error'),
},
backtop: _p('nav.backtop'),
time: {
day: _p('time.day'),
hour: _p('time.hour'),
just: _p('time.just'),
min: _p('time.min'),
month: _p('time.month')
},
day: _p('day'),
f12: _p('f12'),
totalk: _p('totalk')
}
if (theme.search.enable) {
lang.search = {
empty: _p('search.empty'),
hit: _p('search.hit'),
placeholder: _p('search.placeholder'),
count: _p('search.count')
}
}
if (theme.comment.use && theme.comment.commentBarrage) {
lang.barrage = {
title: _p('commentBarrage.title'),
}
}
let rightMenu = false
if (theme.right_menu.enable) {
rightMenu = {
mode: {
dark: _p('right_menu.light'),
light: _p('right_menu.dark'),
},
img_error: _p('right_menu.img_error')
}
if (theme.capsule.enable) {
rightMenu.music = {
start: _p('right_menu.music.start'),
stop: _p('right_menu.music.stop'),
}
}
if (theme.comment.use && theme.comment.commentBarrage) {
rightMenu.barrage = {
open: _p('right_menu.barrage.open'),
close: _p('right_menu.barrage.close')
}
}
if (theme.right_menu.translate.enable) {
rightMenu.translate = {
translateDelay: theme.right_menu.translate.translateDelay,
defaultEncoding: theme.right_menu.translate.defaultEncoding
}
}
}
script.
const GLOBAL_CONFIG = {
root: '!{config.root}',
algolia: !{algolia ? algolia : 'undefined'},
localsearch: !{localSearch ? localSearch : 'undefined'},
runtime: '!{theme.aside.siteinfo.runtimeenable ? theme.aside.siteinfo.runtime : false}',
lazyload: {
enable: !{theme.lazyload.enable},
error: '!{theme.lazyload.errorimg}'
},
copyright: !{copyright},
highlight: {
enable: !{theme.highlight.enable},
limit: !{theme.highlight.limit},
expand: !{theme.highlight.expand},
copy: !{theme.highlight.copy},
syntax: '!{config.syntax_highlighter}'
},
randomlink: !{theme.footer.randomlink},
lang: !{JSON.stringify(lang)},
aside: {
sayhello: {
morning: '!{theme.aside.card.sayhello.morning}',
noon: '!{theme.aside.card.sayhello.noon}',
afternoon: '!{theme.aside.card.sayhello.afternoon}',
night: '!{theme.aside.card.sayhello.night}',
goodnight: '!{theme.aside.card.sayhello.goodnight}',
},
sayhello2: [!{sayhello2}],
sayhello3: {
prefix: '!{hello_prefix}',
back: '!{hello_back}',
},
},
covercolor: {
enable: !{theme.post.covercolor.enable}
},
comment: !{comment ? JSON.stringify(comment) : false},
lightbox: '!{ theme.mediumZoom ? "mediumZoom" : (theme.fancybox ? "fancybox" : "null")}',
post_ai: !{post_ai},
right_menu: !{rightMenu ? JSON.stringify(rightMenu) : false},
};
@@ -0,0 +1,13 @@
if theme.OpenGraph.enable
-
const coverVal = page.cover || theme.site.siteIcon
let ogOption = {
type: is_post() ? 'article' : 'website',
image: coverVal ? full_url_for(coverVal) : '',
...theme.OpenGraph.options
}
-
!= open_graph(ogOption)
meta(name="description" content=page_description())
else
meta(name="description" content=page_description())
@@ -0,0 +1,10 @@
script#config-diff.
var PAGE_CONFIG = {
is_post: !{is_post()},
is_page: !{!is_post() && !is_home()},
is_home: !{is_home()},
page: '!{page.type}',
toc: !{!!page.toc},
comment: !{!!page.comment},
ai_text: !{is_post && page.ai_text ? "'"+ page.ai_text+"'" : false}
}
@@ -0,0 +1,22 @@
if theme.pwa.enable
meta(name="theme-color", content=theme.pwa.theme_color)
meta(name="apple-mobile-web-app-status-bar-style", content=theme.pwa.theme_color)
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=theme.pwa.theme_color)
if theme.pwa.apple_touch_icon
link(rel="apple-touch-icon" sizes="180x180" href=url_for(theme.pwa.apple_touch_icon))
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.favicon_32_32
link(rel="icon", type="image/png", sizes="32x32", href=url_for(theme.pwa.favicon_32_32))
if theme.pwa.bookmark_icon
link(rel="bookmark", href=url_for(theme.pwa.bookmark_icon))
else
meta(name="apple-mobile-web-app-capable", content=config.title)
meta(name="theme-color", content="var(--efu-main)")
meta(name="apple-mobile-web-app-status-bar-style", content="var(--efu-main)")
link(rel="bookmark", href=url_for(theme.site.siteIcon))
link(rel="apple-touch-icon", href=url_for(theme.site.siteIcon), sizes="180x180")