[Seaside] How can I specify path to css and js libs?

Mariano Martinez Peck marianopeck at gmail.com
Sat Oct 11 16:03:47 UTC 2014


Thank you Esteban and James (more below).


On Sat, Oct 11, 2014 at 4:12 AM, Johan Brichau <johan at inceptive.be> wrote:

> This what the resource base url setting [1] does.
>
> I’m guessing you are including Seaside’s file libraries to add these
> resources to your application but that nginx captures the url’s generated
> by Seaside?
> I think you have two options:
> - forget about file libraries served by Seaside and reference the
> statically served files yourself (in #updateRoot:  you do  `` aRoot
> stylesheet resourceUrl: '/stylesheets/main.css’ ‘ ‘' )
>

OK, good. I didn't know that one.


> - change the location where Seaside serves the file libraries (this is
> configurable)
>
>
Well, this is what I wanted to do and I already saw that link. But I had
/config disabled from my nginx config...and in any case, I wanted to do
that via code. I ended up doing:

WAFileHandler default preferenceAt: #resourceBaseUrl put: (WAUrl new
addToPath: '/mariano/webfiles').

Is this the expected way? It seems a bit clunky... but at least the links
were generated as I wanted.

Esteban, the "Maybe simply setting #resourceBaseUrl to 'siteX' in your
WAApplication (at root) would do the trick.". That didn't help. Reviewing
the code I notived that I HAD to set the preference to WAFileHandler
default, not the app...

*In any case....all of this was to try to fix a requirement I have but I at
end I am not sure if even adding this preffix would help me. The
requirement is here if someone han answer in mind
;) http://stackoverflow.com/questions/26285450/nignx-try-files-in-different-directories-for-different-locations
<http://stackoverflow.com/questions/26285450/nignx-try-files-in-different-directories-for-different-locations>*


Thanks in advance,

Hope this helps
> Johan
>
> [1] http://book.seaside.st/book/in-action/serving-files/images
>
> On 10 Oct 2014, at 21:12, Mariano Martinez Peck <marianopeck at gmail.com>
> wrote:
>
> Hi guys,
>
> I am currently serving my css and js static files with nginx. But so far,
> all these were generated in the default root path. For example:
>
> <script type="text/javascript" src="/JQDevelopmentLibrary/jQuery.js
> <https://quuve.com/JQDevelopmentLibrary/jQuery.js>"></script>
> <link rel="stylesheet" type="text/css" href="
> /TBSDevelopmentLibrary/css/bootstrap.css
> <https://quuve.com/TBSDevelopmentLibrary/css/bootstrap.css>"/>
>
> etc...
>
> Now...I would like to be able to set a different prefix path. For example,
> 'siteX', and then urls become:
>
> <script type="text/javascript" src="/siteX/JQDevelopmentLibrary/jQuery.js
> <https://quuve.com/JQDevelopmentLibrary/jQuery.js>"></script>
> <link rel="stylesheet" type="text/css" href="/siteX/
> TBSDevelopmentLibrary/css/bootstrap.css
> <https://quuve.com/TBSDevelopmentLibrary/css/bootstrap.css>"/>
>
> Why I want this?  Because I want to be able to catch these into nginx
> locations and search the files in different places.
>
> Any idea how can I do this?
>
> Thanks,
>
> --
> Mariano
> http://marianopeck.wordpress.com
>  _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>


-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20141011/36110b18/attachment.htm


More information about the seaside mailing list