This commit is contained in:
thepra 2017-05-02 08:00:52 +02:00
parent 689da7b90a
commit 07986663d9
4 changed files with 66 additions and 60 deletions

View File

@ -25,32 +25,32 @@ void GeneralBuilder::BuildThePraSite(Sites site)
ThePraDev a{ThePraDev()}; ThePraDev a{ThePraDev()};
string link = "https://www.thepra-dev.com/", html = ".html"; string link = "https://www.thepra-dev.com/", html = ".html";
Document index = Document(); Document index{Document()};
Head(index, link + "index" + html, "ThePra WebSite"); Head(index, link + "index" + html, "ThePra WebSite", ROOT, a.description);
Body(index, cPath + a.contentLinks[0], site); Body(index, cPath + a.contentLinks[0], site);
cout << cPath + a.contentLinks[0] << endl; cout << cPath + a.contentLinks[0] << endl;
WriteToFile(index, a.outputLinks[0]); WriteToFile(index, a.outputLinks[0]);
Document code = Document(); Document code{Document()};
Head(code, link + "code" + html, "ThePra Code"); Head(code, link + "code" + html, "ThePra Code", ROOT, a.description);
Body(code, cPath + a.contentLinks[1], site); Body(code, cPath + a.contentLinks[1], site);
cout << cPath + a.contentLinks[1] << endl; cout << cPath + a.contentLinks[1] << endl;
WriteToFile(code, a.outputLinks[1]); WriteToFile(code, a.outputLinks[1]);
Document blog = Document(); Document blog{Document()};
Head(blog, link + "blog" + html, "ThePra Blog"); Head(blog, link + "blog" + html, "ThePra Blog", ROOT, a.description);
Body(blog, cPath + a.contentLinks[2], site); Body(blog, cPath + a.contentLinks[2], site);
cout << cPath + a.contentLinks[2] << endl; cout << cPath + a.contentLinks[2] << endl;
WriteToFile(blog, a.outputLinks[2]); WriteToFile(blog, a.outputLinks[2]);
Document about = Document(); Document about{Document()};
Head(about, link + "about" + html, "ThePra About"); Head(about, link + "about" + html, "ThePra About", ROOT, a.description);
Body(about, cPath + a.contentLinks[3], site); Body(about, cPath + a.contentLinks[3], site);
cout << cPath + a.contentLinks[3] << endl; cout << cPath + a.contentLinks[3] << endl;
WriteToFile(about, a.outputLinks[3]); WriteToFile(about, a.outputLinks[3]);
Document contact = Document(); Document contact{Document()};
Head(contact, link + "contact" + html, "ThePra Contact"); Head(contact, link + "contact" + html, "ThePra Contact", ROOT, a.description);
Body(contact, cPath + a.contentLinks[4], site); Body(contact, cPath + a.contentLinks[4], site);
cout << cPath + a.contentLinks[4] << endl; cout << cPath + a.contentLinks[4] << endl;
WriteToFile(contact, a.outputLinks[4]); WriteToFile(contact, a.outputLinks[4]);
@ -62,24 +62,30 @@ void GeneralBuilder::BuildThePraSite(Sites site)
ThePraArt a{ThePraArt()}; ThePraArt a{ThePraArt()};
string link = "http://art.thepra-dev.com/", html = ".html"; string link = "http://art.thepra-dev.com/", html = ".html";
Document index = Document(); Document index{Document()};
Head(index, link + "index" + html, "ThePra Art Blog"); Head(index, link + "index" + html, "ThePra Art Blog", ROOT, a.description);
Body(index, cPath + a.contentLinks[0], site); Body(index, cPath + a.contentLinks[0], site);
cout << cPath + a.contentLinks[0] << endl; cout << cPath + a.contentLinks[0] << endl;
WriteToFile(index, a.outputLinks[0]); WriteToFile(index, a.outputLinks[0]);
Document aboutme = Document(); Document aboutme{Document()};
Head(aboutme, link + "aboutme" + html, "ThePra About"); Head(aboutme, link + "aboutme" + html, "ThePra About", ROOT, a.description);
Body(aboutme, cPath + a.contentLinks[1], site); Body(aboutme, cPath + a.contentLinks[1], site);
cout << cPath + a.contentLinks[1] << endl; cout << cPath + a.contentLinks[1] << endl;
WriteToFile(aboutme, a.outputLinks[1]); WriteToFile(aboutme, a.outputLinks[1]);
Document youtubePosts = Document(); Document youtubePosts{Document()};
Head(youtubePosts, link + "youtubeposts" + html, "ThePra Youtube videos"); Head(youtubePosts, link + "youtubeposts" + html, "ThePra Youtube videos", ROOT, a.description);
Body(youtubePosts, cPath + a.contentLinks[2], site, Red); Body(youtubePosts, cPath + a.contentLinks[2], site, Red);
cout << cPath + a.contentLinks[2] << endl; cout << cPath + a.contentLinks[2] << endl;
WriteToFile(youtubePosts, a.outputLinks[2]); WriteToFile(youtubePosts, a.outputLinks[2]);
Document postTemplate{Document()};
Head(postTemplate, "", "*TEXT* - ThePra", ROOT, "*TEXT*");
Body(postTemplate, cPath + a.contentLinks[3], site);
cout << cPath + a.contentLinks[3] << endl;
WriteToFile(postTemplate, a.outputLinks[3]);
} }
break; break;
default: default:

