Skip to content

Commit

Permalink
✨feat: update essay
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose wan committed Jan 27, 2024
1 parent 40e098a commit 7cc9cdb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
4 changes: 2 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions layout/includes/widgets/page/says/json.pug
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions layout/includes/widgets/page/says/local.pug
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;")
i.scoicon.sco-chat-fill
6 changes: 2 additions & 4 deletions layout/includes/widgets/page/says/memos.pug
Original file line number Diff line number Diff line change
Expand Up @@ -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 = /(?<!\!)\[([^\]]*)\]\(([^\)]*)\)/g;
let bilibiliRegex = /{bilibili,(.*?)}/g;
Expand All @@ -13,7 +12,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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 7cc9cdb

Please sign in to comment.