From 05f3eec8ba39fb05eac09d8d3f2930cd77dd41f7 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 12 Jul 2022 11:39:30 +0800
Subject: [PATCH] 20220606

---
 src/main/java/com/xcong/farmer/cms/core/template/TemplateConfiguration.java |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/xcong/farmer/cms/core/template/TemplateConfiguration.java b/src/main/java/com/xcong/farmer/cms/core/template/TemplateConfiguration.java
index 6fec7de..7dbc81c 100644
--- a/src/main/java/com/xcong/farmer/cms/core/template/TemplateConfiguration.java
+++ b/src/main/java/com/xcong/farmer/cms/core/template/TemplateConfiguration.java
@@ -18,8 +18,8 @@
 
     private TemplateLoader templateLoader;
 
-    public TemplateConfiguration(String templatePath, String staticPath, String outputPath) {
-        super(templatePath, staticPath, outputPath);
+    public TemplateConfiguration(String templatePath, String staticPath, String outputPath, String baseUrl, String staticUrl) {
+        super(templatePath, staticPath, outputPath, baseUrl, staticUrl);
     }
 
     public void templateLoader(TemplateLoader templateLoader) {
@@ -33,11 +33,21 @@
 
         this.templateLoader.data(map);
         Template template = template(templateName);
-        template.output(this.outputPath);
+        template.output(outputPath);
+
+        // 判断是否有分页,有则执行。从第二页开始
+        int i = 2;
+        while(Template.HAS_PAGING) {
+            map.put("page", i);
+            this.templateLoader.data(map);
+            Template pageTemplate = template(templateName);
+            pageTemplate.output(outputPath);
+            i++;
+        }
     }
 
     public Template template(String templateName) {
-        return template(new File(path(this.templatePath) + templateName));
+        return template(new File(path(templatePath) + templateName));
     }
 
     public Template template(File file) {

--
Gitblit v1.9.1