From 878680149dcb34a78352571d636b68c41b6385bf Mon Sep 17 00:00:00 2001 From: jinqilin721 Date: Fri, 15 May 2020 14:05:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=BE=E5=BA=93=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=9B=E5=A2=9E=E5=8A=A0=E9=9A=8F=E6=9C=BA=E5=B0=81?= =?UTF-8?q?=E9=9D=A2=E5=9B=BE=EF=BC=9B=E5=A2=9E=E5=8A=A0=E4=B8=80=E9=94=AE?= =?UTF-8?q?=E7=81=B0=E8=89=B2=E8=83=8C=E6=99=AF=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/common/article.ftl | 6 +-- layout/common/head.ftl | 24 ++++++++++- layout/plugin/style.theme.ftl | 11 +++++- layout/widget/cate_posts.ftl | 4 +- layout/widget/recent_posts.ftl | 4 +- layout/widget/tag_posts.ftl | 4 +- photos.ftl | 17 +++++++- settings.yaml | 70 +++++++++++++++++++-------------- source/images/cover/0.jpg | Bin 0 -> 5332 bytes source/images/cover/1.jpg | Bin 0 -> 12966 bytes source/images/cover/2.jpg | Bin 0 -> 6213 bytes source/images/cover/3.jpg | Bin 0 -> 15165 bytes source/images/cover/4.jpg | Bin 0 -> 11288 bytes source/images/cover/5.jpg | Bin 0 -> 18488 bytes source/images/cover/6.jpg | Bin 0 -> 9860 bytes source/images/cover/7.jpg | Bin 0 -> 3576 bytes source/images/cover/8.jpg | Bin 0 -> 10329 bytes source/images/cover/9.jpg | Bin 0 -> 15591 bytes theme.yaml | 4 +- 19 files changed, 101 insertions(+), 43 deletions(-) create mode 100644 source/images/cover/0.jpg create mode 100644 source/images/cover/1.jpg create mode 100644 source/images/cover/2.jpg create mode 100644 source/images/cover/3.jpg create mode 100644 source/images/cover/4.jpg create mode 100644 source/images/cover/5.jpg create mode 100644 source/images/cover/6.jpg create mode 100644 source/images/cover/7.jpg create mode 100644 source/images/cover/8.jpg create mode 100644 source/images/cover/9.jpg diff --git a/layout/common/article.ftl b/layout/common/article.ftl index 7cd0443..f6dccb0 100644 --- a/layout/common/article.ftl +++ b/layout/common/article.ftl @@ -4,15 +4,15 @@
style="display: block" > <#if is_post?? || is_page?? || is_sheet??> <#else > - <#if post.thumbnail?? && post.thumbnail!='' && (settings.post_thumbnail_enable?? && settings.post_thumbnail_enable)> + <#if check_post_thumbnail_enable()>
<#if index> - ${post.title!} + ${post.title!} <#else> - ${post.title!} + ${post.title!}
diff --git a/layout/common/head.ftl b/layout/common/head.ftl index eaa043d..c7026b3 100644 --- a/layout/common/head.ftl +++ b/layout/common/head.ftl @@ -5,4 +5,26 @@ <#else> <#assign theme_base = settings.theme_static_base> - \ No newline at end of file + + +<#function check_post_thumbnail_enable> + <#return (settings.post_thumbnail_enable?? && settings.post_thumbnail_enable != 'false')> + + +<#assign time_count = 0> +<#function post_thumbnail_url src> + <#assign time_count = time_count + 1> + <#if check_post_thumbnail_enable()> + <#assign timestamp = .now?long + time_count> + <#assign random_pic = timestamp?substring(timestamp?length - 1) + ".jpg"> + <#if settings.post_thumbnail_enable == 'true'> + <#if src != ''> + <#return src> + <#else> + <#return theme_base + "/source/images/cover/" + random_pic> + + <#elseif settings.post_thumbnail_enable == 'random_pic'> + <#return theme_base + "/source/images/cover/" + random_pic> + + + \ No newline at end of file diff --git a/layout/plugin/style.theme.ftl b/layout/plugin/style.theme.ftl index 4b8f1ef..5999b1d 100644 --- a/layout/plugin/style.theme.ftl +++ b/layout/plugin/style.theme.ftl @@ -1,5 +1,14 @@ -