~ubuntu-branches/ubuntu/trusty/libhtml-widgets-navmenu-perl/trusty

« back to all changes in this revision

Viewing changes to examples/article-examples/fine-grained-site-flow/H-W-NM-fine-grained-site-flow.pl

  • Committer: Package Import Robot
  • Author(s): Xavier Guimard, Ansgar Burchardt, Xavier Guimard
  • Date: 2012-12-09 16:00:54 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20121209160054-wpsifb48isn5ul91
Tags: 1.0603-1
[ Ansgar Burchardt ]
* debian/control: Convert Vcs-* fields to Git.

[ Xavier Guimard ]
* Imported Upstream version 1.0603
* Bump Standards-Version to 3.9.4
* Update debian/copyright format
* Update spelling patch (reported)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
    padding-top : 0em;
17
17
    margin-left : 1em;
18
18
    background-color : white;
19
 
    
 
19
 
20
20
}
21
21
.navbar {
22
22
    float : left;
23
 
    background-color : moccasin; 
 
23
    background-color : moccasin;
24
24
    width : 20%;
25
25
    border-color : black;
26
26
    border-width : thick;
70
70
 
71
71
.breadcrumb :visited
72
72
{
73
 
    color: #F5F5DC;    
 
73
    color: #F5F5DC;
74
74
}
75
75
 
76
76
.breadcrumb :visited:hover
77
77
{
78
 
    color: #800000;    
 
78
    color: #800000;
79
79
}
80
80
EOF
81
81
 
93
93
        {
94
94
            'text' => "About Myself",
95
95
            'url' => "me/",
96
 
            'subs' => 
 
96
            'subs' =>
97
97
            [
98
98
                {
99
99
                    'text' => "Bio",
122
122
                        },
123
123
                    ],
124
124
                },
125
 
            ],               
 
125
            ],
126
126
        },
