diff --git a/src/WebsiteBuilder.cxx b/src/WebsiteBuilder.cxx index 5e420a4..d617e5b 100644 --- a/src/WebsiteBuilder.cxx +++ b/src/WebsiteBuilder.cxx @@ -107,10 +107,12 @@ std::string get_template(std::string const &path) { } void build_blog_structure(std::string const &path, std::string const &prefix, std::list const &articles, Blog *blog) { - std::filesystem::path obp = get_output_path(path) /= blog->dir; // Output Blog Path + std::filesystem::path obp = get_output_path(path); // Output Blog Path + obp /= "blog"; + obp /= blog->dir; try { // Create blog directory - if (!std::filesystem::exists(obp)) std::filesystem::create_directory(obp); + if (!std::filesystem::exists(obp)) std::filesystem::create_directories(obp); } catch (std::filesystem::filesystem_error const &e) { std::cerr << "error: failed to create directory for blog \"" << blog->name << "\": " << e.what() << std::endl; exit(RETURN_FAILED_UNKNOWN_ERROR); @@ -134,8 +136,8 @@ void build_blog_structure(std::string const &path, std::string const &prefix, st // directories later as needed. try { // Create directory for the year of this article if it doesn't exist. - std::filesystem::path oad = obp; - oad /= year; // Output Article Directory + std::filesystem::path oad = obp; // Output Article Directory + oad /= year; if (!std::filesystem::exists(oad)) std::filesystem::create_directory(oad); // Do the same for the article month.