From 30c81fbb081c01e89e26f62d1c7454d349f0998e Mon Sep 17 00:00:00 2001 From: Emil Williams Date: Sun, 18 May 2025 01:05:25 +0000 Subject: [PATCH] -- --- perl/Triple.pm | 25 +++++++++++++++++++------ static/style.css | 1 - 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/perl/Triple.pm b/perl/Triple.pm index 76a4aa0..33a3ee4 100644 --- a/perl/Triple.pm +++ b/perl/Triple.pm @@ -19,18 +19,21 @@ our $debug = 0; use constant { STATIC_PAGE => 0, DYNAMIC_PAGE => 1, + REDIRECT_PAGE => 2, PAGE_TYPE => 0, - PAGE_TT => 1, + PAGE_TT => 1, PAGE_TO => 1, PAGE_TITLE => 2, PAGE_DESCRIPTION => 3, }; our %page = ( - '' => [ STATIC_PAGE, '404', '404 Not Found', '404 Not Found' ], - '/' => [ STATIC_PAGE, 'index', '3chen', 'Forum Index' ], - '/c/' => [ DYNAMIC_PAGE, 'img', '/c/', 'Chen Tech' ], - '/sys/' => [ DYNAMIC_PAGE, 'img', '/sys/', 'Site Info' ], + '' => [ STATIC_PAGE, '404', '404 Not Found', '404 Not Found' ], + '/' => [ STATIC_PAGE, 'index', '3chen', 'Forum Index' ], + '/c/' => [ DYNAMIC_PAGE, 'img', '/c/', 'Chen Tech' ], + '/sys/' => [ DYNAMIC_PAGE, 'img', '/sys/', 'Site Info' ], + '/c' => [ REDIRECT_PAGE, '/c/' ], + '/sys' => [ REDIRECT_PAGE, '/sys/' ], ); our %static; @@ -139,8 +142,14 @@ sub Triple::main { next if $status ne ''; + { + my @search = @{$page{$vars->{uri}}}; + $vars->{uri} = $search[PAGE_TO] if $search[PAGE_TYPE] == REDIRECT_PAGE; + } my $page = $static{$vars->{uri}}; if (not $page) { + if (@{$page{$vars->{uri}}}[PAGE_TO]) { + } my $dynamic = $page{$vars->{uri}}; if ($dynamic) { my @set = @{$dynamic}; @@ -172,7 +181,11 @@ sub init { }; foreach my $key (keys %page) { my @set = @{$page{$key}}; - next if $set[PAGE_TYPE] != STATIC_PAGE; + next if $set[PAGE_TYPE] != STATIC_PAGE; + if ($set[PAGE_TYPE] != STATIC_PAGE) { + next if $set[PAGE_TYPE] == DYNAMIC_PAGE; + if $set + } syslog("info", "Marking Static '$key'"); $vars->{"uri"} = "$key"; $vars->{"title"} = "$set[PAGE_TITLE]"; diff --git a/static/style.css b/static/style.css index bf869b8..9408090 100644 --- a/static/style.css +++ b/static/style.css @@ -23,7 +23,6 @@ textarea { #title { font-size: 1.5em; - /* margin-top: -1em; */ padding-bottom: 0.25em; padding-left: 1em; margin-bottom: 0.25em; -- 2.39.5