Skip to content

Website: Add meta titles #837

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

Merged
merged 3 commits into from
Feb 10, 2025
Merged

Website: Add meta titles #837

merged 3 commits into from
Feb 10, 2025

Conversation

cchrischen
Copy link
Collaborator

Summary

The DTI website lacked titles, so all pages were just the URL.

Test Plan

@cchrischen cchrischen requested a review from a team as a code owner February 7, 2025 19:02
@dti-github-bot
Copy link
Member

dti-github-bot commented Feb 7, 2025

[diff-counting] Significant lines: 40.

Copy link
Contributor

@keverie keverie left a comment

Choose a reason for hiding this comment

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

LGTM! 🐐

Copy link
Contributor

@JasonMun7 JasonMun7 left a comment

Choose a reason for hiding this comment

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

Great job creating a hook for this!

const useTitle = (title?: string) => {
useEffect(() => {
document.title = `${title ? `${title} | ` : ''} Cornell DTI`;
}, []);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
}, []);
}, [title]);

I would include the title within the dependency array so it's not only on mount! If we every decide to change the title in the future and for styling!

@cchrischen cchrischen merged commit 57bdcbf into main Feb 10, 2025
5 checks passed
@cchrischen cchrischen deleted the cc/add-meta-titles branch February 10, 2025 23:33
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.

4 participants