diff --git a/_config.yml b/_config.yml index 0a34a9c3..3c79f4ac 100644 --- a/_config.yml +++ b/_config.yml @@ -430,8 +430,8 @@ says: # 1:张洪heo样式 / 2:Leonus样式 # 1: Zhang Hong heo style / 2: Leonus style style: 1 - # 即刻短文数量(条)。建议范围:1 ~ 999,当数量为-1时,将显示全部。 - # Number of immediate short articles (pieces). Suggested range: 1~999, when the quantity is -1, all will be displayed. + # 即刻短文仅展示前n条 + # Jike short text only shows the first n strip: 30 # 模式选择。local:本地静态 / json:动态json / memos:动态Memos # Mode selection. Local: local static/JSON: dynamic JSON/memory: dynamic Memos diff --git a/layout/includes/widgets/page/says/json.pug b/layout/includes/widgets/page/says/json.pug index 77a75891..40afd33a 100644 --- a/layout/includes/widgets/page/says/json.pug +++ b/layout/includes/widgets/page/says/json.pug @@ -2,11 +2,10 @@ case theme.says.style when 1 script. !async function () { - let say_strip = !{theme.says.strip} await fetch('!{url_for(theme.says.mode_link)}') .then(res => res.json()) .then(res => { - let list = say_strip === -1 || say_strip >= res.length ? res : res.slice(0, say_strip) + let list = res.slice(0, !{theme.says.strip}) let aplayer = null let video = null let imageBox = null @@ -43,11 +42,10 @@ case theme.says.style when 2 script. !async function () { - let say_strip = !{theme.says.strip} await fetch('!{url_for(theme.says.mode_link)}') .then(res => res.json()) .then(res => { - let list = say_strip === -1 || say_strip >= res.length ? res : res.slice(0, say_strip) + let list = res.slice(0, !{theme.says.strip}) let aplayer = null let video = null let imageBox = null diff --git a/layout/includes/widgets/page/says/local.pug b/layout/includes/widgets/page/says/local.pug index 7f281cfc..e10f4826 100644 --- a/layout/includes/widgets/page/says/local.pug +++ b/layout/includes/widgets/page/says/local.pug @@ -1,8 +1,4 @@ -if theme.says.strip === -1 - - var limitedList = site.data.essay.essay_list -else - - var limitedList = site.data.essay.essay_list.slice(0, theme.says.strip) -each item in limitedList +each item in site.data.essay.essay_list.slice(0, theme.says.strip) li.item if theme.says.style === 2 .meta @@ -45,4 +41,4 @@ each item in limitedList | 链接 if item.content a.bber-reply(onclick=`sco.toTalk('${item.content}')`) - i.scoicon.sco-chat-fill(style="font-size: 1rem;") \ No newline at end of file + i.scoicon.sco-chat-fill \ No newline at end of file diff --git a/layout/includes/widgets/page/says/memos.pug b/layout/includes/widgets/page/says/memos.pug index 637e1173..8866f9a8 100644 --- a/layout/includes/widgets/page/says/memos.pug +++ b/layout/includes/widgets/page/says/memos.pug @@ -2,7 +2,6 @@ case theme.says.style when 1 script. !async function () { - let say_strip = !{theme.says.strip}; let aplayerRegex = /{aplayer,(.*?),(.*?)}/g; let linkRegex = /(? res.json()) .then(data => { - let list = say_strip === -1 || say_strip >= data.length ? data : data.slice(0, say_strip); + let list = data.slice(0, !{theme.says.strip}); let aplayer = null; let video = null; let imageBox = null; @@ -59,7 +58,6 @@ case theme.says.style when 2 script. !async function () { - let say_strip = !{theme.says.strip}; let aplayerRegex = /{aplayer,(.*?),(.*?)}/g; let bilibiliRegex = /{bilibili,(.*?)}/g; let playerRegex = /{player,(.*?)}/g; @@ -69,7 +67,7 @@ case theme.says.style await fetch("!{url_for(theme.says.mode_link)}") .then(res => res.json()) .then(data => { - let list = say_strip === -1 || say_strip >= data.length ? data : data.slice(0, say_strip); + let list = data.slice(0, !{theme.says.strip}) let aplayer = null; let video = null; let imageBox = null;