2016-11-08 23:11:12 +00:00
export function renderIndex ( ) {
const assetsManifest = process . env . webpackAssets && JSON . parse ( process . env . webpackAssets ) ;
return `
< ! DOCTYPE html >
< html >
< head >
2018-03-08 21:16:48 +00:00
< meta http - equiv = "Content-Type" content = "text/html; charset=utf-8" / >
2018-05-02 20:14:05 +00:00
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
2018-03-08 21:16:48 +00:00
< meta name = "keywords" content = "p5.js, p5.js web editor, web editor, processing, code editor" / >
< meta name = "description" content = "A web editor for p5.js, a JavaScript library with the goal of making coding accessible to artists, designers, educators, and beginners." / >
2016-11-08 23:11:12 +00:00
< title > p5 . js Web Editor < / t i t l e >
2018-05-04 20:36:59 +00:00
$ { process . env . NODE _ENV === 'production' ? ` <link rel='stylesheet' href=' ${ assetsManifest [ '/app.css' ] } ' /> ` : '' }
2016-11-08 23:11:12 +00:00
< link href = 'https://fonts.googleapis.com/css?family=Inconsolata' rel = 'stylesheet' type = 'text/css' >
< link href = 'https://fonts.googleapis.com/css?family=Montserrat:400,700' rel = 'stylesheet' type = 'text/css' >
2016-11-26 23:10:03 +00:00
< link rel = 'shortcut icon' href = 'https://raw.githubusercontent.com/processing/p5.js-website-OLD/master/favicon.ico' type = 'image/x-icon' / >
2018-08-24 21:41:23 +00:00
< script >
if ( ! window . process ) {
window . process = { } ;
}
if ( ! window . process . env ) {
window . process . env = { } ;
}
window . process . env . API _URL = '${process.env.API_URL}' ;
window . process . env . NODE _ENV = '${process.env.NODE_ENV}' ;
window . process . env . S3 _BUCKET = '${process.env.S3_BUCKET}' ;
2018-08-30 23:35:03 +00:00
window . process . env . S3 _BUCKET _URL _BASE = $ { process . env . S3 _BUCKET _URL _BASE ? ` ' ${ process . env . S3 _BUCKET _URL _BASE } ' ` : undefined } ;
2018-08-24 21:41:23 +00:00
window . process . env . AWS _REGION = '${process.env.AWS_REGION}' ;
window . process . env . FORCE _TO _HTTPS = $ { process . env . FORCE _TO _HTTPS === 'false' ? false : undefined } ;
window . process . env . CLIENT = true ;
2019-01-25 19:12:40 +00:00
window . process . env . LOGIN _ENABLED = $ { process . env . LOGIN _ENABLED === 'false' ? false : true } ;
window . process . env . EXAMPLES _ENABLED = $ { process . env . EXAMPLES _ENABLED === 'false' ? false : true } ;
2018-08-24 21:41:23 +00:00
< / s c r i p t >
2016-11-08 23:11:12 +00:00
< / h e a d >
< body >
< div id = "root" class = "root-app" >
< / d i v >
2018-08-24 21:41:23 +00:00
< script src = '${process.env.NODE_ENV === ' production ' ? `${assetsManifest[' / app . js ']}` : ' / app . js '}' > < / s c r i p t >
< script >
( function ( i , s , o , g , r , a , m ) { i [ 'GoogleAnalyticsObject' ] = r ; i [ r ] = i [ r ] || function ( ) {
( i [ r ] . q = i [ r ] . q || [ ] ) . push ( arguments ) } , i [ r ] . l = 1 * new Date ( ) ; a = s . createElement ( o ) ,
m = s . getElementsByTagName ( o ) [ 0 ] ; a . async = 1 ; a . src = g ; m . parentNode . insertBefore ( a , m )
} ) ( window , document , 'script' , 'https://www.google-analytics.com/analytics.js' , 'ga' ) ;
2017-04-13 18:49:45 +00:00
2018-08-24 21:41:23 +00:00
ga ( 'create' , 'UA-53383000-1' , 'auto' ) ;
ga ( 'send' , 'pageview' ) ;
2017-04-13 18:49:45 +00:00
2018-08-24 21:41:23 +00:00
< / s c r i p t >
2016-11-08 23:11:12 +00:00
< / b o d y >
< / h t m l >
` ;
2017-12-08 20:07:54 +00:00
}