mirror of https://github.com/halo-dev/halo
Enable gzip.
parent
43e362a58d
commit
f2b9fc768d
|
@ -65,7 +65,8 @@ public class ContentSheetController {
|
||||||
|
|
||||||
// sheet and post all can use
|
// sheet and post all can use
|
||||||
model.addAttribute("sheet", sheetService.convertToDetail(sheet));
|
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 (StrUtil.isNotEmpty(sheet.getTemplate())) {
|
||||||
if (themeService.templateExists(sheet.getTemplate() + HaloConst.SUFFIX_FTL)) {
|
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.core.Environment;
|
||||||
import freemarker.template.*;
|
import freemarker.template.*;
|
||||||
|
import org.springframework.data.domain.Sort;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import run.halo.app.model.support.HaloConst;
|
import run.halo.app.model.support.HaloConst;
|
||||||
import run.halo.app.service.MenuService;
|
import run.halo.app.service.MenuService;
|
||||||
|
@ -9,6 +10,8 @@ import run.halo.app.service.MenuService;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static org.springframework.data.domain.Sort.Direction.DESC;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Freemarker custom tag of menu.
|
* Freemarker custom tag of menu.
|
||||||
*
|
*
|
||||||
|
@ -37,6 +40,9 @@ public class MenuTagDirective implements TemplateDirectiveModel {
|
||||||
case "list":
|
case "list":
|
||||||
env.setVariable("menus", builder.build().wrap(menuService.listAll()));
|
env.setVariable("menus", builder.build().wrap(menuService.listAll()));
|
||||||
break;
|
break;
|
||||||
|
case "tree":
|
||||||
|
env.setVariable("menus",builder.build().wrap(menuService.listAsTree(Sort.by(DESC, "priority"))));
|
||||||
|
break;
|
||||||
case "count":
|
case "count":
|
||||||
env.setVariable("count", builder.build().wrap(menuService.count()));
|
env.setVariable("count", builder.build().wrap(menuService.count()));
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -9,6 +9,9 @@ server:
|
||||||
servlet:
|
servlet:
|
||||||
session:
|
session:
|
||||||
timeout: 86400s
|
timeout: 86400s
|
||||||
|
compression:
|
||||||
|
enabled: true
|
||||||
|
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
|
||||||
spring:
|
spring:
|
||||||
output:
|
output:
|
||||||
ansi:
|
ansi:
|
||||||
|
@ -57,5 +60,5 @@ logging:
|
||||||
halo:
|
halo:
|
||||||
doc-disabled: false
|
doc-disabled: false
|
||||||
production-env: false
|
production-env: false
|
||||||
auth-enabled: false
|
auth-enabled: true
|
||||||
workDir: ${user.home}/halo-dev/
|
workDir: ${user.home}/halo-dev/
|
|
@ -9,6 +9,9 @@ server:
|
||||||
servlet:
|
servlet:
|
||||||
session:
|
session:
|
||||||
timeout: 86400s
|
timeout: 86400s
|
||||||
|
compression:
|
||||||
|
enabled: true
|
||||||
|
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
|
||||||
spring:
|
spring:
|
||||||
output:
|
output:
|
||||||
ansi:
|
ansi:
|
||||||
|
|
|
@ -9,6 +9,9 @@ server:
|
||||||
servlet:
|
servlet:
|
||||||
session:
|
session:
|
||||||
timeout: 86400s
|
timeout: 86400s
|
||||||
|
compression:
|
||||||
|
enabled: true
|
||||||
|
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
|
||||||
spring:
|
spring:
|
||||||
devtools:
|
devtools:
|
||||||
add-properties: false
|
add-properties: false
|
||||||
|
|
Loading…
Reference in New Issue