On Sat, Jul 18, 2009 at 6:55 AM, David Gerarddgerard@gmail.com wrote:
2009/7/18 Robert Rohde rarohde@gmail.com:
On Sat, Jul 18, 2009 at 6:20 AM, David Gerarddgerard@gmail.com wrote:
It'd actually be better if Google properly indexed text pages whose name ends in .jpg or whatever ... but they're aware we'd like that, so it's up to them.
Which is why my personal wiki is patched to translate the ".jpg" into "_jpg", etc. for all references to image description pages.
Hmmmmmmmmmmmmmmmm. How much hacking would MediaWiki on Wikimedia need for _jpg to be the default image page name and .jpg an alias for backward compatibility? That'd be really helpful in all sorts of ways
- on pretty much any website *not* running MediaWiki, something ending
".jpg" is going to be the image, not a text page.
Honestly, I'm not entirely sure how large a hack it would be. In my particular case, the hack I added was in the link generator very late in the process and fairly ugly. Really, one should probably be modifying Title.php to change the url form of image description page name, but there may be unexpected dependencies associated with doing that. Also, in my hack I used apache's mod_rewrite to get the right destination for incoming queries, but for a generally application this should also be handled by Title.php or something similar.
As long as one requires files have explicit type suffixes (e.g. ".jpg", ".svg", etc), one can use the allowed list to determine what file names to translate without generating conflicts. I believe all Wikimedia sites require such suffixes, but Mediawiki can be configured to remove that requirement which would need to be considered for a general application (i.e. what to do if the configuration allows separate files named "Foo_jpg" and "Foo.jpg")
I'd definitely like to see Mediawiki include a configuration option so that image description pages would handle the suffix differently, so maybe I'll think about it a bit more. This is one of a half dozen or so issues that I end up repatching on my local install every time I decide to upgrade.
-Robert Rohde