127
127
        {
128
 
            'text' => "Humour", 
 
128
            'text' => "Humour",
129
129
            'url' => "humour/",
130
130
            'title' => "My Humorous Creations",
131
131
            'show_always' => 1,
132
 
            'subs' => 
 
132
            'subs' =>
133
133
            [
134
134
                {
135
 
                    'text' => "The Enemy", 
 
135
                    'text' => "The Enemy",
136
136
                    'url' => "humour/TheEnemy/",
137
137
                    'title' => "The Enemy and How I Helped to Fight It",
138
138
                },
186
186
            'url' => "open-source/",
187
187
            'expand' => { 're' => "^(open-source|perl)/", },
188
188
            'title' => "Pages related to Software (mostly Open-Source)",
189
 
            'subs' => 
 
189
            'subs' =>
190
190
            [
191
191
                {
192
192
                    'text' => "Freecell Solver",
242
242
            ],
243
243
        },
244
244
        {
245
 
            'text' => "Lectures", 
 
245
            'text' => "Lectures",
246
246
            'url' => "lecture/",
247
247
            'expand' => { 're' => "^lecture/", },
248
248
            'title' => "Presentations I Wrote (Mostly Technical)",
249
 
            'subs' => 
 
249
            'subs' =>
250
250
            [
251
251
                {
252
252
                    'text' => "Perl for Newbies",
316
316
 
317
317
my %hosts =
318
318
(
319
 
    'hosts' => 
320
 
    { 
321
 
        'default' => 
322
 
        { 
323
 
            'base_url' => ("http://web-cpan.berlios.de/modules/" . 
 
319
    'hosts' =>
 
320
    {
 
321
        'default' =>
 
322
        {
 
323
            'base_url' => ("http://web-cpan.berlios.de/modules/" .
324
324
                "HTML-Widgets-NavMenu/article/examples/simple/dest/"),
325
 
        }, 
 
325
        },
326
326
    },
327
327
);
328
328
 
329
329
my @page_paths =
330
 
("", "me/", "personal.html", "me/contact-me/", "me/resumes/", "resume.html", 
331
 
"resume_detailed.html", "humour/", "humour/TheEnemy/", "humour/TOWTF/", 
332
 
"humour/Pope/", "humour.html", "humour/fortunes/", "MathVentures/", 
333
 
"art/", "art/bk2hp/", "art/linux_banner/", "open-source/", 
334
 
"open-source/projects/freecell-solver/", "jmikmod/", "rwlock/", 
335
 
"open-source/projects/quad-pres/", "open-source/favourite/", 
336
 
"open-source/interviews/", "open-source/contributions/", 
337
 
"open-source/bits.html", "abstraction/", "software-tools/", "lecture/", 
338
 
"lecture/Perl/Newbies/", "lecture/Freecell-Solver/", "lecture/lc/", 
339
 
"lecture/Gimp/", "lecture/Autotools/", "lecture/WebMetaLecture/", 
340
 
"essays/", "essays/Index/", "essays/open-source/", "essays/life/", 
 
330
("", "me/", "personal.html", "me/contact-me/", "me/resumes/", "resume.html",
 
331
"resume_detailed.html", "humour/", "humour/TheEnemy/", "humour/TOWTF/",
 
332
"humour/Pope/", "humour.html", "humour/fortunes/", "MathVentures/",
 
333
"art/", "art/bk2hp/", "art/linux_banner/", "open-source/",
 
334
"open-source/projects/freecell-solver/", "jmikmod/", "rwlock/",
 
335
"open-source/projects/quad-pres/", "open-source/favourite/",
 
336
"open-source/interviews/", "open-source/contributions/",
 
337
"open-source/bits.html", "abstraction/", "software-tools/", "lecture/",
 
338
"lecture/Perl/Newbies/", "lecture/Freecell-Solver/", "lecture/lc/",
 
339
"lecture/Gimp/", "lecture/Autotools/", "lecture/WebMetaLecture/",
 
340
"essays/", "essays/Index/", "essays/open-source/", "essays/life/",
341
341
"links.html");
342
342
 
343
 
my @pages = 
344
 
    (map { 
345
 
        +{ 'path' => $_, 'title' => "Title for $_", 
 
343
my @pages =
 
344
    (map {
 
345
        +{ 'path' => $_, 'title' => "Title for $_",
346
346
        'content' => "<p>Content for $_</p>" }
347
347
    } @page_paths);
348
348
 
349
349
# Add the site-map page.
350
350
{
351
351
    my $site_map_path = "site-map/";
352
 
    my $site_map_generator = 
 
352
    my $site_map_generator =
353
353
        HTML::Widgets::NavMenu->new(
354
354
            path_info => "/$site_map_path",
355
355
            current_host => "default",
381
381
foreach my $page (@pages)
382
382
{
383
383
    my $path = $page->{'path'};
384
 
    my $nav_menu = 
 
384
    my $nav_menu =
385
385
        HTML::Widgets::NavMenu->new(
386
386
            path_info => "/$path",
387
387
            current_host => "default",
398
398
    }
399
399
    my $full_path = "dest/$file_path";
400
400
    $full_path =~ m{^(.*)/[^/]+$};
401
 
    # mkpath() throws an exception if it isn't successful, which will cause 
 
401
    # mkpath() throws an exception if it isn't successful, which will cause
402
402
    # this program to terminate. This is what we want.
403
403
    mkpath($1, 0, 0755);
404
404
    open my $out, ">", $full_path or
426
426
<?xml version="1.0" encoding="iso-8859-1"?>
427
427
<!DOCTYPE html
428
428
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
429
 
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">    
 
429
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
430
430
<html>
431
431
<head>
432
432
<title>[% title %]</title>
434
434
[% css_style %]
435
435
</style>
436
436
[% FOREACH key = nav_links.keys.sort %]
437
 
<link rel="[% key %]" 
438
 
href="[% HTML.escape(nav_links.$key.direct_url()) %]" 
 
437
<link rel="[% key %]"
 
438
href="[% HTML.escape(nav_links.$key.direct_url()) %]"
439
439
title="[% nav_links.$key.title() %]" />
440
440
[% END %]
441
441
</head>