<?xml version="1.0"?> <html><head/> <body>Hi all,<br/><br/>I''m currently in the process of trying to understand webgen 0.5.2, because it seems to be a great tool. But I noticed that studying the current 0.5.x documentation is not enough to make fully use of it, or understand it fully. So I went over to the webgen-user mailing list to learn more. I tried some hints from the mailing list, but most of them seem to be not funcional because of the new 0.5.x rewrite. Hence the following questions (some of which were asked already, bur for older versions):<br/><br/>1) Is/Are there still metainfo.yaml file(s) and is there a documentation for them?<br/><br/>2) Is an index.page file in a subdirectory imperative? Or is it possible to point to another file in that subdirectory instead?<br/><br/>3) The index.page file of each subdirectory is shown extra in the submenu. Example:<br/><br/>src/index.page<br/>src/dir1/index.page<br/>src/dir1/chapter1.page<br/>src/dir1/chapter2.page<br/><br/>The menu becomes:<br/><br/>* dir1<br/> |-chapter1<br/> |-chapter2<br/> |-indexfile of dir1<br/>* main indexfile<br/> <br/>The entry ''indexfile of dir1'' would be not neccessary, since clicking on ''dir1'' links you directly to it. Thus: Is it possible to switch this off? <br/><br/>4) How can I change the menu entry ''dir1'' to an arbitrary string? Or, if there exists an index.page of dir1: How can the menu entry ''dir1'' assume the title stored in its index.page file?<br/><br/>5) I would like to set different <body> id''s for each of my first-level menu entries, so that all subordinated levels have that id too. How can this be selected in the default.template file via ERB?<br/><br/>6) Is it better to use this mailing list or use the webgen forums on rubyforge?<br/><br/>I would love to user webgen for a static site that should be finished in about one month...<br/><br/>Thanks,<br/>Michael</body> </html> aonFlex: Mit mobilem Breitband-Internet unlimitiert surfen um nur EUR 7,90* pro Monat. Alle Infos hier: http://www.aon.at/aonflex.
Hi Michael, Am Thu, 14 Aug 2008 12:56:02 +0200 (CEST) schrieb Michael Franzl <m.franzl at aon.at>:> Hi all,I''m currently in the process of trying to understand webgen > 0.5.2, because it seems to be a great tool. But I noticed that > studying the current 0.5.x documentation is not enough to make fully > use of it, or understand it fully. So I went over to the webgen-user > mailing list to learn more. I tried some hints from the mailing list, > but most of them seem to be not funcional because of the new 0.5.x > rewrite. Hence the following questions (some of which were asked > already, bur for older versions): > 1) Is/Are there still metainfo.yaml > file(s) and is there a documentation for them?No, there does not exist a single metainfo.yaml anymore. webgen now supports files in the source directory with the extension metainfo or which are called metainfo. These files replace part of the metainfo.yaml file. The other part of metainfo.yaml, creation of virtual files/directories, is now handled by files in the source directory with the extension virtual or which are called virtual. Since both file types are handled by a source handler, you just need to look at the source handler documentation for these file types to get the needed information: http://webgen.rubyforge.org/documentation/sourcehandler/metainfo.html http://webgen.rubyforge.org/documentation/sourcehandler/virtual.html> 2) Is an index.page > file in a subdirectory imperative? Or is it possible to point to > another file in that subdirectory instead?You can point to any file since the file that is used as directory index file is specified by the meta information key `index_path`. Just create a metainfo file and set the meta information `index_path` on the directory. For example, when having the following structure: /hallo/ /hallo/index.page /hallo/other.page you create a file `metainfo` in the root directory with the following contents: hallo/: index_path: other.html Since the value of `index_path` needs to be an (l)cn, you need to use `other.html` instead of `other.page`.> 3) The index.page file of > each subdirectory is shown extra in the submenu. > Example:src/index.pagesrc/dir1/index.pagesrc/dir1/chapter1.pagesrc/dir1/chapter2.pageThe > menu becomes:* dir1 |-chapter1 |-chapter2 |-indexfile of dir1* main > indexfile The entry ''indexfile of dir1'' would be not neccessary, > since clicking on ''dir1'' links you directly to it. Thus: Is it > possible to switch this off?Yes, certainly. Just set the meta information `in_menu` to false for the index pages. Then the index pages themselves won''t be shown in the menu.> 4) How can I change the menu entry > ''dir1'' to an arbitrary string? Or, if there exists an index.page of > dir1: How can the menu entry ''dir1'' assume the title stored in its > index.page file?You have two possibilities: if you want localized directory names, you need to set the meta information `routed_title` on the index files. Otherwise, you need to set the `title` meta information on the directory itself via a metainfo file.> 5) I would like to set different <body> id''s for each > of my first-level menu entries, so that all subordinated levels have > that id too. How can this be selected in the default.template file > via ERB?I don''t know what you mean. Which id''s should be set and for which HTML element should they be set. And: id''s have to be unique in a single HTML file!> 6) Is it better to use this mailing list or use the webgen > forums on rubyforge?I would love to user webgen for a static site > that should be finished in about one month...Thanks,MichaelYou can use the mailing list or the forums, I watch both. Use what is easier for you. This malinig list is mirrored to the google group with the same name. -- Thomas
First, I''m sorry for the html format of my last mail. I used a webmail client, which is really a bad idea for mailing lists. But now I''m in front of my text-only Mozilla ;-) Your hints for my questions 2), 3) and 4) worked, thanks! >> I would like to set different <body> id''s for each >> of my first-level menu entries, so that all subordinated >> levels have that id too. How can this be selected in >> the default.template file via ERB?> I don''t know what you mean. Which id''s should be set and for which HTML > element should they be set. And: id''s have to be unique in a single > HTML file!Using ''id'' for <body> tags is legitimate, since there is only one <body> in a html file. Ideally, I want to use only one template file (DRY principle). To use different color themes for each of my first-level menu entries ("Series" in the example below) via CSS, I would have to dynamically select an <body> id in the template file. Example: * Frontpage * SeriesA |- Book1 |- Book2 | |- Chapter1 | |- Chapter2 * SeriesB |- Book1 |- Book2 | |- Chapter1 | |- Chapter2 etc. Everything under SeriesA should have <body id="a">, and everything under SeriesB should have <body id="b">. Is an ERB if-statement the correct approach? If so, where can I find out the objects/methods/variables I would have to evaluate? In an article about webgen I found this code snippet which serves a slightly different purpose, but I think the object hierarchy has changed since: <% if node.node_info[:pagedata].blocks.has_key?( ''extras'' ) %> {block: extras} <% end %> Thank you, Michael
Am Thu, 14 Aug 2008 23:18:22 +0200 schrieb Michael Franzl <m.franzl at aon.at>:> First, I''m sorry for the html format of my last mail. I used a > webmail client, which is really a bad idea for mailing lists. But now > I''m in front of my text-only Mozilla ;-)No problem! :)> Your hints for my questions 2), 3) and 4) worked, thanks!Good to hear.> Using ''id'' for <body> tags is legitimate, since there is only one > <body> in a html file. Ideally, I want to use only one template file > (DRY principle). To use different color themes for each of my > first-level menu entries ("Series" in the example below) via CSS, I > would have to dynamically select an <body> id in the template file. > Example: > > * Frontpage > * SeriesA > |- Book1 > |- Book2 > | |- Chapter1 > | |- Chapter2 > * SeriesB > |- Book1 > |- Book2 > | |- Chapter1 > | |- Chapter2 > etc. > > Everything under SeriesA should have <body id="a">, and everything > under SeriesB should have <body id="b">. Is an ERB if-statement the > correct approach? If so, where can I find out the > objects/methods/variables I would have to evaluate? In an article > about webgen I found this code snippet which serves a slightly > different purpose, but I think the object hierarchy has changed since: > > <% if node.node_info[:pagedata].blocks.has_key?( ''extras'' ) %> > {block: extras} > <% end %>Thanks for the clarifications! There are various ways to accomplish this. One would be to set a meta information key to the needed value and use that value to set the body id, like this: The /metainfo file: /SeriesA/**/*.page: body_id: a /SeriesB/**/*.page: body_id: b The /default.template file: <body <%= node[''body_id''] ? "id=''#{node[''body_id'']}''" : "" %> > ... </body> You can find information on the valid objects useable by ERB on its documentation page http://webgen.rubyforge.org/documentation/contentprocessor/erb.html -- Thomas