提交 f2b9fc76 编写于 作者: RYAN0UP's avatar RYAN0UP

Enable gzip.

上级 43e362a5
......@@ -65,7 +65,8 @@ public class ContentSheetController {
// sheet and post all can use
model.addAttribute("sheet", sheetService.convertToDetail(sheet));
model.addAttribute("post",sheetService.convertToDetail(sheet));
model.addAttribute("post", sheetService.convertToDetail(sheet));
model.addAttribute("is_sheet", true);
if (StrUtil.isNotEmpty(sheet.getTemplate())) {
if (themeService.templateExists(sheet.getTemplate() + HaloConst.SUFFIX_FTL)) {
......
......@@ -2,6 +2,7 @@ package run.halo.app.model.freemarker.tag;
import freemarker.core.Environment;
import freemarker.template.*;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Component;
import run.halo.app.model.support.HaloConst;
import run.halo.app.service.MenuService;
......@@ -9,6 +10,8 @@ import run.halo.app.service.MenuService;
import java.io.IOException;
import java.util.Map;
import static org.springframework.data.domain.Sort.Direction.DESC;
/**
* Freemarker custom tag of menu.
*
......@@ -37,6 +40,9 @@ public class MenuTagDirective implements TemplateDirectiveModel {
case "list":
env.setVariable("menus", builder.build().wrap(menuService.listAll()));
break;
case "tree":
env.setVariable("menus",builder.build().wrap(menuService.listAsTree(Sort.by(DESC, "priority"))));
break;
case "count":
env.setVariable("count", builder.build().wrap(menuService.count()));
break;
......
......@@ -9,6 +9,9 @@ server:
servlet:
session:
timeout: 86400s
compression:
enabled: true
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
spring:
output:
ansi:
......@@ -57,5 +60,5 @@ logging:
halo:
doc-disabled: false
production-env: false
auth-enabled: false
auth-enabled: true
workDir: ${user.home}/halo-dev/
\ No newline at end of file
......@@ -9,6 +9,9 @@ server:
servlet:
session:
timeout: 86400s
compression:
enabled: true
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
spring:
output:
ansi:
......
......@@ -9,6 +9,9 @@ server:
servlet:
session:
timeout: 86400s
compression:
enabled: true
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
spring:
devtools:
add-properties: false
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册