]> git.xolatile.top Git - emil-3chen.org.git/commitdiff
init
authorEmil Williams <emilemilemil@cock.li>
Wed, 30 Apr 2025 18:08:00 +0000 (12:08 -0600)
committerEmil Williams <emilemilemil@cock.li>
Wed, 30 Apr 2025 18:08:00 +0000 (12:08 -0600)
.gitignore [new file with mode: 0644]
ixtab [new file with mode: 0755]
tt/404 [new file with mode: 0644]
tt/img [new file with mode: 0644]
tt/index [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..db2fc0d
--- /dev/null
@@ -0,0 +1 @@
+secrets
diff --git a/ixtab b/ixtab
new file mode 100755 (executable)
index 0000000..09bbff6
--- /dev/null
+++ b/ixtab
@@ -0,0 +1,40 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use CGI;
+use DBI;
+use Template;
+
+require "secrets"; # server data - shit that doesn't need to uploaded.
+
+my $cgi = CGI->new;
+
+my $tt = Template->new({
+    INCLUDE_PATH => '.',
+    INTERPOLATE  => 1,
+                      }) or die Template->error();
+
+# $dbfile from secrets
+my $dbh = DBI->connect("dbi:SQLite:uri=file:$dbfile?mode=rwc");
+
+my $path = $cgi->param('path') // '';
+
+my %site = (
+    ixtab => 'index',
+    img   => 'img',
+    );
+
+my $vars = (
+    sneed => 'feed',
+    chuck => 'fuck',
+    );
+
+my $page = $site{"$path"} // '404';
+
+print $cgi->header(
+    -Content_Type => 'text/html',
+    -charset => 'UTF-8',
+    );
+
+# I should probably put all of below into a buffer and run a pruning regexp on it
+$tt->process('tt/' . $page, $vars) or die $tt->error();
diff --git a/tt/404 b/tt/404
new file mode 100644 (file)
index 0000000..7fbea0f
--- /dev/null
+++ b/tt/404
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+<h1>Nothing Lost, Nothing Gained</h1>
+</body>
+</html>
diff --git a/tt/img b/tt/img
new file mode 100644 (file)
index 0000000..e733a1a
--- /dev/null
+++ b/tt/img
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+<h1>Image Board</h1>
+</body>
+</html>
diff --git a/tt/index b/tt/index
new file mode 100644 (file)
index 0000000..002aa39
--- /dev/null
+++ b/tt/index
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<body>
+<h1>Glorious Day</h1>
+<a href="/img">Imgb.</a>
+</body>
+</html>