Start adding markdown conversion to site generator.
This commit is contained in:
parent
f0091f9e04
commit
f44c79dc1f
31 changed files with 692 additions and 461 deletions
|
@ -1,6 +1,7 @@
|
|||
#include "TemplatingEngine.h"
|
||||
|
||||
#include "Directory.h"
|
||||
#include "FileLogger.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
@ -13,10 +14,11 @@ TemplatingEngine::TemplatingEngine(const Path& workingDirectory)
|
|||
void TemplatingEngine::loadTemplateFiles()
|
||||
{
|
||||
const auto files = Directory::getFilesWithExtension(mWorkingDirectory, mTemplateExtension);
|
||||
for (const auto& file : files)
|
||||
for (const auto& path : files)
|
||||
{
|
||||
mTemplateFiles.push_back(std::make_unique<TemplateFile>(file));
|
||||
mTemplateFiles[path.stem().string()] = std::make_unique<TemplateFile>(path);
|
||||
}
|
||||
MLOG_INFO("Found: " << mTemplateFiles.size() << " templates in " << mWorkingDirectory);
|
||||
}
|
||||
|
||||
std::string TemplatingEngine::processTemplate(const std::string& name)
|
||||
|
@ -35,15 +37,7 @@ TemplateFile* TemplatingEngine::getTemplateFile(const Path& path)
|
|||
|
||||
TemplateFile* TemplatingEngine::getTemplateFile(const std::string& name)
|
||||
{
|
||||
//std::cout << "Looking for template file with name: " << name << std::endl;
|
||||
for (const auto& file : mTemplateFiles)
|
||||
{
|
||||
if (file->getName() == name)
|
||||
{
|
||||
return file.get();
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
return mTemplateFiles[name].get();
|
||||
}
|
||||
|
||||
std::string TemplatingEngine::processTemplate(TemplateFile* file, TemplateNode* parent)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue