#article-container
.flink
if page.flink_url
script.
(()=>{
const replaceSymbol = (str) => {
return str.replace(/[\p{P}\p{S}]/gu, '-')
}
let result = ''
fetch('!{url_for(page.flink_url)}')
.then(response => response.json())
.then(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
for(let j = 0; j < lists.length; j++){
listResult += `
`
}
result += `${className}${classDesc} ${listResult}
`
}
document.querySelector('.flink').insertAdjacentHTML('afterbegin', result)
})
})()
else
if site.data.link
each i in site.data.link
if i.class_name
!=markdown(`## ${i.class_name}`)
if i.class_desc
.flink-desc!=i.class_desc
.flink-list
each item in i.link_list
.flink-list-item
a(href=url_for(item.link) title=item.name target="_blank")
.flink-item-icon
img.no-lightbox(src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name )
.flink-item-name= item.name
.flink-item-desc(title=item.descr)= item.descr
!= page.content