mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 19:40:55 +08:00
Update flink.pug
This commit is contained in:
committed by
GitHub
Unverified
parent
0066457cf0
commit
5944ffd811
@@ -1,7 +1,10 @@
|
|||||||
#article-container
|
#article-container
|
||||||
.flink
|
.flink
|
||||||
- let pageContent = page.content
|
- let { content, random, flink_url } = page
|
||||||
if page.flink_url || page.random
|
- let pageContent = content
|
||||||
|
|
||||||
|
if flink_url || random
|
||||||
|
- const linkData = flink_url ? false : site.data.link || false
|
||||||
script.
|
script.
|
||||||
(()=>{
|
(()=>{
|
||||||
const replaceSymbol = (str) => {
|
const replaceSymbol = (str) => {
|
||||||
@@ -17,7 +20,7 @@
|
|||||||
|
|
||||||
let listResult = ""
|
let listResult = ""
|
||||||
const lists = str[i].link_list
|
const lists = str[i].link_list
|
||||||
if (!{page.random === true}) {
|
if (!{random === true}) {
|
||||||
lists.sort(() => Math.random() - 0.5)
|
lists.sort(() => Math.random() - 0.5)
|
||||||
}
|
}
|
||||||
for(let j = 0; j < lists.length; j++){
|
for(let j = 0; j < lists.length; j++){
|
||||||
@@ -40,9 +43,9 @@
|
|||||||
window.lazyLoadInstance && window.lazyLoadInstance.update()
|
window.lazyLoadInstance && window.lazyLoadInstance.update()
|
||||||
}
|
}
|
||||||
|
|
||||||
const linkData = !{JSON.stringify(site.data.link || null)}
|
const linkData = !{JSON.stringify(linkData)}
|
||||||
if ("!{page.flink_url}") {
|
if (!{Boolean(flink_url)}) {
|
||||||
fetch("!{url_for(page.flink_url)}")
|
fetch("!{url_for(flink_url)}")
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(add)
|
.then(add)
|
||||||
} else if (linkData) {
|
} else if (linkData) {
|
||||||
|
|||||||
Reference in New Issue
Block a user