Closed blackfyre closed 8 months ago
The recent changes focus on enhancing SEO friendliness of URLs by including artist names along with IDs. The updates involve restructuring the backend code to support the generation of these improved URLs. Now, the URLs are constructed using properties that include both slugs and IDs. This approach allows for self-healing URLs, as the correct page can be found as long as the ID is correct, even if the slug has typos or changes.
File Path | Change Summary |
---|---|
.../partials/artworks_results.html |
Updated link attributes to use .ArtworkUrl . |
handlers/artist.go |
Restructured registerArtist into processArtist and processArtwork ; modified caching. |
handlers/artists.go |
Changed URL construction to use entire artist object. |
handlers/artworks/main.go |
Added "ArtworkUrl" field to search results. |
handlers/musics.go |
Simplified error handling in GetParsedMusics . |
handlers/utils.go |
Modified artistUrl to accept models.Record . |
migrations/1698736507_add_music_tables.go |
Adjusted error handling for GetParsedMusics . |
utils/jsonld/main.go |
Changed function signature for JSON-LD content. |
Objective | Addressed | Explanation |
---|---|---|
SEO friendly URLs with artist names and IDs (#82) | ✅ | |
Redirect to correct page on slug typo or change (#82) | ❓ | The changes indicate a structure to support self-healing URLs but there's no explicit mention of redirect logic handling. |
Avoiding long list of redirections and complex logic (#82) | ✅ |
The code changes seem to align with the objectives of making URLs SEO friendly and reducing the need for complex redirection logic by including both slugs and IDs in the URLs. However, the specifics of how typos in the slug are handled (i.e., whether there's a redirect to the correct page) are not clear from the summary provided.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Link enhancements in Artwork Results The relevant updates in the artworks_results.html file include adjustments to a link's attributes. It now uses variable values rather than hardcoded ones, providing flexibility and adaptability to changing data.
Changes to Artist URL For the artists.go file, modifications have been made to the URL field in the artist's map. It now calls upon a distinct function while still using the same input.
New Field in Artwork Search In the artworks/main.go file, a new data field called "ArtworkUrl" has been introduced to the search function's row map, likely enhancing search results and efficiency.
Error Handling Adjustment in Music Retrieval The GetParsedMusics function found in the musics.go file has seen adjustments in the handling of error return values. In specific scenarios, it now returns 'nil' instead of 'nil, err' which promises to improve error handling.
Function Signature Update in Utility Functions
The function 'artistUrl' in the utils.go file has had its signature altered. The input it requires is now a pointer to a models.Record
instead of a string, suggesting an enhancement in data handling and manipulation.
Migration Error Handling Improvement In the add_music_tables.go file, error handling while assigning composers has been improved, returning 'nil' instead of 'nil, err', similar to the above handling adjustments.
Full URL Update in JsonLD generation
An alteration in the utils/jsonld/main.go file has changed the 'fullUrl' variable. It now includes the artist's id in the URL within the GenerateArtistJsonLdContent
function. This change could mean better artist identification and easier data management.
Closes #82
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Documentation