From e2080eabf9050d38103e0b892b7f9a72074d627b Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 16 Mar 2024 23:20:25 +0800 Subject: [PATCH] =?UTF-8?q?movie=E4=B8=BB=E9=A2=98=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E3=80=81dplayer=E5=8A=A0=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/videos/dplayer.html | 50 +++++++++++++++++++++++++ themes/movie/components/BlogPostCard.js | 4 +- themes/movie/components/CategoryItem.js | 2 +- themes/movie/components/TagItem.js | 5 +-- themes/movie/components/TagItemMini.js | 4 +- themes/movie/config.js | 1 + themes/movie/index.js | 9 +++-- 7 files changed, 63 insertions(+), 12 deletions(-) create mode 100644 public/videos/dplayer.html diff --git a/public/videos/dplayer.html b/public/videos/dplayer.html new file mode 100644 index 00000000..66573c2b --- /dev/null +++ b/public/videos/dplayer.html @@ -0,0 +1,50 @@ + + + + + + + DPlayer Video Player + + + + + + + +
+ + + + + + + + + + \ No newline at end of file diff --git a/themes/movie/components/BlogPostCard.js b/themes/movie/components/BlogPostCard.js index eadcfb7c..61954610 100644 --- a/themes/movie/components/BlogPostCard.js +++ b/themes/movie/components/BlogPostCard.js @@ -23,11 +23,11 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { -
+
{post?.tagItems && post?.tagItems.length > 0 && ( <>
diff --git a/themes/movie/components/CategoryItem.js b/themes/movie/components/CategoryItem.js index d69de464..1190965b 100644 --- a/themes/movie/components/CategoryItem.js +++ b/themes/movie/components/CategoryItem.js @@ -12,7 +12,7 @@ export default function CategoryItem({ category }) { href={`/category/${category.name}`} passHref legacyBehavior> -
+
{category.name}({category.count})
diff --git a/themes/movie/components/TagItem.js b/themes/movie/components/TagItem.js index dab00325..c608c8cb 100644 --- a/themes/movie/components/TagItem.js +++ b/themes/movie/components/TagItem.js @@ -12,10 +12,9 @@ export default function TagItem({ tag }) { key={tag} href={`/tag/${encodeURIComponent(tag.name)}`} passHref - className={`cursor-pointer inline-block rounded hover:bg-gray-500 hover:text-white duration-200 mr-2 py-1 px-2 text-xs whitespace-nowrap dark:hover:text-white text-gray-600 hover:shadow-xl notion-${tag.color}_background dark:bg-gray-800`} + className={`cursor-pointer inline-block rounded duration-200 mr-2 py-1 px-2 text-xs whitespace-nowrap`} > -
- {' '} +
{tag.name + (tag.count ? `(${tag.count})` : '')}{' '}
diff --git a/themes/movie/components/TagItemMini.js b/themes/movie/components/TagItemMini.js index e5d29782..a4b7da1c 100644 --- a/themes/movie/components/TagItemMini.js +++ b/themes/movie/components/TagItemMini.js @@ -6,9 +6,9 @@ const TagItemMini = ({ tag, selected = false }) => { key={tag} href={selected ? '/' : `/tag/${encodeURIComponent(tag.name)}`} passHref - className={'inline-block rounded-xl py-0.5 mr-2 text-[#2EBF8B]'} + className={'inline-block rounded-xl py-0.5 mr-2'} > -
+
{selected && }{' '} {tag.name + (tag.count ? `(${tag.count})` : '')}{' '}
diff --git a/themes/movie/config.js b/themes/movie/config.js index ad775bbd..a2c5fd4d 100644 --- a/themes/movie/config.js +++ b/themes/movie/config.js @@ -9,6 +9,7 @@ const CONFIG = { MOVIE_MENU_SEARCH: true, // 显示搜索 MOVIE_ARTICLE_RECOMMEND: true, // 推荐关联内容在文章底部 + MOVIE_VIDEO_COMBINE: true, // 聚合视频,开启后一篇文章内的多个含caption的视频会被合并到文章开头,并展示分集按钮 MOVIE_POST_LIST_COVER: true // 列表显示文章封面 } diff --git a/themes/movie/index.js b/themes/movie/index.js index 75e9abae..5b7f9184 100644 --- a/themes/movie/index.js +++ b/themes/movie/index.js @@ -64,7 +64,7 @@ const LayoutBase = props => {
{/* 主体 */} -
+
{/* 标题栏 */} {/* {fullWidth ? null : } */} @@ -223,12 +223,13 @@ const LayoutSlug = props => { figCaptionWrapper.appendChild(div) }) - // 将包含 figcaption 值的容器元素添加到 notion-article 的第一个子元素插入 - videoWrapper.appendChild(carouselWrapper) + // 条件是带有caption的视频数量大于1个,否则不处理 if (figCaptionValues.length > 1) { + // 将包含 figcaption 值的容器元素添加到 notion-article 的第一个子元素插入 + videoWrapper.appendChild(carouselWrapper) videoWrapper.appendChild(figCaptionWrapper) + notionArticle.insertBefore(videoWrapper, notionArticle.firstChild) } - notionArticle.insertBefore(videoWrapper, notionArticle.firstChild) } setTimeout(() => {