-
Notifications
You must be signed in to change notification settings - Fork 12
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
external css order not consistent #8
Comments
I can fix the problem by changing (in
to
I still don't get how it could be that they loaded in the right order on my local server, and why this behaves differently on local and distant server ? |
Why not submit a PR for this? |
@rhukster It sounds like a bug to me as the assets should keep the order they were added in. |
Ok, looking at this, it seems they are added by default with an order based on a md5 of the asset (to ensure no duplicates are added), this md5 must be different on different machines (probably due to path differences) and that is throwing the order. I'll dig deeper. |
I've looked at this in-depth and asset sorting is working 100% as it should as far as I can tell. Basically there's two factors in sorting, first the order in which the assets are added. Up to a couple of versions ago (of Grav core), plugins were processed in the order they were found in the filesystem, now they are sorted based on their name, so it's more consistent. Inside a plugin, the order should be the order they are added via the This 'order' is used for sorting unless there is a 'priority' field provided, if provided that is taken into account, else the 'priority' is I can't see how this is getting out of order on different systems, as the md5 hash is not actually used for sorting at all, it's purely for detecting duplicates. |
I checked the code and I agree. The only reason why the ordering of the assets would be different is that something else loads some of the assets first -- or before your code from above. |
I´ve the same problem here. Also it seems to be difference if the plugin is used more than once on the same page. |
Hi,
When I pushed my website online, owl externals css where not loaded in the same order than on my local developpement server.
Local :
Online :
This leads to different rendering, especially the left-right arrows that have an ugly gray background instead of the transparent black one.
I don't know if the bug is in grav, shortcode-code or this repo though ?
The text was updated successfully, but these errors were encountered: