emacs-love / weblorg

Static Site Generator for Emacs
https://emacs.love/weblorg
GNU General Public License v3.0
282 stars 21 forks source link

Wrong url for static resource in subfolder #56

Closed markokocic closed 3 years ago

markokocic commented 3 years ago

I have the following static route defined

(weblorg-copy-static
 :site blog
 :output "output/{{ file }}"
 :url "/{{ file }}")

Inside a static folder I have some files in root, and some in subfolders.

I use {{ url_for("static", file="res/file-1.pdf") }}

Expected behaviour: I would get "/res/file-1.pdf" in generated file.

Actual behaviour: URL without folder gets generated, like this: "/file-1.pdf"

Files are copied to the correct location (in subfolder), it's only links that don't work.

clarete commented 3 years ago

hi hi @markokocic, sorry I took quite a bit to get to this one. I just tried it out and it seems to be working for me, and I am under the assumption that this was actually an error in how the named parameters for functions were being parsed by templatel. Since I just tried it out and it worked, I might mark this bug as closed. If by any chance I just missed something, please reopen it and we'll take a deeper look!