layout
This commit is contained in:
1 parent
af697e8cb0
commit
0e952773ed
15 files changed
+440
-206
No files matched your search
@@ -10,7 +10,6 @@
|
|||||||
hitsPerPage: theme.search.algolia_search.hitsPerPage,
|
hitsPerPage: theme.search.algolia_search.hitsPerPage,
|
||||||
// search languages
|
// search languages
|
||||||
languages: {
|
languages: {
|
||||||
input_placeholder: theme.search.placeholder || _p("search.input_placeholder"),
|
|
||||||
hits_empty: _p("search.algolia_search.hits_empty"),
|
hits_empty: _p("search.algolia_search.hits_empty"),
|
||||||
hits_stats: _p("search.algolia_search.hits_stats"),
|
hits_stats: _p("search.algolia_search.hits_stats"),
|
||||||
}
|
}
|
||||||
@@ -19,12 +18,16 @@
|
|||||||
|
|
||||||
let localSearch = 'undefined'
|
let localSearch = 'undefined'
|
||||||
if (theme.search.use === 'local_search') {
|
if (theme.search.use === 'local_search') {
|
||||||
const { CDN, preload, top_n_per_article, unescape } = theme.search.local_search
|
const { CDN, preload, top_n_per_article, pagination, unescape } = theme.search.local_search
|
||||||
localSearch = JSON.stringify({
|
localSearch = JSON.stringify({
|
||||||
path: CDN || config.root + config.search.path,
|
path: CDN || config.root + config.search.path,
|
||||||
preload,
|
preload,
|
||||||
top_n_per_article,
|
top_n_per_article,
|
||||||
unescape,
|
unescape,
|
||||||
|
pagination: {
|
||||||
|
enable: pagination.enable,
|
||||||
|
hitsPerPage: pagination.hitsPerPage
|
||||||
|
},
|
||||||
languages: {
|
languages: {
|
||||||
// search languages
|
// search languages
|
||||||
hits_empty: _p("search.local_search.hits_empty"),
|
hits_empty: _p("search.local_search.hits_empty"),
|
||||||
|
|||||||
@@ -40,10 +40,22 @@ if theme.structured_data
|
|||||||
const isRootOrSubdomain = currentPath.split('/').filter(Boolean).length === 0;
|
const isRootOrSubdomain = currentPath.split('/').filter(Boolean).length === 0;
|
||||||
|
|
||||||
if (isRootOrSubdomain) {
|
if (isRootOrSubdomain) {
|
||||||
|
const domain = new URL(config.url).hostname;
|
||||||
|
const alternateNames = theme.structured_data.alternate_name || [];
|
||||||
|
|
||||||
|
if (config.subtitle) {
|
||||||
|
alternateNames.push(config.subtitle);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (domain) {
|
||||||
|
alternateNames.push(domain);
|
||||||
|
}
|
||||||
|
|
||||||
const jsonLd = {
|
const jsonLd = {
|
||||||
"@context": "https://schema.org",
|
"@context": "https://schema.org",
|
||||||
"@type": "WebSite",
|
"@type": "WebSite",
|
||||||
"name": config.title,
|
"name": config.title,
|
||||||
|
"alternateName": alternateNames,
|
||||||
"url": full_url_for('/'),
|
"url": full_url_for('/'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +1,42 @@
|
|||||||
#loading-box(onclick='document.getElementById("loading-box").classList.add("loaded")')
|
#loading-box
|
||||||
.loading-bg
|
.loading-left-bg
|
||||||
div.loading-img
|
.loading-right-bg
|
||||||
.loading-image-dot
|
.spinner-box
|
||||||
|
.configure-border-1
|
||||||
|
.configure-core
|
||||||
|
.configure-border-2
|
||||||
|
.configure-core
|
||||||
|
.loading-word= _p('loading')
|
||||||
|
|
||||||
script.
|
script.
|
||||||
const preloader = {
|
(()=>{
|
||||||
endLoading: () => {
|
const $loadingBox = document.getElementById('loading-box')
|
||||||
document.body.style.overflow = 'auto';
|
const $body = document.body
|
||||||
document.getElementById('loading-box').classList.add("loaded")
|
const preloader = {
|
||||||
},
|
endLoading: () => {
|
||||||
initLoading: () => {
|
if ($loadingBox.classList.contains('loaded')) return
|
||||||
document.body.style.overflow = '';
|
$body.style.overflow = ''
|
||||||
document.getElementById('loading-box').classList.remove("loaded")
|
$loadingBox.classList.add('loaded')
|
||||||
|
},
|
||||||
|
initLoading: () => {
|
||||||
|
$body.style.overflow = 'hidden'
|
||||||
|
$loadingBox.classList.remove('loaded')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
window.addEventListener('load',()=> { preloader.endLoading() })
|
|
||||||
|
|
||||||
if (!{theme.pjax && theme.pjax.enable}) {
|
preloader.initLoading()
|
||||||
document.addEventListener('pjax:send', () => { preloader.initLoading() })
|
|
||||||
document.addEventListener('pjax:complete', () => { preloader.endLoading() })
|
if (document.readyState === 'complete') {
|
||||||
}
|
preloader.endLoading()
|
||||||
|
} else {
|
||||||
|
window.addEventListener('load', preloader.endLoading)
|
||||||
|
document.addEventListener('DOMContentLoaded', preloader.endLoading)
|
||||||
|
// Add timeout protection: force end after 7 seconds
|
||||||
|
setTimeout(preloader.endLoading, 7000)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!{theme.pjax && theme.pjax.enable}) {
|
||||||
|
btf.addGlobalFn('pjaxSend', preloader.initLoading, 'preloader_init')
|
||||||
|
btf.addGlobalFn('pjaxComplete', preloader.endLoading, 'preloader_end')
|
||||||
|
}
|
||||||
|
})()
|
||||||
Loaded 3 of 15 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user