Skip to content

Commit

Permalink
feat(fcircle): 支持初始文章数量设置、本地缓存时间设置
Browse files Browse the repository at this point in the history
  • Loading branch information
penndu authored and 0fuling0 committed Sep 30, 2024
1 parent 2fefbd9 commit d705ca4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -935,10 +935,12 @@ plugins:
fcircle:
# Set `plugins: ["fcircle"]` to enable in front-matter
private_api_url: https://fcircle-api.example.com/ # api 地址
page_init_number: 20 # 初始加载几篇文章
page_turning_number: 10 # 点击加载更多时,一次最多加载几篇文章,默认10
error_img: https://cravatar.cn/avatar/57d8260dfb55501c37dde588e7c3852c # 头像加载失败时,默认头像地址
sort_rule: created # 进入页面时第一次的排序规则,可选值:created/updated
js: https://npm.elemecdn.com/[email protected]/dist/fcircle.min.js # fcircle.min.js的url
expire_days: 1 # 本地文章缓存数据过期时间(天)
js: https://npm.elemecdn.com/[email protected]/dist/fcircle.min.js # fcircle.min.js的url

# 消息提示
# izitoast
Expand Down
4 changes: 3 additions & 1 deletion layout/_plugins/_page_plugins/fcircle/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
<script>
let UserConfig = {
private_api_url: '<%- theme.plugins.fcircle.private_api_url %>',
page_init_number: '<%- theme.plugins.fcircle.page_init_number %>',
page_turning_number: '<%- theme.plugins.fcircle.page_turning_number %>',
error_img: '<%- theme.plugins.fcircle.error_img%>',
sort_rule: '<%- theme.plugins.fcircle.sort_rule %>'
sort_rule: '<%- theme.plugins.fcircle.sort_rule %>',
expire_days: '<%- theme.plugins.fcircle.expire_days %>'
}
</script>
<script type="text/javascript" src="<%- theme.plugins.fcircle.js %>"></script>

0 comments on commit d705ca4

Please sign in to comment.