mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
feat: 支持随机友链
This commit is contained in:
parent
28d1744b9b
commit
759e63b643
@ -2,6 +2,7 @@
|
|||||||
.flink
|
.flink
|
||||||
- let pageContent = page.content
|
- let pageContent = page.content
|
||||||
if page.flink_url
|
if page.flink_url
|
||||||
|
- let pageRandom = page.random
|
||||||
script.
|
script.
|
||||||
(()=>{
|
(()=>{
|
||||||
const replaceSymbol = (str) => {
|
const replaceSymbol = (str) => {
|
||||||
@ -19,6 +20,9 @@
|
|||||||
|
|
||||||
let listResult = ""
|
let listResult = ""
|
||||||
const lists = str[i].link_list
|
const lists = str[i].link_list
|
||||||
|
if (!{pageRandom}) {
|
||||||
|
lists.sort(() => Math.random() - 0.5)
|
||||||
|
}
|
||||||
for(let j = 0; j < lists.length; j++){
|
for(let j = 0; j < lists.length; j++){
|
||||||
listResult += `
|
listResult += `
|
||||||
<div class="flink-list-item">
|
<div class="flink-list-item">
|
||||||
@ -48,8 +52,8 @@
|
|||||||
- let classDesc = i.class_desc ? `<div class="flink-desc">${i.class_desc}</div>` : ""
|
- let classDesc = i.class_desc ? `<div class="flink-desc">${i.class_desc}</div>` : ""
|
||||||
|
|
||||||
- let listResult = ""
|
- let listResult = ""
|
||||||
|
- let list = page.random ? i.link_list.slice().sort(() => Math.random() - 0.5) : i.link_list
|
||||||
each j in i.link_list
|
each j in list
|
||||||
-
|
-
|
||||||
listResult += `
|
listResult += `
|
||||||
<div class="flink-list-item">
|
<div class="flink-list-item">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user