diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2021-11-09 20:47:16 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2021-11-09 20:47:16 +0300 |
commit | e2a71b0366aa80a7cf131fdbde6012671493d364 (patch) | |
tree | a5a60dbb56043af72c600bff992b863b4f821ede /src/site.c | |
parent | abbee959bf5c87a8b2ad0b2d55d9ddb955147892 (diff) | |
download | revela-e2a71b0366aa80a7cf131fdbde6012671493d364.tar.gz revela-e2a71b0366aa80a7cf131fdbde6012671493d364.zip |
Copy/sync static files
Diffstat (limited to 'src/site.c')
-rw-r--r-- | src/site.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -197,8 +197,16 @@ bool site_build(struct site *site) { struct stat dstat; + char staticp[PATH_MAX]; + if (!nmkdir(site->output_dir, &dstat, false)) return false; + joinpathb(staticp, site->root_dir, STATICDIR); + if (!filesync(staticp, site->output_dir) && errno != ENOENT) { + log_printl_errno(LOG_FATAL, "Can't copy static files"); + return false; + } + if (chdir(site->output_dir)) { log_printl_errno(LOG_FATAL, "Can't change to directory %s", site->output_dir); @@ -210,7 +218,7 @@ site_build(struct site *site) if (!bstree_inorder_walk(site->albums->root, albums_walk, (void *)site)) { return false; } - /* TODO: static files and css */ + chdir(site->root_dir); return true; } |