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

Fix : Replace kebab function by slug for SEO optimization #559

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

BeeKpr7
Copy link

@BeeKpr7 BeeKpr7 commented Jan 27, 2025

Actually:

When we generate a “Table of Contents,” the links are generated using the kebab function based on the headings.

Summary:

This PR replaces the use of the kebab() function with the slug() function to enhance SEO optimization. The change ensures that generated slugs are more readable for search engine bots, leading to improved indexing and discoverability.

Reason for the Change:

•	The kebab() function only transforms strings into kebab-case, but it does not handle special characters, accents, or transliteration.
•	The slug() function is specifically designed for SEO purposes. It:
•	Converts accented characters (e.g., é) into their plain counterparts (e.g., e).
•	Removes special characters that are unsuitable for URLs.
•	Creates clean, URL-friendly slugs that improve search engine readability.

Benefits:

1.	Improved SEO: The slug() function produces slugs that are optimized for search engine crawlers.
2.	Better Readability: Generated slugs are more human-readable and suitable for URLs.
3.	Standardization: Aligns with Laravel’s best practices for slug generation.

Implementation Details:

•	Replaced all occurrences of kebab() with slug() in the relevant codebase.
•	Ensured backward compatibility where applicable by maintaining similar behavior with the improved functionality.

Testing:

•	Verified that all slugs are correctly generated in various scenarios (e.g., strings with special characters, multiple spaces, or accented characters).
•	Tested for edge cases to ensure no regressions.

Impact:

This change improves the overall quality of URL slugs, making them more compliant with SEO best practices and enhancing the user experience.

@awcodes awcodes merged commit 0846f4e into awcodes:3.x Jan 27, 2025
6 checks passed
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.

3 participants