From technique at gmail.com Wed Oct 21 23:44:53 2009
From: technique at gmail.com (Jason Wong)
Date: Wed, 21 Oct 2009 20:44:53 -0700 (PDT)
Subject: [webgen-users] Compass & Webgen
Message-ID: <3e866191-5b4d-4cfc-8f6d-ee9e0d389cbc@j9g2000prh.googlegroups.com>
is there a way to install compass http://wiki.github.com/chriseppstein/compass
on Webgen?
From t_leitner at gmx.at Thu Oct 22 13:58:55 2009
From: t_leitner at gmx.at (Thomas Leitner)
Date: Thu, 22 Oct 2009 19:58:55 +0200
Subject: [webgen-users] Compass & Webgen
In-Reply-To: <3e866191-5b4d-4cfc-8f6d-ee9e0d389cbc@j9g2000prh.googlegroups.com>
References: <3e866191-5b4d-4cfc-8f6d-ee9e0d389cbc@j9g2000prh.googlegroups.com>
Message-ID: <20091022195855.5d1da988@noeato.local>
> is there a way to install compass
> http://wiki.github.com/chriseppstein/compass on Webgen?
Sass is supported by webgen and it seems that compass is just a layer
on top of Sass (from a first look at it). So you might just get away by
putting the needed sass files in webgen's src/ directory and naming
them something.sass.css.
If there is something more to it, you may have to create a content
processor for compass (you can take the one from sass and change the
needed parts).
-- Thomas
From pema at dri.cefetmg.br Fri Oct 23 18:21:23 2009
From: pema at dri.cefetmg.br (Paulo Almeida)
Date: Fri, 23 Oct 2009 15:21:23 -0700 (PDT)
Subject: [webgen-users] webgen, include files and "static-changing" pages
Message-ID: <44361556-6878-4ab6-ba65-33905a659308@d34g2000vbm.googlegroups.com>
Hi webgen users,
I am using the tool for some weeks and now I am trying to maximize
content reuse. I have a block of content (called "announce") which
should be rendered in my leftside bar, for SOME of my pages. So I
created a file called "announces.inc" in my root website folder and
tried to conditionally call it, inside default.template, like the
following code:
<% if context.node.node_info[:page].blocks.has_key?('announce') %>
{include_file: news.inc}
<% end %>
The condition works fine, selecting the appropriatte files to include
the content, but the content itself is not well formatted as expected.
Instead of using CSS properties defined to "announce" class, the raw
"markdown" tags are presented in the output files, exact like this:
### News: **09/set/2009:** New version of home-page, using *webgen*.
[Read more...](noticia001.html) ### Comments: [Place a comment about
my page...](comments.html#disqus_thread)
What am I doing wrong here?
Another problem I have is that I want to create a page with some news.
The headlines should appear at the main body of a "first news
page" (FNP), with links to each complete article. Each article is a
file newsXXX.page (newsXXX.html after webgen) and those headlines in
the FNP should be ordered by date. Each time I put a new file on this
folder, I will recompile the code and I would like it to have the
headlines updated in the FNP. Is this possible?
Thx 4 your attention and help,
Paulo
From damien.pollet at gmail.com Sat Oct 24 09:37:38 2009
From: damien.pollet at gmail.com (Damien Pollet)
Date: Sat, 24 Oct 2009 15:37:38 +0200
Subject: [webgen-users] webgen, include files and "static-changing" pages
In-Reply-To: <44361556-6878-4ab6-ba65-33905a659308@d34g2000vbm.googlegroups.com>
References: <44361556-6878-4ab6-ba65-33905a659308@d34g2000vbm.googlegroups.com>
Message-ID: <34b4844b0910240637n7ae04d8elbbbfc61599641c5f@mail.gmail.com>
On Sat, Oct 24, 2009 at 00:21, Paulo Almeida wrote:
> ?The condition works fine, selecting the appropriatte files to include
> the content, but the content itself is not well formatted as expected.
> Instead of using CSS properties defined to "announce" class, the raw
> "markdown" tags are presented in the output files, exact like this:
Did you try to set the process_output argument to include_file?
http://webgen.rubyforge.org/documentation/tag/includefile.html
> the FNP should be ordered by date. Each time I put a new file on this
> folder, I will recompile the code and I would like it to have the
> headlines updated in the FNP. Is this possible?
No idea there, but I want to do basically the same, so I'm interested
in anything you find :)
--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet
From t_leitner at gmx.at Sat Oct 24 13:46:59 2009
From: t_leitner at gmx.at (Thomas Leitner)
Date: Sat, 24 Oct 2009 19:46:59 +0200
Subject: [webgen-users] webgen, include files and "static-changing" pages
In-Reply-To: <44361556-6878-4ab6-ba65-33905a659308@d34g2000vbm.googlegroups.com>
References: <44361556-6878-4ab6-ba65-33905a659308@d34g2000vbm.googlegroups.com>
Message-ID: <20091024194659.083c4349@noeato>
> I am using the tool for some weeks and now I am trying to maximize
> content reuse. I have a block of content (called "announce") which
> should be rendered in my leftside bar, for SOME of my pages. So I
> created a file called "announces.inc" in my root website folder and
> tried to conditionally call it, inside default.template, like the
> following code:
>
>
>
> {include_file: news.inc}
>
Okay, I think what you want. You should do the following: create a file
called "announces.page" (not .inc) and set the meta information
`no_output: true` (then the page itself does not get rendered into an
output file). After that you use the following instead of the
`include_file` tag:
This renders the content of the announces.page according to *its
processing pipeline* and not according to the processing of the
default.template which is what you probably want.
> Another problem I have is that I want to create a page with some news.
> The headlines should appear at the main body of a "first news
> page" (FNP), with links to each complete article. Each article is a
> file newsXXX.page (newsXXX.html after webgen) and those headlines in
> the FNP should be ordered by date. Each time I put a new file on this
> folder, I will recompile the code and I would like it to have the
> headlines updated in the FNP. Is this possible?
Certainly, yes. You would need some ERB to do this, something like the
following in your FNP file:
<%
context.content_node.tree.node_access[:alcn].select do |alcn,no|
alcn =~ /\/news.*\.html/ && no.is_file?
end.collect {|na,no| no}.sort do |a,b|
a['sort_date'] <=> b['sort_date']
end.reverse.each do |node|
%>
<%= node.title %>
Published on <%= node['created_at'].strftime("%A, %d %B %Y") %> -
<%= context.dest_node.link_to(node, :link_text => "More information...") %>
<% end %>
The second line selects the nodes by matching the ALCN to a pattern (in
this case, all files like /news*.html). The fourth line sorts the files
by the meta information `sort_date` which has to be set by all files
(you can use any other meta information key). The body just puts the
title of the news page in an H1 header and puts a link to the page
below.
Best regards,
Thomas
From pema at dri.cefetmg.br Mon Oct 26 18:16:48 2009
From: pema at dri.cefetmg.br (Paulo Almeida)
Date: Mon, 26 Oct 2009 15:16:48 -0700 (PDT)
Subject: [webgen-users] webgen, include files and "static-changing" pages
In-Reply-To: <20091024194659.083c4349@noeato>
References: <44361556-6878-4ab6-ba65-33905a659308@d34g2000vbm.googlegroups.com>
<20091024194659.083c4349@noeato>
Message-ID:
Thank you very much, Thomas!!!
I tried your suggestions and almost everything I needed is running
fine right now. I will comment out some details in the lines below, to
keep the forum well documented...
On Oct 24, 3:46?pm, Thomas Leitner wrote:
> (...)
> Okay, I think what you want. You should do the following: create a file
> called "announces.page" (not .inc) and set the meta information
> `no_output: true` (then the page itself does not get rendered into an
> output file). After that you use the following instead of the
> `include_file` tag:
>
> ? ?
>
> This renders the content of the announces.page according to *its
> processing pipeline* and not according to the processing of the
> default.template which is what you probably want.
Works like a charm, as I needed!!! ;)
> > Another problem I have is that I want to create a page with some news.
> > The headlines should appear at the main body of a "first news
> > page" (FNP), with links to each complete article. Each article is a
> > file newsXXX.page (newsXXX.html after webgen) and those headlines in
> > the FNP should be ordered by date. Each time I put a new file on this
> > folder, I will recompile the code and I would like it to have the
> > headlines updated in the FNP. Is this possible?
>
> Certainly, yes. You would need some ERB to do this, something like the
> following in your FNP file:
>
> <%
> context.content_node.tree.node_access[:alcn].select do |alcn,no|
> ? alcn =~ /\/news.*\.html/ && no.is_file?
> end.collect {|na,no| no}.sort do |a,b|
> ? a['sort_date'] <=> b['sort_date']
> end.reverse.each do |node|
> %>
> <%= node.title %>
> Published on <%= node['created_at'].strftime("%A, %d %B %Y") %> -
> <%= context.dest_node.link_to(node, :link_text => "More information...") %>
> <% end %>
> The second line selects the nodes by matching the ALCN to a pattern (in
> this case, all files like /news*.html). The fourth line sorts the files
> by the meta information `sort_date` which has to be set by all files
> (you can use any other meta information key). The body just puts the
> title of the news page in an H1 header and puts a link to the page
> below.
Ok, again it works, with some minor problems and corrections:
1. Instead of
>>> <%= node.title %>
I am using
>>> <%= node['routed_title'] %>
2. One problem I could not solve yet is the next line:
>>> Published on <%= node['created_at'].strftime("%A, %d %B
%Y") %> -
I keep getting error messages saying that some "nil" class
doesn't know the
strftime method. But I can live without this.
3. Another one is as follows: my FNP includes, on top of actual
headlines from my news, a "fake"
headline containing title of the index.html page on my "news"
folder. I tried using "in_menu: false"
and "no_output: true", but without success as of now. In summary,
if I have N news in the folder,
I get N+1 headlines in my FNP, and the first one is a fake news
corresponding to the index page.
As I am not initiated with Ruby, for now, I could not fix this. Any
ideas? Thx again for your help.
Paulo
From t_leitner at gmx.at Tue Oct 27 07:44:23 2009
From: t_leitner at gmx.at (Thomas Leitner)
Date: Tue, 27 Oct 2009 12:44:23 +0100
Subject: [webgen-users] webgen, include files and "static-changing" pages
In-Reply-To:
References: <44361556-6878-4ab6-ba65-33905a659308@d34g2000vbm.googlegroups.com>
<20091024194659.083c4349@noeato>
Message-ID: <20091027124423.65144223@noeato>
> Ok, again it works, with some minor problems and corrections:
> 1. Instead of
> >>> <%= node.title %>
>
> I am using
> >>> <%= node['routed_title'] %>
That's okay but `routed_title` is normally only defined for directory
index files. So you might want to use something like
<%= node['routed_title'] || node['title'] %>
And `node.title` naturally doesn't work ;-) My fault, sorry!
> 2. One problem I could not solve yet is the next line:
> >>> Published on <%= node['created_at'].strftime("%A, %d %B
> %Y") %> -
>
> I keep getting error messages saying that some "nil" class
> doesn't know the
> strftime method. But I can live without this.
Try using the meta information `modified_at` instead of `created_at`.
The former is available on all nodes while the latter has to be set
individually since it cannot be derived.
> 3. Another one is as follows: my FNP includes, on top of actual
> headlines from my news, a "fake"
> headline containing title of the index.html page on my "news"
> folder. I tried using "in_menu: false"
> and "no_output: true", but without success as of now. In summary,
> if I have N news in the folder,
> I get N+1 headlines in my FNP, and the first one is a fake news
> corresponding to the index page.
Ah, okay. If all page files in your "news" folder are news files except
the index.page, you can use the following (replace the fomer version):
<%
context.content_node.tree.node_access[:alcn].select do |alcn,no|
alcn =~ /\/news\/.*\.html/ && no.is_file? && no.acn != '/news/index.html'
<--- HERE COMES THE REST FROM THE OTHER POST
If you need any further help, just write again :-)
Best regards,
Thomas