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

changed title for better seo #2471

Merged
merged 8 commits into from
Nov 19, 2023
Merged

Conversation

Akhilbisht798
Copy link
Contributor

Fixes #2251

Changes:

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

@@ -418,7 +416,7 @@ class Collection extends React.Component {
>
<article className="collection">
<Helmet>
<title>{this.getTitle()}</title>
<title>{this.getTitle() + title}</title>
Copy link
Collaborator

Choose a reason for hiding this comment

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

The title variable will be null when the collection is still loading, and in that situation I think this will render "p5.js Web Editor | null"? Because the null is cast to a string when using the + operator.

Copy link
Contributor Author

@Akhilbisht798 Akhilbisht798 Sep 24, 2023

Choose a reason for hiding this comment

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

Oh, Okay i though same and checked that, in almost all cases it was correct but still that might be a case .
So i think we might just render Your Collection and Someone Collection in case of null. To avoid title be null.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this sound good to you?

const collectionTitle = this.props.t('Collection.Title');
const titleSplits = collectionTitle.split('|');
const title = titleSplits[0].concat('| ');
return title;
Copy link
Collaborator

Choose a reason for hiding this comment

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

We're basically just extracting the "p5.js Web Editor" portion of the title, right? We don't have any property in the translations files which is just "p5.js Web Editor" but I've wondered before if we should add one. Like t('Common.SiteName') or something. FYI.

Copy link
Contributor Author

@Akhilbisht798 Akhilbisht798 Sep 24, 2023

Choose a reason for hiding this comment

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

Oh, i was thinking same. Even searched for entire i8n for it. But though i might need to discuss that before putting in. So i stick with the safe option.
Okay now i will implement it.

@Akhilbisht798
Copy link
Contributor Author

@lindapaiste, Hey i have made changes according to your suggestion.

@lindapaiste
Copy link
Collaborator

Hey, sorry for not keeping on top of this! I was working on something else today which would benefit from your Common.SiteName translation key.

There's a bit of a problem with the title in the loading case because getCollectionOwner returns a title which already has the site name in it. But then we join it with the site name so we end up with "p5.js Web Editor | p5.js Web Editor | My collections".

This PR is 95% there so I'm going to go ahead and fix it so that we can get it merged.

@lindapaiste lindapaiste merged commit 98a95cd into processing:develop Nov 19, 2023
1 check passed
@Akhilbisht798
Copy link
Contributor Author

Hey, Thanks for letting me about the problem. It was working properly last time when I checked, but I suppose your commit will take care of this problem.

@raclim raclim added this to the PATCH Release for 2.9.3 milestone Nov 20, 2023
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.

Better SEO title needed on collection details pages
3 participants