| | |
| | | package com.xcong.farmer.cms.configurations; |
| | | |
| | | import com.xcong.farmer.cms.configurations.properties.CmsProperties; |
| | | import com.xcong.farmer.cms.core.template.TemplateConfiguration; |
| | | import com.xcong.farmer.cms.core.template.TemplateLoader; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | |
| | | @Configuration |
| | | public class CmsConfig { |
| | | |
| | | @Autowired |
| | | private CmsProperties cmsProperties; |
| | | |
| | | @Bean |
| | | public TemplateConfiguration templateConfiguration() { |
| | | log.info("CMS管理系统"); |
| | | TemplateConfiguration cfg = new TemplateConfiguration("/Users/helius/Desktop/template", "", "/Users/helius/Desktop/web/output"); |
| | | TemplateConfiguration cfg = new TemplateConfiguration(cmsProperties.getTemplatePath(), cmsProperties.getStaticPath(), cmsProperties.getOutputPath(), cmsProperties.getBaseUrl(), cmsProperties.getStaticUrl()); |
| | | TemplateLoader loader = new TemplateLoader(cfg); |
| | | cfg.templateLoader(loader); |
| | | return cfg; |