55 lines
993 B
C++
55 lines
993 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <iostream>
|
|
#include <filesystem>
|
|
#include <unordered_map>
|
|
#include <vector>
|
|
|
|
using Path = std::filesystem::path;
|
|
|
|
class SiteGeneratorConfig;
|
|
class ContentPage;
|
|
class ContentArticle;
|
|
class TemplatingEngine;
|
|
|
|
class WebsiteGenerator
|
|
{
|
|
public:
|
|
WebsiteGenerator();
|
|
|
|
~WebsiteGenerator();
|
|
|
|
void doSubstitutions();
|
|
|
|
void findProject(const std::string& searchPath);
|
|
|
|
void parseContentFiles();
|
|
|
|
void parseTemplateFiles();
|
|
|
|
void readConfig();
|
|
|
|
void write();
|
|
|
|
private:
|
|
void findContentFiles();
|
|
|
|
Path getContentPath() const;
|
|
|
|
Path getPagesPath() const;
|
|
|
|
Path getArticlesPath() const;
|
|
|
|
Path getConfigPath() const;
|
|
|
|
Path getOutputPath() const;
|
|
|
|
std::filesystem::path mProjectPath;
|
|
|
|
std::unique_ptr<SiteGeneratorConfig> mConfig;
|
|
std::unique_ptr<TemplatingEngine> mTemplateEngine;
|
|
|
|
std::vector<std::unique_ptr<ContentPage> > mPages;
|
|
std::vector<std::unique_ptr<ContentArticle> > mArticles;
|
|
};
|