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

Updated Page Title #1223

Merged
merged 1 commit into from
Jan 23, 2024
Merged

Updated Page Title #1223

merged 1 commit into from
Jan 23, 2024

Conversation

Aibono1225
Copy link
Member

@Aibono1225 Aibono1225 commented Jan 22, 2024

Relates to #1159

Change:

  • Updated page title to follow the best practice

image

@Aibono1225 Aibono1225 requested a review from JackDevAU January 22, 2024 09:06
</Helmet>
);
}) => {
const isHomePage = location.pathname === '/';
Copy link
Member

Choose a reason for hiding this comment

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

I feel this might need an ? as location might be undefined during build

Suggested change
const isHomePage = location.pathname === '/';
const isHomePage = location?.pathname === '/';

Copy link
Member

Choose a reason for hiding this comment

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

well I guess it did build in staging... so maybe disregard these :P

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, the location is populated by Gatsby, so it should be present during build 🙂

};

const pageTitleFull = setFullTitle();
const canonical = parentSiteUrl + (location.pathname || '');
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const canonical = parentSiteUrl + (location.pathname || '');
const canonical = parentSiteUrl + (location?.pathname || '');

same with here

Copy link
Member

@JackDevAU JackDevAU left a comment

Choose a reason for hiding this comment

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

Looks good 🚀

@Aibono1225 Aibono1225 merged commit 72bc862 into main Jan 23, 2024
6 checks passed
@Aibono1225 Aibono1225 deleted the page-title-best-practice branch January 23, 2024 01:48
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.

2 participants