-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Project og title added in ssr #2181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1930f19
modified the controller
dewanshDT bd3ab35
added renderProjectIndex
dewanshDT 7a4ef3d
edited the routes
dewanshDT d37f569
Merge branch 'develop' into project-og-title
raclim 15836df
Merge branch 'develop' into project-og-title
dewanshDT 5cbac30
Merge branch 'develop' into project-og-title
SableRaf 6732753
Merge branch 'develop' into project-og-title
raclim 783a9a0
Merge branch 'develop' into project-og-title
raclim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export function renderIndex() { | ||
const assetsManifest = process.env.webpackAssets && JSON.parse(process.env.webpackAssets); | ||
const assetsManifest = | ||
process.env.webpackAssets && JSON.parse(process.env.webpackAssets); | ||
return ` | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
@@ -9,7 +10,11 @@ export function renderIndex() { | |
<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." /> | ||
<title>p5.js Web Editor</title> | ||
${process.env.NODE_ENV === 'production' ? `<link rel='stylesheet' href='${assetsManifest['/app.css']}' />` : ''} | ||
${ | ||
process.env.NODE_ENV === 'production' | ||
? `<link rel='stylesheet' href='${assetsManifest['/app.css']}' />` | ||
: '' | ||
} | ||
<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'> | ||
<link rel='shortcut icon' href='/favicon.ico' type='image/x-icon' / > | ||
|
@@ -23,9 +28,96 @@ export function renderIndex() { | |
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}'; | ||
window.process.env.S3_BUCKET_URL_BASE = ${process.env.S3_BUCKET_URL_BASE ? `'${process.env.S3_BUCKET_URL_BASE}'` : undefined}; | ||
window.process.env.S3_BUCKET_URL_BASE = ${ | ||
process.env.S3_BUCKET_URL_BASE | ||
? `'${process.env.S3_BUCKET_URL_BASE}'` | ||
: undefined | ||
}; | ||
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.FORCE_TO_HTTPS = ${ | ||
process.env.FORCE_TO_HTTPS === 'false' ? false : undefined | ||
}; | ||
window.process.env.CLIENT = true; | ||
window.process.env.LOGIN_ENABLED = ${ | ||
process.env.LOGIN_ENABLED === 'false' ? false : true | ||
}; | ||
window.process.env.EXAMPLES_ENABLED = ${ | ||
process.env.EXAMPLES_ENABLED === 'false' ? false : true | ||
}; | ||
window.process.env.UI_ACCESS_TOKEN_ENABLED = ${ | ||
process.env.UI_ACCESS_TOKEN_ENABLED === 'false' ? false : true | ||
}; | ||
window.process.env.UI_COLLECTIONS_ENABLED = ${ | ||
process.env.UI_COLLECTIONS_ENABLED === 'false' ? false : true | ||
}; | ||
window.process.env.UPLOAD_LIMIT = ${ | ||
process.env.UPLOAD_LIMIT ? `${process.env.UPLOAD_LIMIT}` : undefined | ||
}; | ||
window.process.env.MOBILE_ENABLED = ${ | ||
process.env.MOBILE_ENABLED | ||
? `${process.env.MOBILE_ENABLED}` | ||
: undefined | ||
}; | ||
window.process.env.TRANSLATIONS_ENABLED = ${ | ||
process.env.TRANSLATIONS_ENABLED === 'true' ? true : false | ||
}; | ||
window.process.env.PREVIEW_URL = '${process.env.PREVIEW_URL}'; | ||
window.process.env.GA_MEASUREMENT_ID='${process.env.GA_MEASUREMENT_ID}'; | ||
</script> | ||
</head> | ||
<body> | ||
<div id="root" class="root-app"> | ||
</div> | ||
<script src='${ | ||
process.env.NODE_ENV === 'production' | ||
? `${assetsManifest['/app.js']}` | ||
: '/app.js' | ||
}'></script> | ||
</body> | ||
</html> | ||
`; | ||
} | ||
|
||
export function renderProjectIndex(projectName, username) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added this function for rendering the user's Project index file |
||
const assetsManifest = | ||
process.env.webpackAssets && JSON.parse(process.env.webpackAssets); | ||
return ` | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<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." /> | ||
<meta property="og:title" content="${`${projectName} by ${username} -`} p5.js Web Editor" /> | ||
<title>${`${projectName} by ${username} -`} p5.js Web Editor</title> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. modified title and also added og:title |
||
${ | ||
process.env.NODE_ENV === 'production' | ||
? `<link rel='stylesheet' href='${assetsManifest['/app.css']}' />` | ||
: '' | ||
} | ||
<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'> | ||
<link rel='shortcut icon' href='favicon.ico' type='image/x-icon' / > | ||
<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}'; | ||
window.process.env.S3_BUCKET_URL_BASE = ${ | ||
process.env.S3_BUCKET_URL_BASE | ||
? `'${process.env.S3_BUCKET_URL_BASE}'` | ||
: undefined | ||
}; | ||
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; | ||
window.process.env.LOGIN_ENABLED = ${process.env.LOGIN_ENABLED === 'false' ? false : true}; | ||
window.process.env.EXAMPLES_ENABLED = ${process.env.EXAMPLES_ENABLED === 'false' ? false : true}; | ||
|
@@ -40,7 +132,11 @@ export function renderIndex() { | |
<body> | ||
<div id="root" class="root-app"> | ||
</div> | ||
<script src='${process.env.NODE_ENV === 'production' ? `${assetsManifest['/app.js']}` : '/app.js'}'></script> | ||
<script src='${ | ||
process.env.NODE_ENV === 'production' | ||
? `${assetsManifest['/app.js']}` | ||
: '/app.js' | ||
}'></script> | ||
</body> | ||
</html> | ||
`; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the file was not formatted before for some reason