Closed frederikhors closed 5 years ago
It works fine for me, but I knew what's happened. It's happened to me too when I worked on Windows - back slashes in paths. I patched the develop branch. Please check it and tell me whether the problem fixed.
@catcombo I'm not on Windows right now. I will try in a few days. I'll let you know.
I tried with v0.1.2. Everything works. Thanks.
This project is wonderful and it's something I would have done - sooner or later. So thank you again.
I'm trying to use it but I have some doubts.
REPRODUCTION
You can find a reproduction of my project here: https://github.com/frederikhors/test_go_staticfiles
I'm using the amazing
quicktemplate
but you can try it with go templates too.You can find a
Readme.md
in the project.The branch
master
is without go-staticfiles, my doubts are in branchstaticfiles
.You have a comparison here: https://github.com/frederikhors/test_go_staticfiles/compare/staticfiles?expand=1.
THE PROBLEM
If I follow your usage instructions I change my code from this:
<link rel="stylesheet" href="/static/css/base.css"/>
to this:
<link rel="stylesheet" href="{%s StaticFilesPrefix + Storage.Resolve("css/base.css") %}"/>
but the result is:
<link rel="stylesheet" href="/static/"/>
instead of what I expect:
<link rel="stylesheet" href="/static/css/base.934823cbc67ccf0d67aa2a2eeb798f12.css"/>
WHAT I TRIED
I understand this is a problem with the generated .json manifest you create.
I need to use this:
<link rel="stylesheet" href="{%s StaticFilesPrefix + Storage.Resolve("web\\static\\css\\base.css") %}"/>
to get something from
Storage.Resolve()
.I think because the content of .json manifest is:
Now the final html is:
<link rel="stylesheet" href="/static/web\public\web\static\css\base.934823cbc67ccf0d67aa2a2eeb798f12.css"/>
which is wrong again because my server is serving files from
web/public/web/static
folder (and this is ugly itself) but on pathhttp://localhost:3000/static
without the need for uselessweb\public\web\static\
.ANOTHER QUESTION
And why the backslashes?
Maybe a problem or maybe it's me.
Thanks again.