From 80c0d92630b790a0414789551de8ed0523491397 Mon Sep 17 00:00:00 2001 From: Emil Williams Date: Sat, 10 May 2025 22:06:08 -0600 Subject: [PATCH] -- --- perl/Triple.pm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) 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; } } -- 2.47.3