2016-11-09 00:11:12 +01:00
export function renderIndex ( ) {
const assetsManifest = process . env . webpackAssets && JSON . parse ( process . env . webpackAssets ) ;
return `
< ! DOCTYPE html >
2020-01-28 23:12:46 +01:00
< html lang = "en" >
2016-11-09 00:11:12 +01:00
< head >
2018-03-08 22:16:48 +01:00
< meta http - equiv = "Content-Type" content = "text/html; charset=utf-8" / >
2018-05-02 22:14:05 +02:00
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
2018-03-08 22:16:48 +01: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-09 00:11:12 +01:00
< title > p5 . js Web Editor < / t i t l e >
2018-05-04 22:36:59 +02:00
$ { process . env . NODE _ENV === 'production' ? ` <link rel='stylesheet' href=' ${ assetsManifest [ '/app.css' ] } ' /> ` : '' }
2016-11-09 00:11:12 +01: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' >
2020-01-28 23:03:30 +01: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 23:41:23 +02: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-31 01:35:03 +02:00
window . process . env . S3 _BUCKET _URL _BASE = $ { process . env . S3 _BUCKET _URL _BASE ? ` ' ${ process . env . S3 _BUCKET _URL _BASE } ' ` : undefined } ;
2018-08-24 23:41:23 +02: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 20:12:40 +01: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 } ;
2019-08-30 22:15:13 +02:00
window . process . env . UI _ACCESS _TOKEN _ENABLED = $ { process . env . UI _ACCESS _TOKEN _ENABLED === 'false' ? false : true } ;
2019-07-09 10:33:20 +02:00
window . process . env . UI _COLLECTIONS _ENABLED = $ { process . env . UI _COLLECTIONS _ENABLED === 'false' ? false : true } ;
2018-08-24 23:41:23 +02:00
< / s c r i p t >
2016-11-09 00:11:12 +01:00
< / h e a d >
< body >
< div id = "root" class = "root-app" >
< / d i v >
2018-08-24 23:41:23 +02: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 20:49:45 +02:00
2018-08-24 23:41:23 +02:00
ga ( 'create' , 'UA-53383000-1' , 'auto' ) ;
ga ( 'send' , 'pageview' ) ;
2017-04-13 20:49:45 +02:00
2018-08-24 23:41:23 +02:00
< / s c r i p t >
2016-11-09 00:11:12 +01:00
< / b o d y >
< / h t m l >
` ;
2017-12-08 21:07:54 +01:00
}