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
LESS processing issue, have to run nikola twice #2495
Comments
Ok, so, here's why this happens, then let's see if we can find a way to fix it. The bundling builds from files in LESS and similar plugins work from sources in the theme. So, you have one task that copies So, as you can see, if the bundle depends correctly on Since it doesn't, clearly one of the things I said above is not true. All that's needed is to reproduce the bug and figure out which one :-) |
@russel: can you check whether my PR (getnikola/plugins#168) fixes this problem for you? |
@felixfontein Is this now in a release on PyPI so that a pip upgrade will bring the change to me? |
Nikola plugins are not part of the main release. They are part of the plugins repo. You would still need to manually download them from @felixfontein’s fork. |
@Kwpolska I feel a bit of an idiot, of course it doesn't come form PyPI. It would obviously be better just to reinstall from the plugins repository if that were possible, but it sounds like I have to do something manually. |
Just grab |
Wilco. |
It's now merged, so you can also take the file from the https://github.com/getnikola/plugins repository. (Direct link: https://raw.githubusercontent.com/getnikola/plugins/master/v7/less/less.py) |
Any news on this @russel? |
I did a "nikola plugin --upgrade" and I assume new stuff got downloaded, it is claiming to be v0.1. The build_less appears to happen before the create_bundles. However the first pass is not stable, you still have to run a second pass. So having done "nikola build" and have everything build a second "nikola build" cause:
with a third "nikola build" doing nothing. |
Can you run |
In particular, take a look whether the files generated by your LESS tasks are in the |
I think this is the data you are after:
|
Yes, thanks. Hmmm, that's strange. The data looks like it is correct: So either the dependencies of Can you try to run You can also try modifying the SCSS file slightly so it generates a different CSS file (like add a dummy rule at the end; some whitespace changes might not be enough) and then run:
|
Also, could you describe your setup a little bit? Which theme do you use, and are you using any other |
I think I followed the protocol, I think the last line is a bit weird?
|
The site is a part of the ACCU website, though I get similar problems with my personal site. The ACCU website code is public, the code for my site is not. The ACCU website is part Flask application part Nikola generated static pages; the repository hold two directories one for each bit. |
I tried the ACCUConf website; every time I change |
There's something else strange happening, though: when starting with the empty site (without
For all but the last two, a changed For the last two, this happens because the dependency |
Ah. The change for the first tasks is that |
The best / only way to solve this is probably to extend the @ralsina, @Kwpolska: what do you think? Or do you have other ideas on how to fix this? |
The alternative is to say that, like XeLaTeX, one run is never enough, always run things twice. Seriously, if the fix is tortuously complicated, it is fine to say that with some plugins you have to run the build twice to get over phasing issues. |
Hmmmm... we can use plugin dependency injection. If a plugin generates CSS, it could install itself as a dependency for less, or something like that. Or the other way around, I have not read this very thoroughly. |
This is not going to be easy/possible to fix, running |
I am finding that I have to run "nikola build" twice when using LESS processing and bundles. My hypothesis is that on the first execution the bundle is created without the output of the execution of lessc on the LESS source. On the second run the bundling picks up the previously created CSS from the LESS source. You have to do a "nikola clean" to really see this happening.
The text was updated successfully, but these errors were encountered: