Skip to content
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

Project og title added in ssr #2181

Closed
wants to merge 8 commits into from

Conversation

dewanshDT
Copy link
Collaborator

@dewanshDT dewanshDT commented Mar 23, 2023

Fixes #2177

Changes:
modified the ssr to show the Open Graph title. please check the file changes for details.

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123

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.LOGIN_ENABLED = ${
Copy link
Collaborator Author

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

`;
}

export function renderProjectIndex(projectName, username) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added this function for rendering the user's Project index file

<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>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified title and also added og:title

@raclim raclim added this to the Next Release milestone Oct 18, 2023
@raclim
Copy link
Collaborator

raclim commented Jan 11, 2024

Thanks for your work on this and sorry for getting to this so late!

After looking through it, I think some of the code in the server/views/index.js file feels a little redundant and could probably be more precise. For example, I think an index file title containing a user's project could potentially be determined by a conditional operator instead of making a new renderProjectIndex() function.

I'm going to close this one for now, but please feel free to revisit this and reopen it or create a new one in the future, thanks again!

@raclim raclim closed this Jan 11, 2024
@raclim raclim removed this from the MINOR Release for 2.11.0 milestone Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve OG title for linked p5.js sketches
3 participants