From: Emil Williams Date: Sun, 11 May 2025 04:06:08 +0000 (-0600) Subject: -- X-Git-Url: https://git.xolatile.top/?a=commitdiff_plain;h=80c0d92630b790a0414789551de8ed0523491397;p=emil-3chen.org.git -- --- diff --git a/perl/Triple.pm b/perl/Triple.pm index 0202e3b..f7635a9 100644 --- a/perl/Triple.pm +++ b/perl/Triple.pm @@ -16,8 +16,13 @@ use Secrets; our $debug = 0; use constant { - STATIC_PAGE => 0, - DYNAMIC_PAGE => 1, + STATIC_PAGE => 0, + DYNAMIC_PAGE => 1, + + PAGE_TYPE => 0, + PAGE_TT => 1, + PAGE_TITLE => 2, + PAGE_DESCRIPTION => 3, }; our %page = ( @@ -54,7 +59,7 @@ sub Triple::main { my $dynamic = $page{$vars->{uri}}; if ($dynamic) { my @set = @{$dynamic}; - $page = "dynamic $set[0], no?"; + $page = "dynamic $set[PAGE_TYPE], no?"; } else { $page = %static{''}; } @@ -108,13 +113,13 @@ sub init { }; foreach my $key (keys %page) { my @set = @{$page{$key}}; - next if $set[0] != STATIC_PAGE; + next if $set[PAGE_TYPE] != STATIC_PAGE; syslog("info", "Marking Static '$key'"); $vars->{"uri"} = "$key"; - $vars->{"title"} = "$set[2]"; - $vars->{"description"} = "$set[3]"; + $vars->{"title"} = "$set[PAGE_TITLE]"; + $vars->{"description"} = "$set[PAGE_DESCRIPTION]"; my $temporary; - $template->process($set[1], $vars, \$temporary) or syslog("info", $template->error()); + $template->process($set[PAGE_TT], $vars, \$temporary) or syslog("info", $template->error()); $static{$key} = $temporary; } }