up
This commit is contained in:
@ -12,10 +12,11 @@ GeneralBuilder::~GeneralBuilder()
|
||||
{
|
||||
}
|
||||
|
||||
list<Document> GeneralBuilder::BuildThePraSite(Sites site)
|
||||
void GeneralBuilder::BuildThePraSite(Sites site)
|
||||
{
|
||||
Utilities tool{Utilities()};
|
||||
string cPath{tool.GetCurrentPath()};
|
||||
cout << cPath << endl;
|
||||
switch (site)
|
||||
{
|
||||
case DEV:
|
||||
@ -26,24 +27,33 @@ list<Document> GeneralBuilder::BuildThePraSite(Sites site)
|
||||
Document index = Document();
|
||||
Head(index, link + "index" + html, "ThePra WebSite");
|
||||
Body(index, cPath + a.contentLinks[0], site);
|
||||
cout << cPath + a.contentLinks[0] << endl;
|
||||
WriteToFile(index, a.outputLinks[0]);
|
||||
|
||||
Document code = Document();
|
||||
Head(code, link + "code" + html, "ThePra Code");
|
||||
Body(code, cPath + a.contentLinks[1], site);
|
||||
cout << cPath + a.contentLinks[1] << endl;
|
||||
WriteToFile(code, a.outputLinks[1]);
|
||||
|
||||
Document blog = Document();
|
||||
Head(blog, link + "blog" + html, "ThePra Blog");
|
||||
Body(blog, cPath + a.contentLinks[2], site);
|
||||
cout << cPath + a.contentLinks[2] << endl;
|
||||
WriteToFile(blog, a.outputLinks[2]);
|
||||
|
||||
Document about = Document();
|
||||
Head(about, link + "about" + html, "ThePra About");
|
||||
Body(about, cPath + a.contentLinks[3], site);
|
||||
cout << cPath + a.contentLinks[3] << endl;
|
||||
WriteToFile(about, a.outputLinks[3]);
|
||||
|
||||
Document contact = Document();
|
||||
Head(contact, link + "contact" + html, "ThePra Contact");
|
||||
Body(contact, cPath + a.contentLinks[4], site);
|
||||
cout << cPath + a.contentLinks[4] << endl;
|
||||
WriteToFile(contact, a.outputLinks[4]);
|
||||
|
||||
return{index,code,blog,about,contact};
|
||||
}
|
||||
break;
|
||||
case ART:
|
||||
@ -70,13 +80,11 @@ list<Document> GeneralBuilder::BuildThePraSite(Sites site)
|
||||
Head(youtubePosts, link + "youtubePosts" + html, "title");
|
||||
Body(youtubePosts, cPath, site);
|
||||
|
||||
return{index,aboutme,twitch,twitter,youtubePosts};
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return list<Document>();
|
||||
}
|
||||
|
||||
void GeneralBuilder::Head(Document &file,
|
||||
@ -121,7 +129,7 @@ void GeneralBuilder::Head(Document &file,
|
||||
file.AddNodeToHead(style);
|
||||
}
|
||||
}
|
||||
file.AddNodeToHead(contentSecurityPolicy);
|
||||
//file.AddNodeToHead(contentSecurityPolicy);
|
||||
file.AddNodeToHead(descriptionP);
|
||||
file.AddNodeToHead(robots);
|
||||
file.AddNodeToHead(googleBot);
|
||||
@ -171,7 +179,7 @@ void GeneralBuilder::BuildHTMLFiles(Sites site, list<Document> rootFiles, list<D
|
||||
path postsContentDir{devDir.append("postsContent")};
|
||||
path outputDir{dir}; outputDir.append("output_thepradev");
|
||||
path posts{outputDir}; posts.append("posts");
|
||||
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
@ -189,6 +197,20 @@ void GeneralBuilder::BuildHTMLFiles(Sites site, list<Document> rootFiles, list<D
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void GeneralBuilder::WriteToFile(Document doc, string p)
|
||||
{
|
||||
path PathToCheck = path(p);
|
||||
if (exists(PathToCheck))
|
||||
{
|
||||
remove(PathToCheck);
|
||||
doc.WriteToFile(p, Readability::MULTILINE);
|
||||
}
|
||||
else
|
||||
{
|
||||
doc.WriteToFile(p, Readability::MULTILINE);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user