-
Notifications
You must be signed in to change notification settings - Fork 6
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
Limit page title to 60-70 chars for SEO #677
Conversation
If you didn't want to do it in the template, you could also move it to the merge() function which should be part of each of the Controller on it's way to the view. Also can be tested with where the merge tests happen, though not 100% sure. Long-term solution, we move the 2 helper functions to part of a helper repository for each of them as a class rather than a functions. |
That is not a bad idea! All of |
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.
👍🏻 Thank you!
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.
Works for me, lot cleaner
Reason for change
When page titles are longer, the addition of the site name, sur-title name, and then "Wayne State University" pushes the title tag into the triple digits for length.
SEO recommends 60-character limit for page titles.
Proposed solution
Because the page title can be changed up to the line before the view is called, the logic needs to exist in the template itself. Dropping right into raw PHP in Blade.Moved the logic to a helper function which is called within the
merge()
function before the view.Tests have also been added.
Examples
https://engineering.wayne.edu/mechanical/academics/bs
Current:
<title>Bachelor of Science in mechanical engineering - Mechanical Engineering - Wayne State University</title>
Ideal:
<title>Bachelor of Science in mechanical engineering - Wayne State University</title>
https://engineering.wayne.edu/electrical-computer/academics/master-electrical-engineering
Current:
<title>Master of science in electrical engineering - Electrical and Computer Engineering - Wayne State University</title>
Ideal:
<title>Master of science in electrical engineering - Wayne State University</title>
TODO