From de88dfde651f1f8203d2f4d6b4de9e51b95d6192 Mon Sep 17 00:00:00 2001 From: liuzhihang Date: Sat, 22 Oct 2022 13:25:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=9A=8F=E6=9C=BA=E5=9B=BE?= =?UTF-8?q?=E7=89=87=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- settings.yaml | 45 +++++--------------------------- templates/modules/post-list.html | 7 ++--- templates/post.html | 5 ++-- 3 files changed, 13 insertions(+), 44 deletions(-) diff --git a/settings.yaml b/settings.yaml index d607c2f3..424bbe35 100644 --- a/settings.yaml +++ b/settings.yaml @@ -89,45 +89,12 @@ spec: - label: 四列 value: col4 help: "选择单列时,文章卡片的图片将位于左侧" - - $formkit: select - name: header_widget - label: 首页顶部模块 - value: none - options: - - label: 无 - value: none - - label: 最新一篇文章 - value: latest_post - - label: 文章网格(最新五篇文章) - value: latest_post_grid - - label: 轮播图 - value: carousel - - label: 站点标题 - value: site_title - - $formkit: select - name: header_background_type - label: 首页顶部背景 - value: manual - options: - - label: 手动设置 - value: manual - - label: 图片 - value: image - - $formkit: text - name: header_background - label: 首页顶部背景 - - $formkit: text - name: header_background_image - label: 首页顶部背景图片 - - $formkit: radio - name: content_header - label: 文章页顶部 - value: true - options: - - label: 显示 - value: true - - label: 隐藏 - value: false + - $formkit: url + name: post_random_img + label: 博客封面随机 API + validation: "url" + value: "https://source.unsplash.com/random/600x400/?blog,scenery,night,desert,sea" + help: 默认随机封面图 url 不能保证一直可用 - group: sidebar label: 侧边栏 formSchema: diff --git a/templates/modules/post-list.html b/templates/modules/post-list.html index 11feea25..05a3fe68 100644 --- a/templates/modules/post-list.html +++ b/templates/modules/post-list.html @@ -7,12 +7,12 @@
+
- + th:src="${#strings.isEmpty(post.spec.cover) ? theme.config.layout.post_random_img : post.spec.cover}">
@@ -64,6 +64,7 @@
+