#article-container
.flink
script.
(()=>{
const replaceSymbol = (str) => {
return str.replace(/[\p{P}\p{S}]/gu, "-")
}
let result = ""
function add(str) {
for(let i = 0; i < str.length; i++){
const replaceClassName = replaceSymbol(str[i].class_name)
const className = str[i].class_name ? `
${str[i].class_name}
` : ""
const classDesc = str[i].class_desc ? `${str[i].class_desc}
` : ""
let listResult = ""
const lists = str[i].link_list
if (!{page.random === true}) {
lists.sort(() => Math.random() - 0.5)
}
for(let j = 0; j < lists.length; j++){
listResult += `
`
}
result += `${className}${classDesc} ${listResult}
`
}
document.querySelector(".flink").insertAdjacentHTML("afterbegin", result)
window.lazyLoadInstance && window.lazyLoadInstance.update()
}
const linkData = !{JSON.stringify(site.data.link)}
if ("!{page.flink_url}") {
fetch("!{url_for(page.flink_url)}")
.then(response => response.json())
.then(add)
} else if (linkData) {
add(linkData)
}
})()
!= page.content