commit de9c19491f94f21296f8056c93362114f3ce9323
parent 199415619a2210292fb01e16be9b72409b274d9e
Author: tongong <tongong@gmx.net>
Date: Sun, 18 Dec 2022 16:01:36 +0100
added stagit section
Diffstat:
10 files changed, 221 insertions(+), 15 deletions(-)
diff --git a/Makefile b/Makefile
@@ -1,8 +1,14 @@
build:
tacker template/index.html template/dist/index.html
+ mv dist/git /tmp/tongong.net-git
rm -rf dist/*
+ mv /tmp/tongong.net-git dist/git
qjs build.js
cp static/* dist/
+build-git:
+ make build
+ cd git && node build.js
+
watch:
find . | entr -s "make build"
diff --git a/content/git/index.html b/content/git/index.html
@@ -1,6 +0,0 @@
-<h1>git</h1>
-<p>
- I plan to install an instance of
- <a href="https://codemadness.org/stagit.html">stagit</a>
- here.
-</p>
diff --git a/content/projects/index.html b/content/projects/index.html
@@ -5,7 +5,7 @@ and ideas I pursue out of interest.
<h2>problem-solving projects</h2>
-<h3><a href="https://github.com/tongong/tacker">tacker</a></h3>
+<h3><a href="/git/tacker/files.html">tacker</a></h3>
<p>
I like JavaScript and I like building websites and web applications. But modern
JS projects seem to require hundreds of npm dependencies. This is a big mess
@@ -16,7 +16,7 @@ most simple way of stapling files together to create self-contained pages like
to one you are currently viewing.
</p>
-<h3><a href="https://github.com/tongong/timetracker">timetracker</a></h3>
+<h3><a href="/git/timetracker/files.html">timetracker</a></h3>
<p>
I was searching for a timetracking program that works in terminal and GUI and
is not completely bloated. I did not find any and wrote my own.
@@ -24,7 +24,7 @@ is not completely bloated. I did not find any and wrote my own.
<h2>interesting projects</h2>
-<h3><a href="https://github.com/tongong/brainfuck-2048">brainfuck-2048</a></h3>
+<h3><a href="/git/brainfuck-2048/file/2048.bf.html">brainfuck-2048</a></h3>
<p>
This is my first (and so far only) brainfuck program. The most interesting
thing about this is the random number generator.
diff --git a/content/writing/zoom-interference/src/index.html b/content/writing/zoom-interference/src/index.html
@@ -239,7 +239,7 @@
</ul>
<p>
That's enough for my curiosity. If you are still curious you can find the
- source code of this page <a href="">here</a>.
+ source code of this page <a href="/git/tongong.net/files.html">here</a>.
</p>
diff --git a/git/.gitignore b/git/.gitignore
@@ -0,0 +1,2 @@
+repo/*
+dist/*
diff --git a/git/build.js b/git/build.js
@@ -0,0 +1,63 @@
+const fs = require("fs");
+const child_process = require("child_process");
+
+const repositories = require("./repositories.js")
+ .sort((a,b) => a.name.localeCompare(b.name));
+
+// prepare new repos
+repositories.forEach(r => {
+ if (!fs.existsSync("repo/" + r.name)) {
+ fs.mkdirSync("repo/" + r.name);
+ console.log(child_process.execSync("git init --bare",
+ {cwd: "repo/" + r.name}).toString());
+ fs.writeFileSync("repo/" + r.name + "/hooks/post-update",
+ "#'!/bin/sh\nexec git update-server-info\n");
+ fs.chmodSync("repo/" + r.name + "/hooks/post-update",
+ fs.constants.S_IRWXU);
+ // manually:
+ // add file path as remote
+ }
+});
+
+// prepare dist directory
+if (fs.existsSync("dist")) fs.rmSync("dist", { recursive: true });
+fs.mkdirSync("dist");
+fs.copyFileSync("style.css", "dist/style.css");
+fs.copyFileSync("logo.png", "dist/logo.png");
+
+// configure and run stagit for all projects
+repositories.forEach(r => {
+ fs.writeFileSync("repo/" + r.name + "/description", r.description);
+ fs.writeFileSync("repo/" + r.name + "/owner", "tongong");
+ fs.writeFileSync("repo/" + r.name + "/url",
+ "https://tongong.net/git/" + r.name + ".git");
+ fs.mkdirSync("dist/" + r.name);
+ fs.copyFileSync("style.css", "dist/" + r.name + "/style.css");
+ fs.copyFileSync("logo.png", "dist/" + r.name + "/logo.png");
+ child_process.execSync("stagit ../../repo/" + r.name,
+ {cwd: "dist/" + r.name});
+});
+fs.writeFileSync("dist/index.html",
+ child_process.execSync("stagit-index " +
+ repositories.map(r => "repo/" + r.name).join(" "))
+);
+
+// include dist in website dist
+// tacker is used to include logo.png and style.css
+child_process.execSync("find dist -name *.html")
+ .toString().split("\n").filter(f => f != "").map(f => {
+ // tacker base path
+ const basepath = f == "dist/index.html"? "dist" :
+ f.split("/").slice(0, 2).join("/");
+ const distpath = f.replace("dist/", "../dist/git/");
+ const distparent = distpath.split("/").slice(0, -1).join("/");
+ fs.mkdirSync(distparent, {recursive: true});
+ child_process.execSync("tacker -p \"" + basepath
+ + "\" \"" + f + "\" \"" + distpath + "\"");
+ });
+
+// create directories for git https clone
+repositories.forEach(r => {
+ fs.cpSync("repo/" + r.name, "../dist/git/" + r.name + ".git",
+ {recursive: true});
+});
diff --git a/git/logo.png b/git/logo.png
Binary files differ.
diff --git a/git/repositories.js b/git/repositories.js
@@ -0,0 +1,26 @@
+module.exports = [
+ { name: "tacker",
+ description: "a simple web bundler" },
+ { name: "docker-nativescript",
+ description: "a dockerized version of nativescript toolchain" },
+ { name: "dotfiles",
+ description: "personal configuration files and scripts" },
+ { name: "reverseqr",
+ description: "qr codes working in both directions" },
+ { name: "sleeb",
+ description: "an experimental input method" },
+ { name: "timetracker",
+ description: "suckless timetracking" },
+ { name: "url-tetris",
+ description: "tetris inside the browser address bar" },
+ { name: "terrain-generator",
+ description: "digital terrain generation and animation" },
+ { name: "remark-slides",
+ description: "personal distribution of remarkjs" },
+ { name: "ramajs",
+ description: "web browser automation from your browser console" },
+ { name: "brainfuck-2048",
+ description: "brainfuck implementation of the well-known 2048 game" },
+ { name: "tongong.net",
+ description: "personal website" },
+];
diff --git a/git/style.css b/git/style.css
@@ -0,0 +1,115 @@
+:root {
+ --b-txt: #afbac4;
+ --b-bg-1: #242930;
+ --b-bg-2: #353b43;
+ --b-line: #afbac4;
+ --b-link: #57cc8a;
+ --b-btn-bg: #353b43;
+ --b-btn-txt: #afbac4;
+ --b-focus: #88c0d0;
+}
+
+body {
+ background-color: var(--b-bg-1);
+ color: var(--b-txt);
+ font-family: monospace;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ font-size: 1em;
+ margin: 0;
+}
+
+img, h1, h2 {
+ vertical-align: middle;
+}
+
+img {
+ border: 0;
+}
+
+a {
+ color: var(--b-link);
+}
+
+a.d,
+a.h,
+a.i,
+a.line {
+ text-decoration: none;
+}
+
+#blob a {
+ color: #555;
+}
+#blob a:target {
+ color: var(--b-link);
+ background-color: var(--b-bg-2);
+}
+
+#blob a:hover {
+ color: var(--b-link);
+ text-decoration: none;
+}
+
+table thead td {
+ font-weight: bold;
+}
+
+table td {
+ padding: 0 0.4em;
+}
+
+#content table td {
+ vertical-align: top;
+ white-space: nowrap;
+}
+
+#branches tr:hover td,
+#tags tr:hover td,
+#index tr:hover td,
+#log tr:hover td,
+#files tr:hover td {
+ background-color: var(--b-bg-2);
+}
+
+#index tr td:nth-child(2),
+#tags tr td:nth-child(3),
+#branches tr td:nth-child(3),
+#log tr td:nth-child(2) {
+ white-space: normal;
+}
+
+td.num {
+ text-align: right;
+}
+
+hr {
+ border: 0;
+ border-top: 1px solid var(--b-line);
+ height: 1px;
+}
+
+pre {
+ font-family: monospace;
+}
+
+pre a.h {
+ color: #ebcb8b;
+}
+.A,
+span.i,
+pre a.i {
+ color: #a3be8c;
+}
+.D,
+span.d,
+pre a.d {
+ color: #bf616a;
+}
+
+pre a.h:hover,
+pre a.i:hover,
+pre a.d:hover {
+ text-decoration: none;
+}
diff --git a/template/index.html b/template/index.html
@@ -9,11 +9,11 @@
</head>
<body>
<p class="page-header">
- <a href="https://tongong.net">tongong.net</a> -
- <a href="/writing">writing</a> -
- <a href="/projects">projects</a> -
- <a href="/git">git</a> -
- <a href="/about">about</a>
+ <a href="/">tongong.net</a> -
+ <a href="/writing/">writing</a> -
+ <a href="/projects/">projects</a> -
+ <a href="/git/">git</a> -
+ <a href="/about/">about</a>
</p>
<hr>
{{content}}