[webgen-users] How to use js_file

1 view
Skip to first unread message

Martin Denham

unread,
Dec 21, 2009, 7:54:41 AM12/21/09
to webgen...@rubyforge.org
Hi,

I see there is a method of specifying an extra js file for inclusion in the head section of a certain .page file but I can't seem to make it work.  Is there an example anywhere?

I tried:

---
title: My Title
in_menu: true
sort_info: 3
---
Page content .....

Thanks
Martin

Thomas Leitner

unread,
Dec 21, 2009, 11:17:56 AM12/21/09
to webgen...@rubyforge.org
> I see there is a method of specifying an extra js file for inclusion
> in the head section of a certain .page file but I can't seem to make
> it work. Is there an example anywhere?

This functionality is currently available only to webgen extension and
cannot be directly used from a page file. However, this will be enabled
in the next release.

-- Thomas
_______________________________________________
webgen-users mailing list
webgen...@rubyforge.org
http://rubyforge.org/mailman/listinfo/webgen-users

Martin

unread,
Dec 21, 2009, 11:36:25 AM12/21/09
to webgen...@rubyforge.org
Thanks Thomas,

That's great. Meanwhile I got around it using the following:

Template file:
<webgen:block name="header" notfound="ignore"/>
Page file
--- name:header
<!-- allow inline play of mp3 files -->
<script type="text/javascript" src="http://static.delicious.com/js/
playtagger.js"> </script>

The only problem with the above is I had to put a space between the
opening and closing script tags to prevent the markdown processor
converting to a single empty script tag which breaks ie.

Also, I don't know why the preceding comment line line gets combined
with the script line - there are 2 spaces on the end which I thought
would cause a carriage return.

Regards
Martin

Thomas Leitner

unread,
Dec 21, 2009, 2:29:05 PM12/21/09
to webgen...@rubyforge.org
> Template file:
> <webgen:block name="header" notfound="ignore"/>
> Page file
> --- name:header
> <!-- allow inline play of mp3 files -->
> <script type="text/javascript" src="http://static.delicious.com/js/
> playtagger.js"> </script>
>
> The only problem with the above is I had to put a space between the
> opening and closing script tags to prevent the markdown processor
> converting to a single empty script tag which breaks ie.
>
> Also, I don't know why the preceding comment line line gets combined
> with the script line - there are 2 spaces on the end which I thought
> would cause a carriage return.

If you just use HTML, you should turn off at least Markdown processing
in the block or simply don't use any content processor:

--- name:header pipeline:

-- Thomas

Reply all
Reply to author
Forward
0 new messages