From b8e6629b8b7e2f92149268ccd3f634995b1b1632 Mon Sep 17 00:00:00 2001 From: JiJi Date: Wed, 24 Aug 2022 15:28:14 +0800 Subject: [PATCH] Add margin offset --- README.md | 1 + dist/templates/bgm-template.ejs | 4 ++-- src/lib/bangumi-generator.js | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f93f1b9..d256045 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ bangumis: bgmtv_uid: mmdjiji # bgm.tv的uid download_image: true # 下载图片并使用本地图片,否则使用bgm.tv提供的网络图源 lazyload: true # 是否开启懒加载 + margin: 20px # 封面图的偏移量微调 ``` ## 使用 diff --git a/dist/templates/bgm-template.ejs b/dist/templates/bgm-template.ejs index 37adda4..c0855c8 100644 --- a/dist/templates/bgm-template.ejs +++ b/dist/templates/bgm-template.ejs @@ -1,9 +1,9 @@
<% if(download_image) { %> - " <%- lazyload ? ` data-src="/images/${item.image}"` : '' %> referrerPolicy="no-referrer" width="110" style="width:110px;margin:20px auto;" /> + " <%- lazyload ? ` data-src="/images/${item.image}"` : '' %> referrerPolicy="no-referrer" width="110" style="width:110px;margin:<%= margin %> auto;" /> <% } else { %> - " <%- lazyload ? ` data-src="https://lain.bgm.tv/pic/cover/c/${item.image}"` : '' %> referrerPolicy="no-referrer" width="110" style="width:110px;margin:20px auto;" /> + " <%- lazyload ? ` data-src="https://lain.bgm.tv/pic/cover/c/${item.image}"` : '' %> referrerPolicy="no-referrer" width="110" style="width:110px;margin:<%= margin %> auto;" /> <% } %>
diff --git a/src/lib/bangumi-generator.js b/src/lib/bangumi-generator.js index fbb7816..bb4efd7 100644 --- a/src/lib/bangumi-generator.js +++ b/src/lib/bangumi-generator.js @@ -40,6 +40,7 @@ module.exports = async function (locals) { color_meta: config.bangumis.color_meta ? `style="color:${config.bangumis.color_meta}"` : '', color: config.bangumis.color ? `style="color:${config.bangumis.color}"` : '', lazyload: config.bangumis.lazyload ?? true, + margin: config.bangumis.margin ?? '20px', download_image: config.bangumis.download_image ?? false, wantWatch, watched,