zotero / styles-repo

Zotero styles page
http://www.zotero.org/styles
14 stars 12 forks source link

Tweaks to styles repo page #7

Closed aurimasv closed 11 years ago

aurimasv commented 11 years ago

Commits are fairly self-explanatory.

Re s argument in the URL. I think I have mentioned this in some post before, but the point of this is so we can easily link people to the correct styles in the repository. I know that we could link to the source, but it's much more convenient for the user if he can preview the style and maybe even automatically install it instead of looking at the source.

This will probably not work out of the box with the current styles-repo setup on zotero.org, since I see that there are some rewrite rules going on to access styles.php from zotero.org/styles directly. It also looks like the current rewrite rules would not allow arguments at all. So I'm not sure if this is a good enough solution for the production server. Would love to have this implemented, so let me know if I can fix anything on this side.

aurimasv commented 11 years ago

I think that covers all of your concerns.

aurimasv commented 11 years ago

I adjusted the comment in README.md, let me know if you want me to remove it completely.

I think I also figured out the issue I was having with the RewriteRule. The interesting details are towards the bottom of the question (under the horizontal rule) and in the answer I gave below over here: http://serverfault.com/questions/531791/rewriterule-not-working-with-mod-userdir I'm not sure if my reasoning is sound there, but the current solution works for my setup.

The only remaining issue is that the absolute paths for the js and css files are still causing trouble with mod_userdir. I thought that using the HTML <base.../> tag in the header (e.g. <base href="http://localhost/~aurimas/styles/" />) would solve this issue, but it seems to be ignored (at least on Ubuntu). Is that not what it's supposed to do?

My solution was to add a RedirectMatch /styles-files /~aurimas/styles/styles-files directive to the server configuration, which is not great, but it worked. I couldn't think of a good portable solution (other than my attempt at the <base.../> tag) that would work in both php and js files.

dstillman commented 11 years ago

I adjusted the comment in README.md, let me know if you want me to remove it completely.

Yeah, please do. It needs MultiViews. If that's not working for people for some reason, they can deal with it. I'd rather not get into the minutiae of system-specific Apache configuration.

aurimasv commented 11 years ago

Done.

I'll just reference my findings from this pull request so they're not lost.

If rewrite rules are not working for static files, see: http://serverfault.com/questions/531791/rewriterule-not-working-with-mod-userdir

If MultiViews is not working, it may be necessary to add the following directive to the server configuration (e.g. mime.conf) for MultiViews to work on php files: AddType application/x-httpd-php .php

aurimasv commented 11 years ago

Done

dstillman commented 11 years ago

Great, thanks.

dstillman commented 11 years ago

Pushed.

aurimasv commented 11 years ago

Great. Thanks! I'll send an update on the zotero-dev mailing list.