Open jonkoops opened 5 months ago
@djc: Is it another issue with "the askama book is the not yet released version?". If so we should have a "nightly" and "stable" link for both, what do you think?
Another thing I noticed is that the example test file linked in the book also does not follow the recommendation of using the askama_axum
package.
@djc: Is it another issue with "the askama book is the not yet released version?". If so we should have a "nightly" and "stable" link for both, what do you think?
IIRC someone tried this and it introduced a lot of complexity (there's probably a closed PR somewhere), which I didn't like. If there's an efficient way (in terms of added code/complexity) to do it, would be okay -- but also this kind of disparity is pretty rare and it's not like we get a zillion issues from it.
Just as some feedback I spent around 1h trying to figure out why I wasn't getting askama_axum::Template with askama 0.12 as the book recommends.
Hi, consider this as much a question as an issue report. I am quite new to the Rust ecosystem, so forgive me if this comes across as a tad ignorant. The documentation for the Axum integration states:
However, when I have both
askama
andaskama_axum
installed, I can also use the 'regular'askama::Template
without getting any compilation issues. For example:Is this intended to work as such, and is it ok to keep using it like this? Why would one need to use
asaka_axum
and what extra does it do on top of the regular template?I am also interested in how Cargo manages dependencies. If I install
askama_axum
I can see thataskama
is listed as a dependency, so I would expect that if I listaskama_axum
as the only dependency inCargo.toml
, it would also bringaxum
along.However, if I modify the code above to use
askama_axum::Template
as the documentation states, and only installaskama_axum
, then I get the following compilation error:This is strange because
Template
is imported fromaskama_axum
and notaskama
. But it leads me to believe that I need to have bothaskama_axum
andaskama
listed inCargo.toml
, even though my code does not directly depend onaskama
. Is this intentional behavior? Should I be listing both? If so, why isaskama
not pulled in withaskama_axum
?Again, total novice here. Feel free to close this issue if it's too much of a hassle to answer. Thanks in advance.