MCPcopy Create free account
hub / github.com/emwalker/digraph / template

Function template

client/src/server/renderFullPage.ts:44–68  ·  view source on GitHub ↗
(vo: Variables)

Source from the content-addressed store, hash-verified

42}
43
44const template = (vo: Variables) => `
45<!DOCTYPE html>
46<html>
47 <head>
48 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
49 ${googleAnalytics(vo.gaId)}
50 <meta charset="utf-8">
51 <meta http-equiv="Content-Language" content="en">
52 <title>Digraph</title>
53 <link rel="icon" href="/static/images/favicon.svg" type="image/svg+xml" sizes="any">
54 ${joinArray(getStylesheet, vo.vendorCSSBundle)}
55 ${getStylesheet(vo.mainCSSBundle)}
56 </head>
57
58 <body>
59 <div id="root"><div>${vo.root}</div></div>
60 ${joinArray(getDeferScript, vo.vendorJSBundle)}
61 ${getDeferScript(vo.mainJSBundle)}
62 <script>
63 window.__RELAY_PAYLOADS__ = ${vo.relayPayloads};
64 window.__PRELOADED_STATE__ = ${vo.state};
65 </script>
66 </body>
67</html>
68`
69
70const toString = (state: Object) => JSON.stringify(state).replace(/</g, '\\u003c')
71

Callers 1

renderFullPage.tsFile · 0.85

Calls 4

googleAnalyticsFunction · 0.85
joinArrayFunction · 0.85
getStylesheetFunction · 0.85
getDeferScriptFunction · 0.85

Tested by

no test coverage detected