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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,4 +7,4 @@ description: A other Halo theme
logo: https://avatars1.githubusercontent.com/u/1811819?s=460&v=4 logo: https://avatars1.githubusercontent.com/u/1811819?s=460&v=4
website: https://github.com/halo-dev/halo-theme-anatole website: https://github.com/halo-dev/halo-theme-anatole
repo: https://github.com/halo-dev/halo-theme-anatole repo: https://github.com/halo-dev/halo-theme-anatole
version: 1.0 version: 1.0