View File

@ -6,6 +6,8 @@
class ThePraArt : Utilities class ThePraArt : Utilities
{ {
public: public:
string description = "The place of ThePra's artistic expression";
string blog = "index.html", string blog = "index.html",
about = "aboutme.html", about = "aboutme.html",
patreon = "https://www.patreon.com/thepra", patreon = "https://www.patreon.com/thepra",
@ -30,16 +32,18 @@ public:
Twitter = "Twitter", Twitter = "Twitter",
Menu = "Menu"; Menu = "Menu";
string contentFolder = "\\thepraart\\content\\"; string contentFolder = "\\thepraart\\content\\";
string contentLinks[3]{ string contentLinks[4]{
contentFolder + "index.txt", contentFolder + "index.txt",
contentFolder + "aboutme.txt", contentFolder + "aboutme.txt",
contentFolder + "youtubeposts.txt" contentFolder + "youtubeposts.txt",
contentFolder + "posttemplate.txt"
}; };
string outputPath{current_path().append("output_thepraart\\").string()}; string outputPath{current_path().append("output_thepraart\\").string()};
string outputLinks[3]{ string outputLinks[4]{
outputPath + "index.html", outputPath + "index.html",
outputPath + "aboutme.html", outputPath + "aboutme.html",
outputPath + "youtubeposts.html" outputPath + "youtubeposts.html",
outputPath + "posttemplate.html"
}; };
@ -58,7 +62,6 @@ inline void ThePraArt::BuildBody(Document &file, string cPath, Levels level, Col
list<Node> navBarM = NavigationBar(level, M, color); list<Node> navBarM = NavigationBar(level, M, color);
list<Node> main = SingleMainContent(level, cPath, D); list<Node> main = SingleMainContent(level, cPath, D);
list<Node> mainM = SingleMainContent(level, cPath, M); list<Node> mainM = SingleMainContent(level, cPath, M);
navBar.push_front(Node());
Node desktop = Node("section.desktop"); Node desktop = Node("section.desktop");
Node mobile = Node("section.mobile"); Node mobile = Node("section.mobile");
for each (Node item in navBar) for each (Node item in navBar)
@ -93,16 +96,16 @@ inline list<Node> ThePraArt::NavigationBar(Levels level, DeskOrMob mtype, Col co
{ {
//leftfixed //leftfixed
Node elem00 = Node("div.leftfixed"), Node elem00 = Node("div.leftfixed"),
elem01 = Node("img").SetAttribute(a.src, "/images/navdecups"+c+".png").SetAttribute(a.alt, "Upper Left Decoration").UseClosingTag(false), elem01 = Node("img").SetAttribute(a.src, "images/navdecups" + c + ".png").SetAttribute(a.alt, "Upper Left Decoration").UseClosingTag(false),
elem02 = Node(a.ul), elem02 = Node(a.ul),
elem03 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.blog).SetContent(a.Home)), elem03 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.blog).SetContent(a.Home)),
elem04 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.patreon).SetAttribute("target","_blank").SetContent(a.Patreon)), elem04 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.patreon).SetAttribute("target", "_blank").SetContent(a.Patreon)),
elem05 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.youtubePosts).SetContent(a.YouTube)), elem05 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.youtubePosts).SetContent(a.YouTube)),
elem06 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.about).SetContent(a.AboutMe)), elem06 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.about).SetContent(a.AboutMe)),
elem07 = Node(a.li).SetContent("( ・ω・)ノ<!--Hello there!-->"), elem07 = Node(a.li).SetContent("( ・ω・)ノ<!--Hello there!-->"),
elem08 = Node(a.li).SetContent("\\(゜ロ゜)<!--Oh shit! Look up guys, someone who read the source file!! They uncovered us!!! WE ARE DOOMED!!!!-->"), elem08 = Node(a.li).SetContent("\\(゜ロ゜)<!--Oh shit! Look up guys, someone who read the source file!! They uncovered us!!! WE ARE DOOMED!!!!-->"),
elem09 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.twitch).SetAttribute("target", "_blank").SetContent(a.Twitch)), elem09 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.twitch).SetAttribute("target", "_blank").SetContent(a.Twitch)),
elem10 = Node("img").SetAttribute(a.src, "/images/navdecupg" + c + ".png").SetAttribute(a.alt, "Bottom Left Decoration").UseClosingTag(false); elem10 = Node("img").SetAttribute(a.src, "images/navdecupg" + c + ".png").SetAttribute(a.alt, "Bottom Left Decoration").UseClosingTag(false);
elem02.AppendChild(elem03) elem02.AppendChild(elem03)
.AppendChild(elem04) .AppendChild(elem04)
@ -116,11 +119,11 @@ inline list<Node> ThePraArt::NavigationBar(Levels level, DeskOrMob mtype, Col co
.AppendChild(elem10); .AppendChild(elem10);
//player //player
Node player = Player(level,color); Node player = Player(level, color);
//rightfixed //rightfixed
Node elem20 = Node("div.rightfixed"), Node elem20 = Node("div.rightfixed"),
elem21 = Node("img").SetAttribute(a.src,"/images/navdecupds" + c + ".png").SetAttribute(a.alt, "Upper Right Decoration").UseClosingTag(false), elem21 = Node("img").SetAttribute(a.src, "images/navdecupds" + c + ".png").SetAttribute(a.alt, "Upper Right Decoration").UseClosingTag(false),
elem22 = Node(a.ul), elem22 = Node(a.ul),
elem23 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.tumblr).SetAttribute("target", "_blank").SetContent(a.Tumblr)), elem23 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.tumblr).SetAttribute("target", "_blank").SetContent(a.Tumblr)),
elem24 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.deviantArt).SetAttribute("target", "_blank").SetContent(a.DeviantArt)), elem24 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.deviantArt).SetAttribute("target", "_blank").SetContent(a.DeviantArt)),
@ -128,7 +131,7 @@ inline list<Node> ThePraArt::NavigationBar(Levels level, DeskOrMob mtype, Col co
elem26 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.facebook).SetAttribute("target", "_blank").SetContent(a.Facebook)), elem26 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.facebook).SetAttribute("target", "_blank").SetContent(a.Facebook)),
elem27 = Node(a.li).SetContent("ヾ(・ω・o)<!--Hello!-->"), elem27 = Node(a.li).SetContent("ヾ(・ω・o)<!--Hello!-->"),
elem28 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.twitter).SetAttribute("target", "_blank").SetContent(a.Twitter)), elem28 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.twitter).SetAttribute("target", "_blank").SetContent(a.Twitter)),
elem29 = Node("img").SetAttribute(a.src, "/images/navdecupdg" + c + ".png").SetAttribute(a.alt, "Bottom Right Decoration").UseClosingTag(false); elem29 = Node("img").SetAttribute(a.src, "images/navdecupdg" + c + ".png").SetAttribute(a.alt, "Bottom Right Decoration").UseClosingTag(false);
elem22.AppendChild(elem23) elem22.AppendChild(elem23)
.AppendChild(elem24) .AppendChild(elem24)
@ -145,13 +148,13 @@ inline list<Node> ThePraArt::NavigationBar(Levels level, DeskOrMob mtype, Col co
break; break;
case M: case M:
{ {
Node elem00 = Node("img.immagini_laterali").SetAttribute(a.alt,"Top Left Decoration").SetAttribute(a.src,"/images/mobile/navdecupds" + c + ".png").UseClosingTag(false), Node elem00 = Node("img.immagini_laterali").SetAttribute(a.alt, "Top Left Decoration").SetAttribute(a.src, "images/mobile/navdecupds" + c + ".png").UseClosingTag(false),
elem01 = Node("div.navigation_barm"), elem01 = Node("div.navigation_barm"),
elem02 = Node("nav"), elem02 = Node("nav"),
elem03 = Node("label.toggle").SetAttribute("for","drop").SetContent(a.Menu), elem03 = Node("label.toggle").SetAttribute("for", "drop").SetContent(a.Menu),
elem04 = Node("input#drop").SetAttribute("type","checkbox").UseClosingTag(false), elem04 = Node("input#drop").SetAttribute("type", "checkbox").UseClosingTag(false),
elem05 = Node(a.ul+".menu"), elem05 = Node(a.ul + ".menu"),
elem06 = Node(a.li+".topRounds").AppendChild(Node(a.a).SetAttribute(a.href,a.blog).SetAttribute("target","_blank").SetContent(a.Home)), elem06 = Node(a.li + ".topRounds").AppendChild(Node(a.a).SetAttribute(a.href, a.blog).SetAttribute("target", "_blank").SetContent(a.Home)),
elem07 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.patreon).SetAttribute("target", "_blank").SetContent(a.Patreon)), elem07 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.patreon).SetAttribute("target", "_blank").SetContent(a.Patreon)),
elem08 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.youtubePosts).SetAttribute("target", "_blank").SetContent(a.YouTube)), elem08 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.youtubePosts).SetAttribute("target", "_blank").SetContent(a.YouTube)),
elem09 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.about).SetAttribute("target", "_blank").SetContent(a.AboutMe)), elem09 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.about).SetAttribute("target", "_blank").SetContent(a.AboutMe)),
@ -161,26 +164,26 @@ inline list<Node> ThePraArt::NavigationBar(Levels level, DeskOrMob mtype, Col co
elem13 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.instagram).SetAttribute("target", "_blank").SetContent(a.Instagram)), elem13 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.instagram).SetAttribute("target", "_blank").SetContent(a.Instagram)),
elem14 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.facebook).SetAttribute("target", "_blank").SetContent(a.Facebook)), elem14 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.facebook).SetAttribute("target", "_blank").SetContent(a.Facebook)),
elem15 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.twitter).SetAttribute("target", "_blank").SetContent(a.Twitter)), elem15 = Node(a.li).AppendChild(Node(a.a).SetAttribute(a.href, a.twitter).SetAttribute("target", "_blank").SetContent(a.Twitter)),
elem16 = Node(a.li+".fs60").SetContent("( ・ω・)ノ <!--Hello there!--> <!--Hello!-->ヾ(・ω・o)"), elem16 = Node(a.li + ".fs60").SetContent("( ・ω・)ノ <!--Hello there!--> <!--Hello!-->ヾ(・ω・o)"),
elem17 = Node(a.li+".bottomRounds.fs60").SetContent("\(゜ロ゜) <!--Oh shit!Look up guys, someone who read the source file!!They uncovered us!!!WE ARE DOOMED!!!!-->"), elem17 = Node(a.li + ".bottomRounds.fs60").SetContent("\(゜ロ゜) <!--Oh shit!Look up guys, someone who read the source file!!They uncovered us!!!WE ARE DOOMED!!!!-->"),
elem18 = Node("img.immagini_laterali").SetAttribute(a.alt, "Top Right Decoration").SetAttribute(a.src, "/images/mobile/navdecups" + c + ".png").UseClosingTag(false); elem18 = Node("img.immagini_laterali").SetAttribute(a.alt, "Top Right Decoration").SetAttribute(a.src, "images/mobile/navdecups" + c + ".png").UseClosingTag(false);
elem01.AppendChild(elem02 elem01.AppendChild(elem02
.AppendChild(elem03) .AppendChild(elem03)
.AppendChild(elem04) .AppendChild(elem04)
.AppendChild(elem05 .AppendChild(elem05
.AppendChild(elem06) .AppendChild(elem06)
.AppendChild(elem07) .AppendChild(elem07)
.AppendChild(elem08) .AppendChild(elem08)
.AppendChild(elem09) .AppendChild(elem09)
.AppendChild(elem10) .AppendChild(elem10)
.AppendChild(elem11) .AppendChild(elem11)
.AppendChild(elem12) .AppendChild(elem12)
.AppendChild(elem13) .AppendChild(elem13)
.AppendChild(elem14) .AppendChild(elem14)
.AppendChild(elem15) .AppendChild(elem15)
.AppendChild(elem16) .AppendChild(elem16)
.AppendChild(elem17))); .AppendChild(elem17)));
return{elem00,elem01,elem18}; return{elem00,elem01,elem18};
} }
@ -219,11 +222,11 @@ inline Node ThePraArt::Player(Levels level, Col color)
ThePraArt a; ThePraArt a;
string pl = (color == White) ? "" : "box-shadow: rgba(204,24,30,.5) 0 0 20px 0"; string pl = (color == White) ? "" : "box-shadow: rgba(204,24,30,.5) 0 0 20px 0";
string whichLevel = ChooseLevel(level); string whichLevel = ChooseLevel(level);
Node player = Node("div.playerfixed").SetAttribute("style",pl) Node player = Node("div.playerfixed").SetAttribute("style", pl)
.AppendChild(Node("audio") .AppendChild(Node("audio")
.SetAttribute("controls", "controls") .SetAttribute("controls", "controls")
.SetAttribute("preload", "auto") .SetAttribute("preload", "auto")
.SetAttribute("class","player") .SetAttribute("class", "player")
.SetContent("Your browser does not support the audio element.") .SetContent("Your browser does not support the audio element.")
.AppendChild(Node("source") .AppendChild(Node("source")
.SetAttribute(a.src, whichLevel + "videoplayback.ogg") .SetAttribute(a.src, whichLevel + "videoplayback.ogg")

View File

@ -6,6 +6,8 @@
class ThePraDev : Utilities class ThePraDev : Utilities
{ {
public: public:
string description = "ThePra's profile about computer-science/programming";
string index = "index.html"; string index = "index.html";
string code = "code.html"; string code = "code.html";
string blog = "blog.html"; string blog = "blog.html";

View File

@ -72,13 +72,9 @@ inline string Utilities::ChooseLevel(Levels level)
inline void Utilities::FullFillContent(string link, string* desktop, string* mobile) inline void Utilities::FullFillContent(string link, string* desktop, string* mobile)
{ {
//link = "C:\\content\\index.txt"; //TODO find out a general way to scan the folder env
Utilities a = Utilities(); Utilities a = Utilities();
string line = ""; string line = "";
std::ifstream infile; std::ifstream infile;
cout << link << endl << desktop;
infile.open(link); infile.open(link);
while (!infile.eof()) while (!infile.eof())
{ {
@ -109,7 +105,6 @@ inline string Utilities::GetCurrentPath()
{ {
path current = current_path(); path current = current_path();
string pathString = current.string(); string pathString = current.string();
cout << pathString << endl;
return pathString; return pathString;
} }