-
Notifications
You must be signed in to change notification settings - Fork 13
Add support for vanity names #56
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
base: main
Are you sure you want to change the base?
Conversation
@coreyward any chance you could take a look at this please? Would be good to get into my project and useful for others too I imagine — helps with SEO |
Is there compelling evidence that this is actually beneficial given the context (images served from a third-party domain)? From what I can ascertain, this is actually a net negative:
Additionally, it seems that file names are generally regarded as a much weaker signal than alt text, surrounding content, titles and headers, and relevancy to the page content. I'm generally hesitant to add support for something that's unlikely to benefit users, especially if it bloats the library. |
Hi Corey
A client specifically asked for original filenames to be included in the source code to improve SEO, so I made this change and thought it would be useful for other users of the package — especially as Sanity has this functionality and explicitly states that it's useful for SEO (link). Filenames are definitely weaker than the other signifiers you list but from what I can gather, they still count. Google recommend it at least. Thanks |
Okay, that Google link is helpful. I can see this being of some value in some scenarios. The value is relatively low (as Google says, "the filename can give Google very light clues about the subject matter of the image"), and the approach you're using here makes it a cross-cutting concern of the library, requiring a lot of the codebase to be aware of this behavior. That's not ideal, so I'll need to think about how to handle this better. For my own edification, in this client project, are the vanity names being set to something that looks like a sensible image name including the format? For example, something like "black-lab-puppy.jpg"? Or are the editors doing something more keyword-heavy like "black lab puppy, dogs, puppies"? |
Got ya. Well let me know if / how I can help any further. So the client is just uploading pictures with a descriptive filename, then that filename is pulled through to the front end, rather than adding keywords after the fact. You can see it in use here (looks like they're not filling in the alt tags, which would be much better for SEO by all accounts!) |
This PR adds support for vanity names, as referenced in the Sanity docs here.
When passing in a
vanityName
prop, that string is appended to the URL before the query params.