Links
#!/usr/bin/perl # use strict; # use CGI::Carp qw(fatalsToBrowser); print "Content-type: text/html\n\n"; my @sidebar_items = ( {title => 'About Me', class => 'aboutme', url => 'index.html', children => [ {title => 'Academics', url => 'index.html#academics', class => 'aboutme'}, {title => 'Interests and Hobbies', url => 'index.html#interests', class => 'aboutme'} ]}, {title => 'Projects', class => 'projects', url => 'projects.html', children => [ {title => 'The Right Decision: Justifications of Morality', url => 'projects/suff/index.html', class => 'projects'}, {title => 'Attribute-based File Management (Coming Soon)', class => 'projects', disabled => 1} ]}, {title => 'Essays', class => 'essays', url => 'essays.html', children => [ {title => 'Coming Soon', class => 'essays', disabled => 1} ]}, {title => 'Gaming', class => 'gaming', url => 'gaming.html'}, {title => 'Resume', class => 'resume', url => 'resume.html'}, {title => 'Contact', class => 'contact', url => 'contact.html'} ); # If they're at a directory, assume they want the index.html file there: if ($ENV{REQUEST_URI} =~ /\/$/) { $ENV{REQUEST_URI} .= "index.html"; } # If we're viewing pages of a document, associate them with the index.html file in that directory: if ($ENV{REQUEST_URI} =~ /(.+?)\/(.*?\/)page(\d+?)\.html$/) { $ENV{REQUEST_URI} = "$1/$2index.html"; } my $sidebar_string = "
\n"; foreach my $item (@sidebar_items) { $sidebar_string .= "\t\t\t

{class}"; if ($ENV{REQUEST_URI} eq "/~phoenix/$item->{url}") { $sidebar_string .= "sel"; } $sidebar_string .= "\">{url}\">$item->{title}

\n"; if (exists($item->{children})) { $sidebar_string .= "\t\t\t
    \n"; foreach my $child (@{$item->{children}}) { if (exists($child->{disabled}) && $child->{disabled} == 1) { $sidebar_string .= "\t\t\t\t
  • $child->{title}
  • \n"; } else { $sidebar_string .= "\t\t\t\t{url}") { $sidebar_string .= " class=\"$child->{class}sel\""; } $sidebar_string .= ">{url}\">$child->{title}\n"; } } $sidebar_string .= "\t\t\t
\n"; } } print "$sidebar_string\t\t
";
Essays

Essays

No essays have yet been posted. Please check back here in a few days for more. Thank you!