]> git.xolatile.top Git - emil-3chen.org.git/commitdiff
--
authorEmil Williams <emilemilemil@cock.li>
Sun, 18 May 2025 01:05:25 +0000 (01:05 +0000)
committerEmil Williams <emilemilemil@cock.li>
Sun, 18 May 2025 01:05:25 +0000 (01:05 +0000)
perl/Triple.pm
static/style.css

index 76a4aa0f746fb49cecd721c42fc4e47139d84265..33a3ee4a48ae98721affe6430309103658c3a7c3 100644 (file)
@@ -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]";
index bf869b832b8984c64e3cdd7f1a89fbcccd8a82f7..9408090cd0d89c6775c304ee658fde7828f11c23 100644 (file)
@@ -23,7 +23,6 @@ textarea {
 
 #title {
     font-size: 1.5em;
-    /* margin-top: -1em; */
     padding-bottom: 0.25em;
     padding-left: 1em;
     margin-bottom: 0.25em;