Update anatole theme.

pull/192/head
ruibaby 2019-06-07 16:59:14 +08:00
parent 43bfa89dac
commit c3c0daf7ed
10 changed files with 24 additions and 18 deletions

View File

@ -29,6 +29,7 @@ import run.halo.app.security.resolver.AuthenticationArgumentResolver;
import java.io.IOException;
import java.util.List;
import java.util.Properties;
/**
* Mvc configuration.
@ -120,6 +121,11 @@ public class WebMvcAutoConfiguration implements WebMvcConfigurer {
configurer.setTemplateLoaderPaths(FILE_PROTOCOL + haloProperties.getWorkDir() + "templates/", "classpath:/templates/");
configurer.setDefaultEncoding("UTF-8");
Properties properties = new Properties();
properties.setProperty("auto_import","/common/macro/common_macro.ftl as common");
configurer.setFreemarkerSettings(properties);
// Predefine configuration
freemarker.template.Configuration configuration = configurer.createConfiguration();
if (haloProperties.isProductionEnv()) {

View File

@ -66,7 +66,7 @@ public class ContentArchiveController {
* Render post archives page.
*
* @param model model
* @return template path : theme/{theme}/archives.ftl
* @return template path : themes/{theme}/archives.ftl
*/
@GetMapping
public String archives(Model model) {
@ -77,7 +77,7 @@ public class ContentArchiveController {
* Render post archives page.
*
* @param model model
* @return template path : theme/{theme}/archives.ftl
* @return template path : themes/{theme}/archives.ftl
*/
@GetMapping(value = "page/{page}")
public String archives(Model model,
@ -102,7 +102,7 @@ public class ContentArchiveController {
* @param url post slug url.
* @param cp comment page number
* @param model model
* @return template path: theme/{theme}/post.ftl
* @return template path: themes/{theme}/post.ftl
*/
@GetMapping("{url}")
public String post(@PathVariable("url") String url,

View File

@ -49,7 +49,7 @@ public class ContentCategoryController {
/**
* Render category list page
*
* @return template path: theme/{theme}/categories.ftl
* @return template path: themes/{theme}/categories.ftl
*/
@GetMapping
public String categories() {
@ -61,7 +61,7 @@ public class ContentCategoryController {
*
* @param model model
* @param slugName slugName
* @return template path: theme/{theme}/category.ftl
* @return template path: themes/{theme}/category.ftl
*/
@GetMapping(value = "{slugName}")
public String categories(Model model,
@ -75,7 +75,7 @@ public class ContentCategoryController {
* @param model model
* @param slugName slugName
* @param page current page number
* @return template path: theme/{theme}/category.ftl
* @return template path: themes/{theme}/category.ftl
*/
@GetMapping("{slugName}/page/{page}")
public String categories(Model model,

View File

@ -51,7 +51,7 @@ public class ContentIndexController {
* Render blog index
*
* @param model model
* @return template path: /{theme}/post.ftl
* @return template path: themes/{theme}/index.ftl
*/
@GetMapping
public String index(Model model) {
@ -63,7 +63,7 @@ public class ContentIndexController {
*
* @param model model
* @param page current page number
* @return template path: /{theme}/post.ftl
* @return template path: themes/{theme}/index.ftl
*/
@GetMapping(value = "page/{page}")
public String index(Model model,

View File

@ -53,7 +53,7 @@ public class ContentJournalController {
* Render journal page.
*
* @param model model
* @return template path: theme/{theme}/journal.ftl
* @return template path: themes/{theme}/journals.ftl
*/
@GetMapping
public String journals(Model model) {
@ -66,7 +66,7 @@ public class ContentJournalController {
*
* @param model model
* @param page current page number
* @return template path: theme/{theme}/journal.ftl
* @return template path: themes/{theme}/journals.ftl
*/
@GetMapping(value = "page/{page}")
public String journals(Model model,

View File

@ -48,7 +48,7 @@ public class ContentSearchController {
*
* @param model model
* @param keyword keyword
* @return template path : themes/{theme}/search
* @return template path : themes/{theme}/search.ftl
*/
@GetMapping
public String search(Model model,
@ -61,7 +61,7 @@ public class ContentSearchController {
*
* @param model model
* @param keyword keyword
* @return template path :themes/{theme}/search
* @return template path :themes/{theme}/search.ftl
*/
@GetMapping(value = "page/{page}")
public String search(Model model,

View File

@ -34,7 +34,7 @@ public class ContentSheetController {
/**
* Render photo page
*
* @return template path: themes/{theme}/gallery.ftl
* @return template path: themes/{theme}/photos.ftl
*/
@GetMapping(value = "/photos")
public String photos() {

View File

@ -53,7 +53,7 @@ public class ContentTagController {
/**
* All of tags
*
* @return template path: themes/{theme}/tags
* @return template path: themes/{theme}/tags.ftl
*/
@GetMapping
public String tags() {
@ -65,7 +65,7 @@ public class ContentTagController {
*
* @param model model
* @param slugName slug name
* @return template path: themes/{theme}/tag
* @return template path: themes/{theme}/tag.ftl
*/
@GetMapping(value = "{slugName}")
public String tags(Model model,
@ -79,7 +79,7 @@ public class ContentTagController {
* @param model model
* @param slugName slug name
* @param page current page
* @return template path: themes/{theme}/tag
* @return template path: themes/{theme}/tag.ftl
*/
@GetMapping(value = "{slugName}/page/{page}")
public String tags(Model model,

View File

@ -1,7 +1,7 @@
<#macro comment post,type>
<#if !post.disallowComment!false>
<script src="//cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.min.js"></script>
<script src="//cdn.jsdelivr.net/gh/halo-dev/halo-comment@1.0.0/dist/halo-comment.min.js"></script>
<script src="//cdn.jsdelivr.net/gh/halo-dev/halo-comment@1.0.2/dist/halo-comment.min.js"></script>
<halo-comment id="${post.id}" type="${type}"/>
</#if>
</#macro>