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
|
||||
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/
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue