Commit 862f4dc4 authored by Liang Ding's avatar Liang Ding

🎨 #12706

parent de875966
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)"> <meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)">
<title>Solo Change Logs</title> <title>Solo Change Logs</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="apple-touch-icon" href="/favicon.png"> <link rel="apple-touch-icon" href="https://static.b3log.org/images/brand/solo-32.png">
<style> <style>
a { a {
color: #4285f4; color: #4285f4;
......
...@@ -176,8 +176,15 @@ public class IndexProcessor { ...@@ -176,8 +176,15 @@ public class IndexProcessor {
dataModel.put(Common.REFERER, referer); dataModel.put(Common.REFERER, referer);
Keys.fillRuntime(dataModel); Keys.fillRuntime(dataModel);
dataModelService.fillMinified(dataModel); dataModelService.fillMinified(dataModel);
Solos.addGoogleNoIndex(context); Solos.addGoogleNoIndex(context);
try {
final JSONObject preference = optionQueryService.getPreference();
dataModelService.fillCommon(context, dataModel, preference);
} catch (final Exception e) {
LOGGER.log(Level.ERROR, e.getMessage(), e);
context.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
} }
/** /**
......
...@@ -41,7 +41,10 @@ import org.b3log.latke.servlet.renderer.AbstractFreeMarkerRenderer; ...@@ -41,7 +41,10 @@ import org.b3log.latke.servlet.renderer.AbstractFreeMarkerRenderer;
import org.b3log.latke.util.Execs; import org.b3log.latke.util.Execs;
import org.b3log.latke.util.Strings; import org.b3log.latke.util.Strings;
import org.b3log.solo.SoloServletListener; import org.b3log.solo.SoloServletListener;
import org.b3log.solo.model.*; import org.b3log.solo.model.Common;
import org.b3log.solo.model.Option;
import org.b3log.solo.model.Skin;
import org.b3log.solo.model.UserExt;
import org.b3log.solo.service.DataModelService; import org.b3log.solo.service.DataModelService;
import org.b3log.solo.service.ExportService; import org.b3log.solo.service.ExportService;
import org.b3log.solo.service.OptionQueryService; import org.b3log.solo.service.OptionQueryService;
...@@ -142,7 +145,6 @@ public class AdminConsole { ...@@ -142,7 +145,6 @@ public class AdminConsole {
dataModel.put(Common.YEAR, String.valueOf(Calendar.getInstance().get(Calendar.YEAR))); dataModel.put(Common.YEAR, String.valueOf(Calendar.getInstance().get(Calendar.YEAR)));
dataModel.put(Option.ID_C_ARTICLE_LIST_DISPLAY_COUNT, preference.getInt(Option.ID_C_ARTICLE_LIST_DISPLAY_COUNT)); dataModel.put(Option.ID_C_ARTICLE_LIST_DISPLAY_COUNT, preference.getInt(Option.ID_C_ARTICLE_LIST_DISPLAY_COUNT));
dataModel.put(Option.ID_C_ARTICLE_LIST_PAGINATION_WINDOW_SIZE, preference.getInt(Option.ID_C_ARTICLE_LIST_PAGINATION_WINDOW_SIZE)); dataModel.put(Option.ID_C_ARTICLE_LIST_PAGINATION_WINDOW_SIZE, preference.getInt(Option.ID_C_ARTICLE_LIST_PAGINATION_WINDOW_SIZE));
dataModel.put(Option.ID_C_LOCALE_STRING, preference.getString(Option.ID_C_LOCALE_STRING));
dataModel.put(Skin.SKIN_DIR_NAME, preference.getString(Skin.SKIN_DIR_NAME)); dataModel.put(Skin.SKIN_DIR_NAME, preference.getString(Skin.SKIN_DIR_NAME));
Keys.fillRuntime(dataModel); Keys.fillRuntime(dataModel);
dataModelService.fillMinified(dataModel); dataModelService.fillMinified(dataModel);
...@@ -158,6 +160,7 @@ public class AdminConsole { ...@@ -158,6 +160,7 @@ public class AdminConsole {
dataModel.put(Common.UPLOAD_URL, upload.optString(Common.UPLOAD_URL)); dataModel.put(Common.UPLOAD_URL, upload.optString(Common.UPLOAD_URL));
dataModel.put(Common.UPLOAD_MSG, upload.optString(Common.UPLOAD_MSG)); dataModel.put(Common.UPLOAD_MSG, upload.optString(Common.UPLOAD_MSG));
} }
dataModelService.fillCommon(context, dataModel, preference);
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.log(Level.ERROR, "Admin index render failed", e); LOGGER.log(Level.ERROR, "Admin index render failed", e);
} }
......
...@@ -545,8 +545,7 @@ public class DataModelService { ...@@ -545,8 +545,7 @@ public class DataModelService {
* @param preference the specified preference * @param preference the specified preference
* @throws ServiceException service exception * @throws ServiceException service exception
*/ */
public void fillCommon(final RequestContext context, final Map<String, Object> dataModel, final JSONObject preference) public void fillCommon(final RequestContext context, final Map<String, Object> dataModel, final JSONObject preference) throws ServiceException {
throws ServiceException {
fillSide(context, dataModel, preference); fillSide(context, dataModel, preference);
fillBlogHeader(context, dataModel, preference); fillBlogHeader(context, dataModel, preference);
fillBlogFooter(context, dataModel, preference); fillBlogFooter(context, dataModel, preference);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)"> <meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)">
<title>Solo Change Logs</title> <title>Solo Change Logs</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="apple-touch-icon" href="/favicon.png"> <link rel="apple-touch-icon" href="https://static.b3log.org/images/brand/solo-32.png">
<style> <style>
a { a {
color: #4285f4; color: #4285f4;
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
<static-files> <static-files>
<!-- Uses the STANDARD Ant Path Pattern to configure these paths! --> <!-- Uses the STANDARD Ant Path Pattern to configure these paths! -->
<include path="/favicon.png"/>
<include path="/robots.txt"/> <include path="/robots.txt"/>
<include path="/sw.js"/> <include path="/sw.js"/>
<include path="/manifest.json"/> <include path="/manifest.json"/>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<title>${adminConsoleLabel} - ${blogTitle}</title> <title>${adminConsoleLabel} - ${blogTitle}</title>
<link type="text/css" rel="stylesheet" href="${staticServePath}/scss/admin.css?${staticResourceVersion}" /> <link type="text/css" rel="stylesheet" href="${staticServePath}/scss/admin.css?${staticResourceVersion}" />
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@9.15.6/styles/atom-one-light.min.css" /> <link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@9.15.6/styles/atom-one-light.min.css" />
<link rel="icon" type="image/png" href="${staticServePath}/favicon.png" /> <link rel="icon" type="image/png" href="${faviconURL}" />
<link rel="manifest" href="${servePath}/manifest.json"> <link rel="manifest" href="${servePath}/manifest.json">
</head> </head>
<body onhashchange="admin.setCurByHash();"> <body onhashchange="admin.setCurByHash();">
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
<title>${title}<#if blogTitle??> - ${blogTitle}</#if></title> <title>${title}<#if blogTitle??> - ${blogTitle}</#if></title>
<link type="text/css" rel="stylesheet" <link type="text/css" rel="stylesheet"
href="${staticServePath}/scss/start.css?${staticResourceVersion}" charset="utf-8"/> href="${staticServePath}/scss/start.css?${staticResourceVersion}" charset="utf-8"/>
<link rel="icon" type="image/png" href="${staticServePath}/favicon.png"/> <link rel="icon" type="image/png" href="${faviconURL}"/>
<link rel="apple-touch-icon" href="${staticServePath}/favicon.png"> <link rel="apple-touch-icon" href="${faviconURL}">
</head> </head>
<body> <body>
<div class="wrap"> <div class="wrap">
......
...@@ -26,12 +26,12 @@ ...@@ -26,12 +26,12 @@
<title>${searchLabel} - ${blogTitle}${searchLabel}</title> <title>${searchLabel} - ${blogTitle}${searchLabel}</title>
<link type="text/css" rel="stylesheet" <link type="text/css" rel="stylesheet"
href="${staticServePath}/scss/start.css?${staticResourceVersion}" charset="utf-8"/> href="${staticServePath}/scss/start.css?${staticResourceVersion}" charset="utf-8"/>
<link rel="icon" type="image/png" href="${staticServePath}/favicon.png"/> <link rel="icon" type="image/png" href="${faviconURL}"/>
<link rel="apple-touch-icon" href="${staticServePath}/favicon.png"> <link rel="apple-touch-icon" href="${faviconURL}">
</head> </head>
<body class="search__body"> <body class="search__body">
<div class="search__header fn-clear"> <div class="search__header fn-clear">
<a href="${servePath}"><img width="44" border="0" alt="Solo" title="Solo" src="${staticServePath}/favicon.png"/></a> <a href="${servePath}"><img width="32" border="0" alt="Solo" title="Solo" src="${faviconURL}"/></a>
<div class="search__input"> <div class="search__input">
<input value="${keyword}" id="keyword" type="text" onkeypress="if(event.keyCode===13){document.getElementById('searchBtn').click()}"> <input value="${keyword}" id="keyword" type="text" onkeypress="if(event.keyCode===13){document.getElementById('searchBtn').click()}">
<button id="searchBtn" onclick="window.location.href='${servePath}/search?keyword=' + document.getElementById('keyword').value">搜索</button> <button id="searchBtn" onclick="window.location.href='${servePath}/search?keyword=' + document.getElementById('keyword').value">搜索</button>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment