-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.cpp
More file actions
85 lines (68 loc) · 2.34 KB
/
main.cpp
File metadata and controls
85 lines (68 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include "webkit.hpp"
int main() {
Tag html("html");
// ************ HEAD *************************************
auto head = html.addChild(new Tag("head"));
// Title
head->addChild(new Tag("title", "C++ Mexico"));
// Load CSS
head->addChild(new Tag("style", loadCss("css/style.css")));
// Meta tags for preview
head->addChild(new Tag("meta"))
->addAttr("property", "og:url")
->addAttr("content", "https://cpp.com.mx");
head->addChild(new Tag("meta"))
->addAttr("property", "og:title")
->addAttr("content", "C++ Mexico");
head->addChild(new Tag("meta"))
->addAttr("property", "og:description")
->addAttr("content", "Comunidad de C++ Mexico");
head->addChild(new Tag("meta"))
->addAttr("property", "og:image")
->addAttr("content", "https://cpp.com.mx/images/logo.png");
// ************ BODY *************************************
Tag body("body");
html.addChild(&body);
// Body style
body
.addAttr("style", R"(
line-height: 1.4;
font-size: 10pt;
font-family: Lucida\ Console, monaco, monospace;
margin: 1em auto;
max-width: 1000px;
)");
// Header (C++ Mexico)
body
.addChild(new Tag("header"))
->addAttr("style", R"(
padding-top: 10px;
text-align: center;
)")
->addChild(new Tag("strong", "C++ Mexico"))
->addAttr("style", R"(
font-size: 26pt;
font-weight: normal;
color: black;
)");
auto center = body
.addChild(new Tag("main"))
->addChild(new Tag("div"))
->addAttr("class", "p")
->addChild(new Tag("center"));
// Logo
center
->addChild(new Tag("img"))
->addAttr("src", "https://cpp.com.mx/images/logo.png");
// Description
center
->addChild(new Tag("p", "Comunidad de C++ Mexico"));
// Social media
center
->addChild(new Tag("p", R"(<a href="https://twitter.com/cpp_mx">Twitter</a> / <a href="https://discord.gg/t53X2e8Mrz">Discord</a> / <a href="https://github.com/cppmexico">Github</a> / <a href="https://www.twitch.tv/cppmexico">Twitch</a>)"));
// #standwithukraine banner
center
->addChild(new Tag("p", R"(<a href="https://donate.redcrossredcrescent.org/ua/donate/~my-donation" target="_blank" rel="noreferrer noopener"> 💙 #standwithukraine 💛</a>)"));
// Print generated html to stdout
html.show();
}