diff --git a/blog-admin/src/main/resources/templates/config.ftl b/blog-admin/src/main/resources/templates/config.ftl index 14fd6549fb79c47b26063fce81ba5ae95ffd5362..91939464bfd29135fe0eef9455c07ddd438b163b 100644 --- a/blog-admin/src/main/resources/templates/config.ftl +++ b/blog-admin/src/main/resources/templates/config.ftl @@ -502,6 +502,12 @@ +
+ +
+ +
+
diff --git a/blog-core/src/main/java/com/zyd/blog/business/enums/ConfigKeyEnum.java b/blog-core/src/main/java/com/zyd/blog/business/enums/ConfigKeyEnum.java index 00c396453f3a853ee6a0be9cbaeb700469893a39..8589c2eacd73edf632f0f147c1abe82382eb8907 100644 --- a/blog-core/src/main/java/com/zyd/blog/business/enums/ConfigKeyEnum.java +++ b/blog-core/src/main/java/com/zyd/blog/business/enums/ConfigKeyEnum.java @@ -186,6 +186,11 @@ public enum ConfigKeyEnum { * 网站安装时间,默认为执行init_data.sql的时间 */ INSTALLDATE("installdate"), + + /** + * 当切换浏览器tab时,在原tab上的标题。比如https://www.zhyd.me上的“麻溜儿回来~~~” + */ + DYNAMIC_TITLE("dynamicTitle"), ; private String key; diff --git a/blog-web/src/main/resources/static/js/zhyd.js b/blog-web/src/main/resources/static/js/zhyd.js index f22ace42509fce941792d6910ab24ce382e39f0d..3195164bc557d7f1cd8710b0404ad80d50721d81 100644 --- a/blog-web/src/main/resources/static/js/zhyd.js +++ b/blog-web/src/main/resources/static/js/zhyd.js @@ -10,7 +10,9 @@ // 动态切换浏览器窗口title https://zhangge.net/ jQuery(document).ready(function() { function c() { - document.title = document[a] ? "麻溜儿回来~~~ | " + d + "" : d + var dynamicTitle = appConfig.dynamicTitle; + dynamicTitle = dynamicTitle ? dynamicTitle + " | " : ""; + document.title = document[a] ? dynamicTitle + d + "" : d } var a, b, d = document.title; "undefined" != typeof document.hidden ? (a = "hidden", b = "visibilitychange") : "undefined" != typeof document.mozHidden ? (a = "mozHidden", b = "mozvisibilitychange") : "undefined" != typeof document.webkitHidden && (a = "webkitHidden", b = "webkitvisibilitychange"); diff --git a/blog-web/src/main/resources/templates/about.ftl b/blog-web/src/main/resources/templates/about.ftl index 271b8f250e579de6f3186ed7d8560888685a8635..b0f20b13df502db958cd389a98edbc51d5952d41 100644 --- a/blog-web/src/main/resources/templates/about.ftl +++ b/blog-web/src/main/resources/templates/about.ftl @@ -1,5 +1,5 @@ <#include "include/macros.ftl"> -<@compress single_line=true> +<@compress single_line=false> <@header title="关于 | ${config.siteName}" description="关于${config.siteName}" canonical="/about">
diff --git a/blog-web/src/main/resources/templates/archives.ftl b/blog-web/src/main/resources/templates/archives.ftl index 19914f60b5c3fcdada2fe01df9db533d360b30c5..ca3863c56a57bf34141117fc398a8b94bd84f46c 100644 --- a/blog-web/src/main/resources/templates/archives.ftl +++ b/blog-web/src/main/resources/templates/archives.ftl @@ -1,5 +1,5 @@ <#include "include/macros.ftl"> -<@compress single_line=true> +<@compress single_line=false> <@header title="归档目录 | ${config.siteName}" description="归档目录" canonical="/archives">
diff --git a/blog-web/src/main/resources/templates/disclaimer.ftl b/blog-web/src/main/resources/templates/disclaimer.ftl index 77abc9e2abbe4ae8d4da0329188b8c6cce6ffa93..b413a2cdbe46e519e240f63349a5e66028cc4370 100644 --- a/blog-web/src/main/resources/templates/disclaimer.ftl +++ b/blog-web/src/main/resources/templates/disclaimer.ftl @@ -1,5 +1,5 @@ <#include "include/macros.ftl"> -<@compress single_line=true> +<@compress single_line=false> <@header title="免责声明 | ${config.siteName}" keywords="" description="免责声明" canonical="/disclaimer">
diff --git a/blog-web/src/main/resources/templates/guestbook.ftl b/blog-web/src/main/resources/templates/guestbook.ftl index b5b02c2ab9db16d7b199b29a50a8956cec789e19..02837fbd21547329870b823e08ea39833f181b9e 100644 --- a/blog-web/src/main/resources/templates/guestbook.ftl +++ b/blog-web/src/main/resources/templates/guestbook.ftl @@ -1,5 +1,5 @@ <#include "include/macros.ftl"> -<@compress single_line=true> +<@compress single_line=false> <@header title="留言板 | ${config.siteName}" canonical="/guestbook" hasEditor=true> diff --git a/blog-web/src/main/resources/templates/index.ftl b/blog-web/src/main/resources/templates/index.ftl index adbd51a0150c794d1e17b9a1ba248acca6cafdea..482c1b3cb281f2630e256d9c0bf7b4b0dbb4751a 100644 --- a/blog-web/src/main/resources/templates/index.ftl +++ b/blog-web/src/main/resources/templates/index.ftl @@ -1,5 +1,5 @@ <#include "include/macros.ftl"> -<@compress single_line=true> +<@compress single_line=false> <@header title="${config.siteName!} | 一个程序员的个人博客" keywords="${config.homeKeywords!}" description="${config.homeDesc!}" diff --git a/blog-web/src/main/resources/templates/layout/footer.ftl b/blog-web/src/main/resources/templates/layout/footer.ftl index 7a510975228a886a29863d7c84f2dd6390499271..00f99aa282b6e92d99056aa33cd8b4e6aa52cfda 100644 --- a/blog-web/src/main/resources/templates/layout/footer.ftl +++ b/blog-web/src/main/resources/templates/layout/footer.ftl @@ -160,7 +160,8 @@ zfbPraiseCode: '${config.zfbPraiseCode}', anonymous: '${config.anonymous}', editorPlaceholder: '${config.editorPlaceholder}', - editorAlert: '${config.editorAlert}' + editorAlert: '${config.editorAlert}', + dynamicTitle: '${config.dynamicTitle}' }; var oauthConfig = { diff --git a/blog-web/src/main/resources/templates/links.ftl b/blog-web/src/main/resources/templates/links.ftl index d1c4ecf42ad8931a0a829e32dc0365f5c6227147..399eb1d4d773c7af179e441d7579a4ab4dc35bd9 100644 --- a/blog-web/src/main/resources/templates/links.ftl +++ b/blog-web/src/main/resources/templates/links.ftl @@ -1,5 +1,5 @@ <#include "include/macros.ftl"> -<@compress single_line=true> +<@compress single_line=false> <@header title="友情链接 | ${config.siteName}" description="${config.siteName},友情链接交换" canonical="/links"> diff --git a/blog-web/src/main/resources/templates/recommended.ftl b/blog-web/src/main/resources/templates/recommended.ftl index 2607fd82a0b2395009505cecc29239b89da9bbf2..059b7bdb497ddd92c45e1d76ede3ea8caf5625a8 100644 --- a/blog-web/src/main/resources/templates/recommended.ftl +++ b/blog-web/src/main/resources/templates/recommended.ftl @@ -1,5 +1,5 @@ <#include "include/macros.ftl"> -<@compress single_line=true> +<@compress single_line=false> <@header title="站长推荐 | ${config.siteName}" description="站长推荐" canonical="/recommended"> diff --git a/blog-web/src/main/resources/templates/updateLog.ftl b/blog-web/src/main/resources/templates/updateLog.ftl index 332e98dcb9068c533b12878111d406db898a7c04..5d2d03d2e920b1b2932a193922204626e1aabd64 100644 --- a/blog-web/src/main/resources/templates/updateLog.ftl +++ b/blog-web/src/main/resources/templates/updateLog.ftl @@ -1,5 +1,5 @@ <#include "include/macros.ftl"> -<@compress single_line=true> +<@compress single_line=false> <@header title="网站更新记录 | ${config.siteName!}" description="网站更新维护日志" canonical="/updateLog">