From 39b986376aa5e3651b77a1888ffd0b9af885c193 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Sun, 8 Jul 2018 23:58:16 +0800 Subject: [PATCH] =?UTF-8?q?:apple:=20Anatole=E4=B8=BB=E9=A2=98=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=A1=A8=E6=A0=BC=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cc/ryanc/halo/config/StartupConfig.java | 8 +++--- .../controller/core/InstallController.java | 2 +- .../templates/themes/anatole/page.ftl | 27 ++++++++++++++++++- .../templates/themes/anatole/post.ftl | 27 ++++++++++++++++++- 4 files changed, 57 insertions(+), 7 deletions(-) diff --git a/src/main/java/cc/ryanc/halo/config/StartupConfig.java b/src/main/java/cc/ryanc/halo/config/StartupConfig.java index 180e03ba9..42a62611a 100755 --- a/src/main/java/cc/ryanc/halo/config/StartupConfig.java +++ b/src/main/java/cc/ryanc/halo/config/StartupConfig.java @@ -11,9 +11,9 @@ import cn.hutool.cron.CronUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.event.ApplicationStartedEvent; import org.springframework.context.ApplicationListener; import org.springframework.context.annotation.Configuration; -import org.springframework.context.event.ContextRefreshedEvent; import java.util.List; import java.util.Map; @@ -28,7 +28,7 @@ import java.util.Map; */ @Slf4j @Configuration -public class StartupConfig implements ApplicationListener { +public class StartupConfig implements ApplicationListener { @Autowired private OptionsService optionsService; @@ -37,14 +37,14 @@ public class StartupConfig implements ApplicationListener private AttachmentService attachmentService; @Override - public void onApplicationEvent(ContextRefreshedEvent event) { + public void onApplicationEvent(ApplicationStartedEvent event) { this.loadActiveTheme(); this.loadOptions(); this.loadFiles(); this.loadThemes(); //启动定时任务 CronUtil.start(); - log.info("定时任务启动成功!"); + log.info("The scheduled task starts successfully!"); } /** diff --git a/src/main/java/cc/ryanc/halo/web/controller/core/InstallController.java b/src/main/java/cc/ryanc/halo/web/controller/core/InstallController.java index e377a1e74..0302b3875 100644 --- a/src/main/java/cc/ryanc/halo/web/controller/core/InstallController.java +++ b/src/main/java/cc/ryanc/halo/web/controller/core/InstallController.java @@ -121,7 +121,7 @@ public class InstallController { List categories = new ArrayList<>(); categories.add(category); post.setPostTitle("Hello Halo!"); - post.setPostContentMd("#Hello Halo!\n" + + post.setPostContentMd("# Hello Halo!\n" + "欢迎使用Halo进行创作,删除这篇文章后赶紧开始吧。"); post.setPostContent("

Hello Halo!

欢迎使用Halo进行创作,删除这篇文章后赶紧开始吧。

\n"); post.setPostSummary("欢迎使用Halo进行创作,删除这篇文章后赶紧开始吧。"); diff --git a/src/main/resources/templates/themes/anatole/page.ftl b/src/main/resources/templates/themes/anatole/page.ftl index a3c45aae8..aa0ecafb7 100644 --- a/src/main/resources/templates/themes/anatole/page.ftl +++ b/src/main/resources/templates/themes/anatole/page.ftl @@ -7,6 +7,31 @@ code, tt { font-size: 1.2em; } + table { + border-spacing: 0; + border-collapse: collapse; + margin-top: 0; + margin-bottom: 16px; + display: block; + width: 100%; + overflow: auto; + + } + table th { + font-weight: 600; + } + table th, + table td { + padding: 6px 13px; + border: 1px solid #dfe2e5; + } + table tr { + background-color: #fff; + border-top: 1px solid #c6cbd1; + } + table tr:nth-child(2n) { + background-color: #f6f8fa; + } <#include "module/page-top.ftl">
@@ -54,4 +79,4 @@
-<@footer> \ No newline at end of file +<@footer> diff --git a/src/main/resources/templates/themes/anatole/post.ftl b/src/main/resources/templates/themes/anatole/post.ftl index 7dc3b6bd7..18790fcaa 100644 --- a/src/main/resources/templates/themes/anatole/post.ftl +++ b/src/main/resources/templates/themes/anatole/post.ftl @@ -7,6 +7,31 @@ code, tt { font-size: 1.2em; } + table { + border-spacing: 0; + border-collapse: collapse; + margin-top: 0; + margin-bottom: 16px; + display: block; + width: 100%; + overflow: auto; + + } + table th { + font-weight: 600; + } + table th, + table td { + padding: 6px 13px; + border: 1px solid #dfe2e5; + } + table tr { + background-color: #fff; + border-top: 1px solid #c6cbd1; + } + table tr:nth-child(2n) { + background-color: #f6f8fa; + } <#include "module/page-top.ftl">
@@ -74,4 +99,4 @@
-<@footer> \ No newline at end of file +<@footer>