From f2c63706daef6ddca05adc6771a761593b019524 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Fri, 28 Apr 2017 14:12:26 +0200 Subject: [PATCH] Change default file extension for Mustache templates This commit changes the default file extension for Mustache templates, from `.html` to `.mustache`, which is the file extension used in the official reference documentation and by most IDE plugins. Fixes gh-8997 --- .../boot/autoconfigure/mustache/MustacheProperties.java | 2 +- .../src/main/asciidoc/appendix-application-properties.adoc | 2 +- .../src/main/resources/templates/{error.html => error.mustache} | 0 .../main/resources/templates/error/{507.html => 507.mustache} | 0 .../main/resources/templates/{welcome.html => welcome.mustache} | 0 5 files changed, 2 insertions(+), 2 deletions(-) rename spring-boot-samples/spring-boot-sample-web-mustache/src/main/resources/templates/{error.html => error.mustache} (100%) rename spring-boot-samples/spring-boot-sample-web-mustache/src/main/resources/templates/error/{507.html => 507.mustache} (100%) rename spring-boot-samples/spring-boot-sample-web-mustache/src/main/resources/templates/{welcome.html => welcome.mustache} (100%) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mustache/MustacheProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mustache/MustacheProperties.java index 4988b15bba8..4ef59de5139 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mustache/MustacheProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mustache/MustacheProperties.java @@ -30,7 +30,7 @@ public class MustacheProperties extends AbstractTemplateViewResolverProperties { public static final String DEFAULT_PREFIX = "classpath:/templates/"; - public static final String DEFAULT_SUFFIX = ".html"; + public static final String DEFAULT_SUFFIX = ".mustache"; /** * Prefix to apply to template names. diff --git a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 692c6883cff..fd233399e47 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -372,7 +372,7 @@ content into your application; rather pick only the properties that you need. spring.mustache.expose-spring-macro-helpers= # Set whether to expose a RequestContext for use by Spring's macro library, under the name "springMacroRequestContext". spring.mustache.prefix=classpath:/templates/ # Prefix to apply to template names. spring.mustache.request-context-attribute= # Name of the RequestContext attribute for all views. - spring.mustache.suffix=.html # Suffix to apply to template names. + spring.mustache.suffix=.mustache # Suffix to apply to template names. spring.mustache.view-names= # White list of view names that can be resolved. # SPRING MVC ({sc-spring-boot-autoconfigure}/web/WebMvcProperties.{sc-ext}[WebMvcProperties]) diff --git a/spring-boot-samples/spring-boot-sample-web-mustache/src/main/resources/templates/error.html b/spring-boot-samples/spring-boot-sample-web-mustache/src/main/resources/templates/error.mustache similarity index 100% rename from spring-boot-samples/spring-boot-sample-web-mustache/src/main/resources/templates/error.html rename to spring-boot-samples/spring-boot-sample-web-mustache/src/main/resources/templates/error.mustache diff --git a/spring-boot-samples/spring-boot-sample-web-mustache/src/main/resources/templates/error/507.html b/spring-boot-samples/spring-boot-sample-web-mustache/src/main/resources/templates/error/507.mustache similarity index 100% rename from spring-boot-samples/spring-boot-sample-web-mustache/src/main/resources/templates/error/507.html rename to spring-boot-samples/spring-boot-sample-web-mustache/src/main/resources/templates/error/507.mustache diff --git a/spring-boot-samples/spring-boot-sample-web-mustache/src/main/resources/templates/welcome.html b/spring-boot-samples/spring-boot-sample-web-mustache/src/main/resources/templates/welcome.mustache similarity index 100% rename from spring-boot-samples/spring-boot-sample-web-mustache/src/main/resources/templates/welcome.html rename to spring-boot-samples/spring-boot-sample-web-mustache/src/main/resources/templates/welcome.mustache