root/swish_website/lib/config/map

Revision 1889, 8.7 kB (checked in by moseley, 2 years ago)

More updates getting ready to move to the new host
Combined the two search scripts into one.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 [%#
2     Define site-wide navigation map.  See Badger book ch 11 p423
3
4     A menu is a hash that can contain three keys:
5
6
7     menu:
8         The hash *must* contain a "menu" key which is an array of menu
9         items.  These are really the id of each menu, and represent
10         the basename of the page without the final extension.  .html
11         is the final extension but it can be overridden.
12
13         If the item points to a subdirectory (by having a "menu"
14         entry in the "page" array), then it's the name of the
15         subdirectory.
16
17     name:
18         The hash *may* contain a "name" key which is a scalar
19         name used for accessing this menu from a parent menu.
20
21     page:
22         The hash *should* contain a "page" key which is a hash
23         that provides extra details about the menu item.  The "page"
24         hash *may* contain the follow keys:
25
26         name:
27             The description used for the menu item.  If not defined
28             then the key (menu id) is used as the menu description.
29
30         tooltip:
31             The description to use as the 'title' for the menu item.
32             Shows up on some browsers when the mouse is held over the
33             link.
34
35         extension:
36             Changes the menu's extension.  The default is '.html'
37             Might be useful for .cgi (but .html can be a cgi script
38             too). Can be blank.
39
40         file:
41             This overrides the default filename that is built
42             from the menu id and the extension (see config/expand
43             for details).  This might be used to link to a file
44             outside of the build tree.  $site.url.root is prepended
45             to the file.  External urls may be specified by setting
46             the "external"
47
48         external:
49             This can be set to an absolute URL that is a link
50             off-site.  It directly sets the "url" key (see below).
51
52         menu:
53             If this is defined then the item is actually pointing
54             to a subdirectory.  The menu's target won't be "id.html"
55             but id/index.html (or as set by the "indexname" key).
56             "menu" is what makes this a recursive menu structure.
57
58         indexname:
59             Changes the default index name from "index.html" to something
60             else.
61
62
63         hidden:
64             Makes the menu item hidden.  Useful to disable a menu item
65             but leave the items in the map.
66
67
68         The config/expand also sets some additional keys that are available
69         when generating the menu items in your menu layout template.
70         See config/expand for details
71
72         id:
73             This is the id of the page, which is the same as the entry
74             in the parent menu array (same as the key of this hash).
75
76         path:
77             This is the id with the above directory prepended, if any.
78
79         file:
80             (Same as above)
81             This is the path with either the extension added
82             or, in the case of a submenu item, the indexname
83             added.  But this can be overridden in this map.
84
85         url:
86             Final url used for this link.
87
88         hot:
89             Flag that's true when the path (above) matches
90             part or all of the current page.  So the link is
91             either THE link to the page, or it's on the path
92             to the page (i.e. it's a parent menu item).
93
94         subs:
95             Flag that's true when the menu item is "hot" AND
96             the item has a sub menu (i.e. has a "menu" key)
97
98         here:
99             Flag that's true when the file (see above) is
100             the same as the output file name (which is relative
101             to the top level dir). This is true when the menu item
102             is for the current page.
103
104
105 -%]
106 [%- #------------------------------------------------------
107     # This is the download sub-menu
108     docs_map    = {
109         name    = this.abslinks ? 'Doc Overview' : 'documentation'
110
111         # Sub menu
112         menu = [
113             'readme', 'install', 'changes', 'swish-config',
114             'swish-run', 'swish-search', 'swish-faq', 'swish-bugs',
115             'swish-3.0', 'swish-library', 'api',
116             'swish.cgi', 'search.cgi', 'spider','filter'
117         ]
118
119         # Sum menu descriptions (quote non \w chars)
120         page = {
121             'readme'        = {
122                 name    = 'README'
123                 tooltip = 'First time users'
124             }
125             'install'       = {
126                 name    = 'Install'
127                 tooltip = 'Installation and usage overview'
128             }
129             'changes'       = {
130                 name    = 'Changes'
131                 tooltip = 'Important changes from previous versions'
132             }
133             'swish-config'  = {
134                 name    = 'Configuration'
135                 tooltip = 'Directives that go in your Swish-e configuration file'
136             }
137             'swish-run'     = {
138                 name    = 'Running'
139                 tooltip = 'Command line options for Swish-e binary'
140             }
141             'swish-search'  = {
142                 name    = 'Searching'
143                 tooltip = "Swish-e's search language"
144             }
145             'swish-faq'     = { name    = 'FAQ' }
146             'swish-bugs'    = { name = 'Known issues' }
147             'swish-3.0'     = { name = 'The Future' }
148             'swish-library' = {
149                 name    = 'C API'
150                 tooltip = 'Swish-e C API'
151             }
152             'api'           = {
153                 name    = 'Perl API'
154                 tooltip = 'Perl interface to the Swish-e library'
155             }
156             'swish.cgi'     = {
157                 name    = 'Swish.cgi'
158                 tooltip = 'Example CGI/mod_perl script'
159             }
160             'search.cgi'    = {
161                 name    = 'Search.cgi'
162                 tooltip = 'Example Perl script using SWISH::API'
163             }
164             'spider'        = {
165                 name    = 'Spider.pl'
166                 tooltip = 'The Swish-e HTTP spider'
167             }
168             'filter'        = {
169                 name    = 'Filters'
170                 tooltip = 'How to index non-text documents'
171             }
172         }
173     }
174 -%]
175 [%- #-------------------------------------------------------
176     devel_map = {
177         name    = 'development'
178         tooltip = 'CVS, daily builds and development documentation'
179
180         #sum menu
181         menu    = ['daily', 'cvs', 'view_cvs', 'devel_docs' ]
182         page    = {
183             daily       = {
184                 name    = 'swish-daily'
185                 tooltip = 'Daily snapshots from CVS'
186             }
187
188             devel_docs  = {
189                 name = 'docs'
190                 menu = [] # fake subdir
191             }
192
193             cvs         = {
194                 name        = 'repo info'
195                 tooltip     = 'How to build Swish-e from repository checkout'
196             }
197
198             view_cvs    = {
199                 name        = 'browse repo'
200                 external    = site.url.repo_view
201                 tooltip     = 'Browse the source code repository'
202             }
203         }
204     }
205 -%]
206 [%- #-------------------------------------------------------
207     download_map = {
208
209         #sum menu
210         menu    = ['old', 'daily' ]
211         page    = {
212             old     = {
213                 name    = 'archives'
214                 tooltip = 'Previous versions'
215             }
216
217             daily = {
218                 name    = 'daily builds'
219                 tooltip = 'Daily packages from CVS'
220                 file    = 'devel/daily.html'
221             }
222         }
223     }
224 -%]
225 [%-  #-------------------------------------------------------
226
227     # Here's the full site menu
228     map = {
229         name    = 'Swish-e.org',
230
231         # top level menu
232         menu    = [
233             'index', 'news', 'download', 'license', 'docs', 'support',
234             'discuss', 'graphics', 'scripts', 'devel', 'who', 'demos',
235             'search',
236         ]
237
238
239         # description of top-level menu items
240         # defaults are the name of the menu id
241         page    = {
242             index       = { name = 'home' }
243             download    = download_map
244             license     = { name = 'license' }
245             docs        = docs_map
246             discuss     = { tooltip = 'email list and list archive' }
247             devel       = devel_map
248             scripts     = { name = 'related projects' }
249             who         = { name = 'who uses it' }
250             graphics    = { menu = [] }
251             search      = {
252                 name   = 'Search'
253                 # hidden = 1 # don't show on main menu
254                 menu   = []  # make it /search/ instead of search.html
255             }
256         }
257
258     };
259
260     site.map = map;
261     # create expanded data map
262     PROCESS config/expand;
263
264
265     # Now build navigation links
266
267     #USE Dumper;
268     #Dumper.dump ( map ) | stderr;
269 -%]
Note: See TracBrowser for help on using the browser.