Commit 47c370cd authored by vcjmhg's avatar vcjmhg

Merge branch 'fixScript' into dev

parents 4a8f6cbf c6de2eeb
## v4.1.0 / 2020-05-19
### 引入特性
* [支持类似 Typora 的即时渲染模式(保留 Markdown 标记符)](https://github.com/88250/solo/issues/81)
* [后台增加服务端日志浏览](https://github.com/88250/solo/issues/91)
* [页面静态化](https://github.com/88250/solo/issues/107)
### 改进皮肤
* [皮肤页脚去掉版权信息](https://github.com/88250/solo/issues/111)
### 改进功能
* [社区图床更换新域名](https://github.com/88250/solo/issues/21)
* [使用 jsDelivr 时自动加入版本号](https://github.com/88250/solo/issues/83)
* [不显示发布文章计数为零的标签](https://github.com/88250/solo/issues/88)
* [废弃评论推送社区接口](https://github.com/88250/solo/issues/89)
* [看板娘背景优化](https://github.com/88250/solo/issues/93)
* [支持配置编辑器模式](https://github.com/88250/solo/issues/95)
* [调整前台动态皮肤预览逻辑](https://github.com/88250/solo/issues/116)
### 文档相关
* [Add README in English](https://github.com/88250/solo/issues/104)
### 开发重构
* [Docker 镜像加入 Git 提交哈希值环境变量](https://github.com/88250/solo/issues/82)
* [更换开源协议为 木兰宽松许可证, 第2版](https://github.com/88250/solo/issues/99)
* [彻底移除浏览数统计相关代码](https://github.com/88250/solo/issues/110)
### 修复缺陷
* [生成静态站点的分类分页 404](https://github.com/88250/solo/issues/86)
* [采用 cdn.jsdelivr.net 加速后访问文章详情页面 js 报错](https://github.com/88250/solo/issues/100)
* [图床上传相同图片后第二幅显示不出来](https://github.com/88250/solo/issues/101)
* [更新文章编辑器加载报错](https://github.com/88250/solo/issues/106)
* [后台 footer 遮挡 菜单栏](https://github.com/88250/solo/issues/108)
* [casper 文章页面开始使用被分享遮挡](https://github.com/88250/solo/issues/109)
* [导入 Markdown 文件存档时间问题](https://github.com/88250/solo/issues/112)
* [nijigen 皮肤修改](https://github.com/88250/solo/issues/115)
* [自定义模板变量解析规则问题](https://github.com/88250/solo/issues/123)
## v4.0.0 / 2020-03-24
### 引入特性
......
{
"name": "solo",
"version": "4.0.0",
"version": "4.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
{
"name": "solo",
"version": "4.0.0",
"version": "4.1.0",
"description": " 一款小而美的博客系统,专为程序员设计。",
"homepage": "https://github.com/88250/solo",
"repository": {
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
Description: Solo POM.
Version: 3.18.3.94, May 10, 2020
Version: 3.18.3.95, May 19, 2020
Author: <a href="http://88250.b3log.org">Liang Ding</a>
Author: <a href="http://www.annpeter.cn">Ann Peter</a>
Author: <a href="http://vanessa.b3log.org">Vanessa</a>
......@@ -16,7 +16,7 @@
<artifactId>solo</artifactId>
<packaging>jar</packaging>
<name>Solo</name>
<version>4.0.0</version>
<version>4.1.0</version>
<description>
一款小而美的博客系统,专为程序员设计。
</description>
......@@ -73,7 +73,7 @@
</scm>
<properties>
<org.b3log.latke.version>3.4.0</org.b3log.latke.version>
<org.b3log.latke.version>3.4.1</org.b3log.latke.version>
<jsoup.version>1.12.1</jsoup.version>
<flexmark.version>0.50.40</flexmark.version>
......
......@@ -49,7 +49,7 @@ import java.util.concurrent.atomic.AtomicInteger;
* Server.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 3.0.1.5, Apr 30, 2020
* @version 3.0.1.6, May 19, 2020
* @since 1.2.0
*/
public final class Server extends BaseServer {
......@@ -62,7 +62,7 @@ public final class Server extends BaseServer {
/**
* Solo version.
*/
public static final String VERSION = "4.0.0";
public static final String VERSION = "4.1.0";
/**
* In-Memory tail logger writer.
......
......@@ -52,7 +52,7 @@ import static org.b3log.solo.model.Article.ARTICLE_CONTENT;
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.7.0.16, Mar 31, 2020
* @version 1.7.1.0, May 18, 2020
* @since 0.3.1
*/
@Service
......@@ -495,11 +495,10 @@ public class DataModelService {
final Map<String, String> customVars = new HashMap<>();
final String customVarsStr = preference.optString(Option.ID_C_CUSTOM_VARS);
final String[] customVarsArray = customVarsStr.split("\\|");
for (int i = 0; i < customVarsArray.length; i++) {
final String customVarPair = customVarsArray[i];
for (final String customVarPair : customVarsArray) {
if (StringUtils.isNotBlank(customVarsStr)) {
final String customVarKey = customVarPair.split("=")[0];
final String customVarVal = customVarPair.split("=")[1];
final String customVarKey = StringUtils.substringBefore(customVarPair, "=");
final String customVarVal = StringUtils.substringAfter(customVarPair, "=");
if (StringUtils.isNotBlank(customVarKey) && StringUtils.isNotBlank(customVarVal)) {
customVars.put(customVarKey, customVarVal);
}
......
......@@ -25,7 +25,7 @@ import org.json.JSONObject;
* Upgrade service.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.2.1.18, Mar 24, 2020
* @version 1.2.1.19, May 19, 2020
* @since 1.2.0
*/
@Service
......@@ -98,6 +98,8 @@ public class UpgradeService {
V380_390.perform();
case "3.9.0":
V390_400.perform();
case "4.0.0":
V400_410.perform();
break;
default:
LOGGER.log(Level.ERROR, "Please upgrade to v3.0.0 first");
......
/*
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-present, b3log.org
*
* Solo is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
package org.b3log.solo.upgrade;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.b3log.latke.ioc.BeanManager;
import org.b3log.latke.repository.Transaction;
import org.b3log.solo.model.Option;
import org.b3log.solo.repository.OptionRepository;
import org.json.JSONObject;
/**
* Upgrade script from v4.0.0 to v4.1.0.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.0, May 19, 2020
* @since 4.1.0
*/
public final class V400_410 {
/**
* Logger.
*/
private static final Logger LOGGER = LogManager.getLogger(V400_410.class);
/**
* Performs upgrade from v4.0.0 to v4.1.0.
*
* @throws Exception upgrade fails
*/
public static void perform() throws Exception {
final String fromVer = "4.0.0";
final String toVer = "4.1.0";
LOGGER.log(Level.INFO, "Upgrading from version [" + fromVer + "] to version [" + toVer + "]....");
final BeanManager beanManager = BeanManager.getInstance();
final OptionRepository optionRepository = beanManager.getReference(OptionRepository.class);
try {
final Transaction transaction = optionRepository.beginTransaction();
final JSONObject versionOpt = optionRepository.get(Option.ID_C_VERSION);
versionOpt.put(Option.OPTION_VALUE, toVer);
optionRepository.update(Option.ID_C_VERSION, versionOpt);
transaction.commit();
LOGGER.log(Level.INFO, "Upgraded from version [" + fromVer + "] to version [" + toVer + "] successfully");
} catch (final Exception e) {
LOGGER.log(Level.ERROR, "Upgrade failed!", e);
throw new Exception("Upgrade failed from version [" + fromVer + "] to version [" + toVer + "]");
}
}
}
......@@ -39,7 +39,7 @@ import java.util.zip.GZIPOutputStream;
* Static utilities. 页面静态化 https://github.com/88250/solo/issues/107
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.1, May 10, 2020
* @version 1.0.1.0, May 19, 2020
* @since 4.1.0
*/
public final class Statics {
......@@ -77,6 +77,11 @@ public final class Statics {
* @return HTML, returns {@code null} if not found
*/
public static String get(final RequestContext context) {
if (Solos.GEN_STATIC_SITE) {
// 生成静态站点时不走缓存
return null;
}
if (Solos.isLoggedIn(context)) {
// 登录用户不走缓存
return null;
......@@ -114,6 +119,11 @@ public final class Statics {
* @param context the specified context
*/
public static void put(final RequestContext context) {
if (Solos.GEN_STATIC_SITE) {
// 生成静态站点时不走缓存
return;
}
if (Solos.isLoggedIn(context)) {
// 登录用户生成的内容不写入缓存
return;
......
## v4.1.0 / 2020-05-19
### 引入特性
* [支持类似 Typora 的即时渲染模式(保留 Markdown 标记符)](https://github.com/88250/solo/issues/81)
* [后台增加服务端日志浏览](https://github.com/88250/solo/issues/91)
* [页面静态化](https://github.com/88250/solo/issues/107)
### 改进皮肤
* [皮肤页脚去掉版权信息](https://github.com/88250/solo/issues/111)
### 改进功能
* [社区图床更换新域名](https://github.com/88250/solo/issues/21)
* [使用 jsDelivr 时自动加入版本号](https://github.com/88250/solo/issues/83)
* [不显示发布文章计数为零的标签](https://github.com/88250/solo/issues/88)
* [废弃评论推送社区接口](https://github.com/88250/solo/issues/89)
* [看板娘背景优化](https://github.com/88250/solo/issues/93)
* [支持配置编辑器模式](https://github.com/88250/solo/issues/95)
* [调整前台动态皮肤预览逻辑](https://github.com/88250/solo/issues/116)
### 文档相关
* [Add README in English](https://github.com/88250/solo/issues/104)
### 开发重构
* [Docker 镜像加入 Git 提交哈希值环境变量](https://github.com/88250/solo/issues/82)
* [更换开源协议为 木兰宽松许可证, 第2版](https://github.com/88250/solo/issues/99)
* [彻底移除浏览数统计相关代码](https://github.com/88250/solo/issues/110)
### 修复缺陷
* [生成静态站点的分类分页 404](https://github.com/88250/solo/issues/86)
* [采用 cdn.jsdelivr.net 加速后访问文章详情页面 js 报错](https://github.com/88250/solo/issues/100)
* [图床上传相同图片后第二幅显示不出来](https://github.com/88250/solo/issues/101)
* [更新文章编辑器加载报错](https://github.com/88250/solo/issues/106)
* [后台 footer 遮挡 菜单栏](https://github.com/88250/solo/issues/108)
* [casper 文章页面开始使用被分享遮挡](https://github.com/88250/solo/issues/109)
* [导入 Markdown 文件存档时间问题](https://github.com/88250/solo/issues/112)
* [nijigen 皮肤修改](https://github.com/88250/solo/issues/115)
* [自定义模板变量解析规则问题](https://github.com/88250/solo/issues/123)
## v4.0.0 / 2020-03-24
### 引入特性
......
......@@ -10,7 +10,7 @@
* See the Mulan PSL v2 for more details.
*/
/**
* @fileoverview Page util, load heighlight and process comment.
* @fileoverview Page util, load highlight and process comment.
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
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