feat: support copy static folder when generate static pages.

pull/471/head^2
ruibaby 2019-12-25 23:39:21 +08:00
parent f3763e80fc
commit a54c240d70
2 changed files with 11 additions and 2 deletions

View File

@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.*;
import run.halo.app.cache.StringCacheStore;
import run.halo.app.cache.lock.CacheLock;
import run.halo.app.exception.ForbiddenException;
import run.halo.app.exception.NotFoundException;
import run.halo.app.model.entity.Category;
import run.halo.app.model.entity.Post;
import run.halo.app.model.entity.PostMeta;

View File

@ -128,9 +128,10 @@ public class StaticPageServiceImpl implements StaticPageService {
this.generateSiteMapHtml();
this.generateSiteMapXml();
this.generateRobots();
this.generateReadme();
this.copyThemeFolder();
this.copyUpload();
this.generateReadme();
this.copyStatic();
} catch (Exception e) {
throw new ServiceException("生成静态页面失败!", e);
}
@ -661,6 +662,15 @@ public class StaticPageServiceImpl implements StaticPageService {
FileUtils.copyFolder(Paths.get(haloProperties.getWorkDir(), "upload"), path);
}
/**
* Copy static folder.
*
* @throws IOException IOException
*/
private void copyStatic() throws IOException {
FileUtils.copyFolder(Paths.get(haloProperties.getWorkDir(), "static"), pagesDir);
}
/**
* Build posts for feed
*