forked from steemit/condenser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver-html.jsx
175 lines (174 loc) · 6.61 KB
/
server-html.jsx
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
import React from 'react';
export default function ServerHTML({ body, assets, locale, title, meta }) {
let page_title = title;
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
{meta &&
meta.map(m => {
if (m.title) {
page_title = m.title;
return null;
}
if (m.canonical)
return (
<link
key="canonical"
rel="canonical"
href={m.canonical}
/>
);
if (m.name && m.content)
return (
<meta
key={m.name}
name={m.name}
content={m.content}
/>
);
if (m.property && m.content)
return (
<meta
key={m.property}
property={m.property}
content={m.content}
/>
);
return null;
})}
<link rel="manifest" href="/static/manifest.json" />
<link rel="icon" type="image/x-icon" href="/favicon.ico?v=2" />
<link
rel="apple-touch-icon-precomposed"
sizes="57x57"
href="/images/favicons/apple-touch-icon-57x57.png"
type="image/png"
/>
<link
rel="apple-touch-icon-precomposed"
sizes="114x114"
href="/images/favicons/apple-touch-icon-114x114.png"
type="image/png"
/>
<link
rel="apple-touch-icon-precomposed"
sizes="72x72"
href="/images/favicons/apple-touch-icon-72x72.png"
type="image/png"
/>
<link
rel="apple-touch-icon-precomposed"
sizes="144x144"
href="/images/favicons/apple-touch-icon-144x144.png"
type="image/png"
/>
<link
rel="apple-touch-icon-precomposed"
sizes="60x60"
href="/images/favicons/apple-touch-icon-60x60.png"
type="image/png"
/>
<link
rel="apple-touch-icon-precomposed"
sizes="120x120"
href="/images/favicons/apple-touch-icon-120x120.png"
type="image/png"
/>
<link
rel="apple-touch-icon-precomposed"
sizes="76x76"
href="/images/favicons/apple-touch-icon-76x76.png"
type="image/png"
/>
<link
rel="apple-touch-icon-precomposed"
sizes="152x152"
href="/images/favicons/apple-touch-icon-152x152.png"
type="image/png"
/>
<link
rel="icon"
type="image/png"
href="/images/favicons/favicon-196x196.png"
sizes="196x196"
/>
<link
rel="icon"
type="image/png"
href="/images/favicons/favicon-96x96.png"
sizes="96x96"
/>
<link
rel="icon"
type="image/png"
href="/images/favicons/favicon-32x32.png"
sizes="32x32"
/>
<link
rel="icon"
type="image/png"
href="/images/favicons/favicon-16x16.png"
sizes="16x16"
/>
<link
rel="icon"
type="image/png"
href="/images/favicons/favicon-128.png"
sizes="128x128"
/>
<meta name="application-name" content="Steemit" />
<meta name="msapplication-TileColor" content="#FFFFFF" />
<meta
name="msapplication-TileImage"
content="/images/favicons/mstile-144x144.png"
/>
<meta
name="msapplication-square70x70logo"
content="/images/favicons/mstile-70x70.png"
/>
<meta
name="msapplication-square150x150logo"
content="/images/favicons/mstile-150x150.png"
/>
<meta
name="msapplication-wide310x150logo"
content="/images/favicons/mstile-310x150.png"
/>
<meta
name="msapplication-square310x310logo"
content="/images/favicons/mstile-310x310.png"
/>
<link
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600"
rel="stylesheet"
type="text/css"
/>
<link
href="https://fonts.googleapis.com/css?family=Source+Serif+Pro:400,600"
rel="stylesheet"
type="text/css"
/>
{assets.style.map((href, idx) => (
<link
href={href}
key={idx}
rel="stylesheet"
type="text/css"
/>
))}
<title>{page_title}</title>
</head>
<body>
<div id="content" dangerouslySetInnerHTML={{ __html: body }} />
{assets.script.map((href, idx) => (
<script key={idx} src={href} />
))}
</body>
</html>
);
}