mirror of https://github.com/halo-dev/halo
feat: support copy static folder when generate static pages.
parent
f3763e80fc
commit
a54c240d70
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue