added gitignore. improved the HTML generation template. added the gemini generation template.

This commit is contained in:
Abdullah Islam 2023-04-30 19:20:58 +06:00
parent 36513ba6dd
commit 9fb6321442
26 changed files with 38 additions and 805 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
gmi/
html/

View File

@ -12,5 +12,5 @@ subdirs:
html/%.html: src/%.gmi tmpl/html.awk
awk -f tmpl/html.awk -- $< > $@
gmi/%.gmi: src/%.gmi tmpl/html.awk
awk -f tmpl/html.awk -- $< > $@
gmi/%.gmi: src/%.gmi tmpl/gemini.awk
awk -f tmpl/gemini.awk $< > $@

View File

@ -1,11 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Tutorials</title>
</head>
<body>
<h1>Tutorials</h1>
<a href="./website-generation.gmi"> One way to build a website, I guess</a><br>
</body>
</html>

View File

@ -1,168 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>!</title>
</head>
<body>
<h1>One way to build a website, I guess</h1>
<p>Let's talk how this website is generated. Basically it's a mashup of pp as a pre-processor, make as a build system, and common utilities you can find on most UNIX systems.</p>
<p></p>
<p>The base structure of my system is as follows. There are 4 directories: src/, tmpl/, html/, and gmi/. src/ contains the naked files that make up this website - what I refer to as "source files" - without the navigation bars or any fancy shenanigans. tmpl/ contains template files for pp, html/ contains the generated HTML, and gmi/ contains the generated gemtext.</p>
<p></p>
<p>Earlier, I mentioned how I use make. The good thing is that since I have configured my Makefile to not automatically execute the 'clean' rule as a part of 'all', only the source files that were changed get processed.</p>
<p></p>
<p>SHELL = '/bin/sh'</p>
<p>SOURCES = $(shell find src -type f)</p>
<p></p>
<p>all: subdirs $(SOURCES:src/%.gmi=html/%.html) $(SOURCES:src/%.gmi=gmi/%.gmi) gmi/sitemap.gmi html/sitemap.html</p>
<p></p>
<p>clean:</p>
<p> rm -rf html/* gmi/*</p>
<p></p>
<p>subdirs:</p>
<p> find src/ -type d -printf '%P\0' | xargs -0 -I{} mkdir -p gmi/{} html/{}</p>
<p></p>
<p>gmi/%.gmi: src/%.gmi tmpl/gmi.uppgmi</p>
<p> pp tmpl/gmi.uppgmi $< > $@</p>
<p></p>
<p>html/%.html: src/%.gmi tmpl/html.upphtml</p>
<p> pp tmpl/html.upphtml $< > $@</p>
<p></p>
<p>gmi/sitemap.gmi: $(shell find src -mindepth 2 -maxdepth 2 -path '*/index.gmi') tmpl/sitemap.uppgmi </p>
<p> pp tmpl/sitemap.uppgmi src/ > $@</p>
<p></p>
<p>html/sitemap.html: $(shell find src -mindepth 2 -maxdepth 2 -path '*/index.gmi') tmpl/sitemap.upphtml </p>
<p> pp tmpl/sitemap.upphtml src/ > $@</p>
<p></p>
<p>.PHONY: clean subdirs </p>
<p></p>
<p>Now let's talk about the processing. pp - the pre-processor - works by taking a template file and some other command-line arguments, processing them, and generating output which you can use for whatever you want.</p>
<p></p>
<p>pp [options] [template-file] [args...]</p>
<p></p>
<p>HTML generation:</p>
<p><title></p>
<h1>!</h1>
<p>awk '/^#[^#]/ { sub("^#([ ]*)", ""); printf "%s", $0; exit } { print "techn0path" }' $1</p>
<h1>!</h1>
<p></title></p>
<p></p>
<p><meta name='referrer' content='no-referrer' /></p>
<p><meta name='author' content='techn0path' /></p>
<p><meta name='viewport' content='width=device-width,initial-scale=1.0' /></p>
<p> </p>
<p><header></p>
<p> <nav></p>
<p> <div id='navbar'></p>
<h1>!</h1>
<p>printf '<a href="%s">codeAI</a> |</p>
<p><a href="%s">notes</a> |</p>
<p><a href="%s">howto</a> |</p>
<p><a href="%s">useful</a>' \</p>
<p> `realpath --relative-to="$(dirname $1)" "$PWD/src/index.html"` \</p>
<p> `realpath --relative-to="$(dirname $1)" "$PWD/src/notes/index.html"` \</p>
<p> `realpath --relative-to="$(dirname $1)" "$PWD/src/howto/index.html"` \</p>
<p> `realpath --relative-to="$(dirname $1)" "$PWD/src/useful/index.html"`</p>
<h1>!</h1>
<p> </div></p>
<p> </nav></p>
<p></header></p>
<p></p>
<p><main></p>
<p> <div id='content'></p>
<h1>!</h1>
<p>printf "<p>Last modified on %s.</p>" `date -u -r "$1" +%Y/%m/%d`</p>
<p></p>
<p>awk -F " " '/^=>/ {</p>
<p> if (NF < 2) next;</p>
<p></p>
<p> sub("^([ ]*)", "", $2);</p>
<p> sub("([ ]*)$", "", $2);</p>
<p></p>
<p> if (match($2, "^\\.(\\.?)\\/") || ! match($2, "^(.*):\\/\\/")) </p>
<p> sub("\\.gmi$", ".html", $2)</p>
<p>} { print $0 }' $1 | gemini2html</p>
<h1>!</h1>
<p> </div></p>
<p></main></p>
<p></p>
<p>Sitemap generation</p>
<h1>Sitemap</h1>
<p>This document is automatically generated. See also:</p>
<a href="howto/website-generation.gmi"> One way to generate a website, I guess</a><br>
<p></p>
<h1>!</h1>
<p>export DIRECTORY="$1"</p>
<p></p>
<p>awk '</p>
<p>/^#[^#]/ { sub("^#([ ]*)", ""); printf "## %s\n", $0 }</p>
<p>/^=>/ {</p>
<p> if (NF < 2) next</p>
<p> link = $2</p>
<p></p>
<p> $1 = ""</p>
<p> $2 = ""</p>
<p></p>
<p> description = $0</p>
<p> sub("^([ ]*)", "", description)</p>
<p> </p>
<p> sprintf("dirname %s", FILENAME) | getline dirname</p>
<p> sprintf("realpath %s/%s", dirname, link) | getline tmp</p>
<p> sprintf("realpath --relative-to=%s %s", ENVIRON["DIRECTORY"], tmp) | getline tmp2</p>
<p> link = tmp2</p>
<p></p>
<p> printf "=> %s %s\n", link, description</p>
<p>}' `find $DIRECTORY -mindepth 2 -maxdepth 2 -path "*/index.gmi"`</p>
<h1>!</h1>
<p></p>
<p>HTML version:</p>
<h1>Note how the navigation bar generation is different.</h1>
<h1>!</h1>
<p>export DIRECTORY="$1"</p>
<p></p>
<p>printf '<a href="%s">codeAI</a> |</p>
<p><a href="%s">notes</a> |</p>
<p><a href="%s">howto</a> |</p>
<p><a href="%s">useful</a> |</p>
<p><a href="%s">sitemap</a>' \</p>
<p> `realpath --relative-to="$DIRECTORY" "$PWD/src/index.html"` \</p>
<p> `realpath --relative-to="$DIRECTORY" "$PWD/src/notes/index.html"` \</p>
<p> `realpath --relative-to="$DIRECTORY" "$PWD/src/howto/index.html"` \</p>
<p> `realpath --relative-to="$DIRECTORY" "$PWD/src/useful/index.html"` \</p>
<p> `realpath --relative-to="$DIRECTORY" "$PWD/src/sitemap.html"`</p>
<h1>!</h1>
<p></p>
<p><div id='content'></p>
<h1>!</h1>
<p>awk '</p>
<p>/^#[^#]/ { sub("^#([ ]*)", ""); printf "<h2>%s</h2>", $0 }</p>
<p>/^=>/ {</p>
<p> if (NF < 2) next</p>
<p> link = $2</p>
<p></p>
<p> $1 = ""</p>
<p> $2 = ""</p>
<p></p>
<p> description = $0</p>
<p> sub("^([ ]*)", "", description)</p>
<p> </p>
<p> sprintf("dirname %s", FILENAME) | getline dirname</p>
<p> sprintf("realpath %s/%s", dirname, link) | getline tmp</p>
<p> sprintf("realpath --relative-to=%s %s", ENVIRON["DIRECTORY"], tmp) | getline tmp2</p>
<p> link = tmp2</p>
<p></p>
<p> if (match(link, "^\\.(\\.?)\\/") || ! match(link, "^(.*):\\/\\/")) </p>
<p> sub("\\.gmi$", ".html", link)</p>
<p></p>
<p> printf "<a href=\"%s\">%s</a><br>", link, description</p>
<p>}' `find $DIRECTORY -mindepth 2 -maxdepth 2 -path "*/index.gmi"`</p>
<h1>!</h1>
<p></div></p>
<p></p>
<h2>Related</h2>
<a href="../notes/on-personal-websites.gmi"> On personal websites</a><br>
<a href="https://www.karl.berlin/static-site.html"> Karl Bartel - 'make' as a static site generator</a><br>
<a href="https://shadowm00n.neocities.org/tech/how_this_site_is_built"> ShadowM00N - How this site is built</a><br>
</body>
</html>

View File

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>techn0path's website</title>
</head>
<body>
<h1>techn0path's website</h1>
<p>On this personal website of mine, I talk about stuff.</p>
<p></p>
<h2>Highlights</h2>
<a href="howto/website-generation.gmi"> One way to generate a website, I guess</a><br>
<a href="notes/on-personal-websites.gmi"> On personal websites</a><br>
<a href="useful/addons.gmi"> Useful addons</a><br>
</body>
</html>

View File

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Notes</title>
</head>
<body>
<h1>Notes</h1>
<p>An ever-growing collection of information.</p>
<p></p>
<a href="on-personal-websites.gmi"> On personal websites</a><br>
<a href="software-freedom"> On software freedom</a><br>
</body>
</html>

View File

@ -1,20 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>On Personal Websites</title>
</head>
<body>
<h1>On Personal Websites</h1>
<p>You are currently on my personal website. :) On my personal website, I talk about basically whatever I want. Reviews, tutorials, articles, you name it. I want to talk about some of the reasons for building it.</p>
<p></p>
<p>I am mostly doing it for fun; designing, writing, and structure are all enjoyable, and part and parcel of website-building. But there are of course other reasons too. Others could learn from me and my experiences; people could query the internet and use my website to solve a problem.. People can give me feedback that allows me to improve my skills, ya know? (Also known as learning in public.)</p>
<p></p>
<p>Of course, people may have many reasons to build a website. They may make one for personal branding, restoring the Old/Personal web, or, again, having fun like I aim to do with this website.</p>
<p></p>
<h2>Related</h2>
<a href="../howto/website-generation.gmi"> One way to build a website, I guess</a><br>
<a href="https://ijver.me/blog/internet-tenancy/"> Internet tenancy is a major problem</a><br>
<a href="https://www.jvt.me/posts/2019/07/22/why-website/"> Jamie Tanna: Why I have a website and why you should too</a><br>
</body>
</html>

View File

@ -1,19 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>On software freedom</title>
</head>
<body>
<h1>On software freedom</h1>
<p>I am a big advocate for libre/free software. If you didn't know, it is software which allows you to use it for whatever end goal you desire, modify it, distribute it, and distribute modified versions of it. This is important since it lets people collaborate on libre software, change it to suit their needs, add new features, or remove anti-features added by the developer, which you can't do with proprietary software.</p>
<p></p>
<p>But I do understand that these benefits may seem too vague. I think that showing some practical examples will help.</p>
<p></p>
<p>First of all, there is NewPipe. It's an alternative YouTube app you can download on FDroid.In many ways, NewPipe represents the best of FOSS: it is functionally superior to the official ThemTube App, there's a fork called NewPipexSponsorBlock with added features, which I'll get to in a moment, and generally it shows the benefits of FOSS in a practical example.</p>
<p></p>
<p>Here are some ways that NewPipe is superior to the official YouTube app: It has no advertisements, it allows you to play videos even when your phone screen is off, it allows you to download videos locally to wherever you want (unlike YouTube's official app, which heavily restricts on your downloads), it saves battery, it has a dark mode setting for OLED (which means that it's completely black, not just gray), it even supports PeerTube, and so on. I could continue listing benefits, but the lesson is clear: NewPipe is better then the official YouTube app. It is designed by the users, for the users (since it's users can also contribute to it as well), rather then being a trashy piece of vendorware that serves to line the wallets of it's developers.</p>
<p></p>
<p>Let me continue with NewPipexSponsorblock, which I briefly mentioned earlier. Some people decided they wanted to add features into the NewPipe app, so they forked the project and added features such as a dislike counter on videos (powered by Return Youtube Dislike), SponsorBlock, and so on.</p>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Todo</title>
</head>
<body>
<h1>Todo</h1>
<p>* Add a feed to this site.</p>
<p>* Also add a search-engine targeted sitemap document</p>
</body>
</html>

View File

@ -1,24 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Useful Addons For Palemoon</title>
</head>
<body>
<h1>Useful Addons For Palemoon</h1>
<p>Here are some addons for Pale Moon which will significantly improve your experience.</p>
<p></p>
<p>* Classic Add-ons Archive - An addon which allows you to install old XUL Firefox addons, that were made before Firefox switched to Web Extensions. Useful if you can't find certain types of addon at addons.palemoon.org.</p>
<p>* Decentraleyes - It downloads CDN content locally and redirects CDN requests to those local downloads.</p>
<p>* HTTPS Always - Makes it so that HTTPS is used by default.</p>
<p>* HTTPS Inquirer - Some helper addon for HTTPS Always.</p>
<p>* Proxy Privacy Ruler</p>
<p>* Secret Agent - Shuffles certain properties of HTTP requests.</p>
<p>* Stylem - A custom stylesheet manager.</p>
<p>* URL Rewriter - Rewrites URLS.</p>
<p>* Vimperator - Gives you a VIM-like interface for using your browser.</p>
<p>* eMatrix - Gives you granular control over what content is accepted or blocked by your browser. A fork of uMatrix.</p>
<p></p>
<p>Personally, I think that redirectors, stylesheet managers, HTTPs by default addons, and content blockers should be built into the browser itself.</p>
</body>
</html>

View File

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Useful Things</title>
</head>
<body>
<h1>Useful Things</h1>
<p>Welcome to this page! Here I'll list things that I've found worth sharing with others.</p>
<p></p>
<a href="./links.gmi"> Useful Web Links</a><br>
<a href="./addons.gmi"> Useful Addons for Pale Moon</a><br>
</body>
</html>

View File

@ -1,80 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Useful Web Links</title>
</head>
<body>
<h1>Useful Web Links</h1>
<p>Basically a one-man one-page web directory for sharing cool stuff on the web.</p>
<p></p>
<h2>People</h2>
<a href="https://drewdevault.com"> Drew DeVault</a><br>
<p>A brilliant pro-libre programmer that designed many of the tools that I use myself. Makes articles on programming, tech in general, although he occasionaly veers into other areas.</p>
<p></p>
<a href="https://lukesmith.xyz"> Luke Smith</a><br>
<p>A pro-libre traditionalist. He focuses less on tech, and more on general real life things. He also tries to live in real life more, rather then being chronically online. Has a channel on PeerTube as well.</p>
<p></p>
<a href="https://seirdy.one"> Seirdy</a><br>
<p>A pro-libre FOSS enthusiast who writes on a variety of topics concerning tech.</p>
<p></p>
<a href="https://atthis.link"> Marc</a><br>
<p>A PhD student who mainly talks about artifical intelligence, libre software, and technology in general.</p>
<p></p>
<h2>Technology</h2>
<h3>Unix/Linux</h3>
<a href="https://wiki.archlinux.org"> Arch Linux Wiki</a><br>
<p>A helpful resource for managing an Arch Linux system; it may even be helpful for Linux in general, since it also covers IN DETAIL things that aren't specific to Arch, such as GRUB, and partitioning.</p>
<p></p>
<a href="http://www.catb.org/~esr/halloween/index.html"> The Halloween Documents</a><br>
<p>A series of leaked Microsoft memos that clearly show that Microsoft wanted to destroy Linux, and that Linux presented a real threat against them.</p>
<p></p>
<h3>Programming</h3>
<a href="https://ewontfix.com"> EWONTFIX</a><br>
<p>A blog about bugs in software. It is written by Rich Felker, the founder of musl libc, and it serves to teach young programmers about mistakes in software, so that they aren't repeated. As they say: those who don't know history are doomed to repeat it.</p>
<p></p>
<h3>Email</h3>
<a href="https://useplaintext.email"> Use Plaintext Email</a><br>
<p>A great website about why you should use Plaintext email.</p>
<p></p>
<h3>Internet</h3>
<a href="http://searchingspot.com"> Searching Spot</a><br>
<p>A guide for using search engines more effectively.</p>
<p></p>
<a href="https://landchad.net"> LandChad</a><br>
<p>A self-hosting guide for various services, such as websites, Peertube instances, Plemora instances, the list goes on. One of the problems with the internet nowadays is that most people aren't independent from their walled gardens yet, and especially don't host their own websites, which means that they are at the whims of a few people at the top of Facebook, Twitter, e.t.c.</p>
<p></p>
<a href="https://jeffhuang.com/designed_to_last"> Jeff Huang's Manifesto "This Page Is Designed To Last"</a><br>
<p>A manifesto on how to increase the maintainability of your webpages. Many webpages die simply because it was too much of a hassle for the author, which could have been avoided if they followed these principles.</p>
<p></p>
<a href="https://anybrowser.org/campaign"> The Any Browser Campaign</a><br>
<p>A campaign about designing for all browsers.</p>
<p></p>
<a href="https://tante.cc/the-third-web"> Tante: Web3</a><br>
<p>An article covering why Web3 is A Bad Idea.</p>
<p></p>
<h3>Privacy</h3>
<a href="https://spyware.neocities.org"> Spyware Watchdog</a><br>
<p>This website shows unsolicited/spyware connections of software, and even has mitigation guides for some software, that mostly or completely removes those connections.</p>
<p></p>
<a href="https://mitmproxy.org"> mitmproxy</a><br>
<p>mitmproxy monitors and displays all connections sent through it and can be used to discover unsolicited connections made by software that connects to the internet.</p>
<p></p>
<h3>Services</h3>
<a href="https://wttr.in"> wttr.in</a><br>
<p>The best weather service I've seen so far with a minimal and quality interface. Best viewed with cURL.</p>
<p></p>
<h2>Humanities</h2>
<h3>Writing</h3>
<a href="https://paulgraham.com/talk.html"> Paul Graham: Write like you talk</a><br>
<p>An excellent article by Paul Graham detailing why you should use a conversational tone in your writings.</p>
<p></p>
<h3>Languages</h3>
<a href="https://lukesmith.xyz/articles/notes-on-learning-languages/"> Luke Smith's notes on learning languages</a><br>
<p>Some tips for learning languages.</p>
<p></p>
<h2>Media</h2>
<a href="https://yewtu.be/channel/UCECl4aNz5hvuRzW5fgCOHKQ"> Jerobeam Fendorson</a><br>
<p>This guy makes oscilloscope music, which is a unique type of music where the sound in his videos can also be plugged into an oscilloscope, to generate the images shown in his videos. This is really unique and interesting, and I highly recommend you go and listen (or watch!).</p>
</body>
</html>

View File

@ -1,23 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Great Software</title>
</head>
<body>
<h1>Great Software</h1>
<p>* Password Store</p>
<p>* Vis</p>
<p>* AWK</p>
<p>* make</p>
<p>* execline</p>
<p>* zathura</p>
<p>* qemu</p>
<p></p>
<p>So yeah today we are going to be talking about pieces of software that vastly outcompete their competitors.</p>
<p></p>
<p>First of all, there's execline, a non-interactive scripting language. It's better then shell because it's way less complex, and therefore has less things that could go wrong. The UNIX philosophy is about making things less complex, after all.</p>
<p></p>
<p>Then there's make</p>
</body>
</html>

View File

@ -1,11 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Tutorials</title>
</head>
<body>
<h1>Tutorials</h1>
<a href="./website-generation.gmi"> One way to build a website, I guess</a><br>
</body>
</html>

View File

@ -1,168 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>!</title>
</head>
<body>
<h1>One way to build a website, I guess</h1>
<p>Let's talk how this website is generated. Basically it's a mashup of pp as a pre-processor, make as a build system, and common utilities you can find on most UNIX systems.</p>
<p></p>
<p>The base structure of my system is as follows. There are 4 directories: src/, tmpl/, html/, and gmi/. src/ contains the naked files that make up this website - what I refer to as "source files" - without the navigation bars or any fancy shenanigans. tmpl/ contains template files for pp, html/ contains the generated HTML, and gmi/ contains the generated gemtext.</p>
<p></p>
<p>Earlier, I mentioned how I use make. The good thing is that since I have configured my Makefile to not automatically execute the 'clean' rule as a part of 'all', only the source files that were changed get processed.</p>
<p></p>
<p>SHELL = '/bin/sh'</p>
<p>SOURCES = $(shell find src -type f)</p>
<p></p>
<p>all: subdirs $(SOURCES:src/%.gmi=html/%.html) $(SOURCES:src/%.gmi=gmi/%.gmi) gmi/sitemap.gmi html/sitemap.html</p>
<p></p>
<p>clean:</p>
<p> rm -rf html/* gmi/*</p>
<p></p>
<p>subdirs:</p>
<p> find src/ -type d -printf '%P\0' | xargs -0 -I{} mkdir -p gmi/{} html/{}</p>
<p></p>
<p>gmi/%.gmi: src/%.gmi tmpl/gmi.uppgmi</p>
<p> pp tmpl/gmi.uppgmi $< > $@</p>
<p></p>
<p>html/%.html: src/%.gmi tmpl/html.upphtml</p>
<p> pp tmpl/html.upphtml $< > $@</p>
<p></p>
<p>gmi/sitemap.gmi: $(shell find src -mindepth 2 -maxdepth 2 -path '*/index.gmi') tmpl/sitemap.uppgmi </p>
<p> pp tmpl/sitemap.uppgmi src/ > $@</p>
<p></p>
<p>html/sitemap.html: $(shell find src -mindepth 2 -maxdepth 2 -path '*/index.gmi') tmpl/sitemap.upphtml </p>
<p> pp tmpl/sitemap.upphtml src/ > $@</p>
<p></p>
<p>.PHONY: clean subdirs </p>
<p></p>
<p>Now let's talk about the processing. pp - the pre-processor - works by taking a template file and some other command-line arguments, processing them, and generating output which you can use for whatever you want.</p>
<p></p>
<p>pp [options] [template-file] [args...]</p>
<p></p>
<p>HTML generation:</p>
<p><title></p>
<h1>!</h1>
<p>awk '/^#[^#]/ { sub("^#([ ]*)", ""); printf "%s", $0; exit } { print "techn0path" }' $1</p>
<h1>!</h1>
<p></title></p>
<p></p>
<p><meta name='referrer' content='no-referrer' /></p>
<p><meta name='author' content='techn0path' /></p>
<p><meta name='viewport' content='width=device-width,initial-scale=1.0' /></p>
<p> </p>
<p><header></p>
<p> <nav></p>
<p> <div id='navbar'></p>
<h1>!</h1>
<p>printf '<a href="%s">codeAI</a> |</p>
<p><a href="%s">notes</a> |</p>
<p><a href="%s">howto</a> |</p>
<p><a href="%s">useful</a>' \</p>
<p> `realpath --relative-to="$(dirname $1)" "$PWD/src/index.html"` \</p>
<p> `realpath --relative-to="$(dirname $1)" "$PWD/src/notes/index.html"` \</p>
<p> `realpath --relative-to="$(dirname $1)" "$PWD/src/howto/index.html"` \</p>
<p> `realpath --relative-to="$(dirname $1)" "$PWD/src/useful/index.html"`</p>
<h1>!</h1>
<p> </div></p>
<p> </nav></p>
<p></header></p>
<p></p>
<p><main></p>
<p> <div id='content'></p>
<h1>!</h1>
<p>printf "<p>Last modified on %s.</p>" `date -u -r "$1" +%Y/%m/%d`</p>
<p></p>
<p>awk -F " " '/^=>/ {</p>
<p> if (NF < 2) next;</p>
<p></p>
<p> sub("^([ ]*)", "", $2);</p>
<p> sub("([ ]*)$", "", $2);</p>
<p></p>
<p> if (match($2, "^\\.(\\.?)\\/") || ! match($2, "^(.*):\\/\\/")) </p>
<p> sub("\\.gmi$", ".html", $2)</p>
<p>} { print $0 }' $1 | gemini2html</p>
<h1>!</h1>
<p> </div></p>
<p></main></p>
<p></p>
<p>Sitemap generation</p>
<h1>Sitemap</h1>
<p>This document is automatically generated. See also:</p>
<a href="howto/website-generation.gmi"> One way to generate a website, I guess</a><br>
<p></p>
<h1>!</h1>
<p>export DIRECTORY="$1"</p>
<p></p>
<p>awk '</p>
<p>/^#[^#]/ { sub("^#([ ]*)", ""); printf "## %s\n", $0 }</p>
<p>/^=>/ {</p>
<p> if (NF < 2) next</p>
<p> link = $2</p>
<p></p>
<p> $1 = ""</p>
<p> $2 = ""</p>
<p></p>
<p> description = $0</p>
<p> sub("^([ ]*)", "", description)</p>
<p> </p>
<p> sprintf("dirname %s", FILENAME) | getline dirname</p>
<p> sprintf("realpath %s/%s", dirname, link) | getline tmp</p>
<p> sprintf("realpath --relative-to=%s %s", ENVIRON["DIRECTORY"], tmp) | getline tmp2</p>
<p> link = tmp2</p>
<p></p>
<p> printf "=> %s %s\n", link, description</p>
<p>}' `find $DIRECTORY -mindepth 2 -maxdepth 2 -path "*/index.gmi"`</p>
<h1>!</h1>
<p></p>
<p>HTML version:</p>
<h1>Note how the navigation bar generation is different.</h1>
<h1>!</h1>
<p>export DIRECTORY="$1"</p>
<p></p>
<p>printf '<a href="%s">codeAI</a> |</p>
<p><a href="%s">notes</a> |</p>
<p><a href="%s">howto</a> |</p>
<p><a href="%s">useful</a> |</p>
<p><a href="%s">sitemap</a>' \</p>
<p> `realpath --relative-to="$DIRECTORY" "$PWD/src/index.html"` \</p>
<p> `realpath --relative-to="$DIRECTORY" "$PWD/src/notes/index.html"` \</p>
<p> `realpath --relative-to="$DIRECTORY" "$PWD/src/howto/index.html"` \</p>
<p> `realpath --relative-to="$DIRECTORY" "$PWD/src/useful/index.html"` \</p>
<p> `realpath --relative-to="$DIRECTORY" "$PWD/src/sitemap.html"`</p>
<h1>!</h1>
<p></p>
<p><div id='content'></p>
<h1>!</h1>
<p>awk '</p>
<p>/^#[^#]/ { sub("^#([ ]*)", ""); printf "<h2>%s</h2>", $0 }</p>
<p>/^=>/ {</p>
<p> if (NF < 2) next</p>
<p> link = $2</p>
<p></p>
<p> $1 = ""</p>
<p> $2 = ""</p>
<p></p>
<p> description = $0</p>
<p> sub("^([ ]*)", "", description)</p>
<p> </p>
<p> sprintf("dirname %s", FILENAME) | getline dirname</p>
<p> sprintf("realpath %s/%s", dirname, link) | getline tmp</p>
<p> sprintf("realpath --relative-to=%s %s", ENVIRON["DIRECTORY"], tmp) | getline tmp2</p>
<p> link = tmp2</p>
<p></p>
<p> if (match(link, "^\\.(\\.?)\\/") || ! match(link, "^(.*):\\/\\/")) </p>
<p> sub("\\.gmi$", ".html", link)</p>
<p></p>
<p> printf "<a href=\"%s\">%s</a><br>", link, description</p>
<p>}' `find $DIRECTORY -mindepth 2 -maxdepth 2 -path "*/index.gmi"`</p>
<h1>!</h1>
<p></div></p>
<p></p>
<h2>Related</h2>
<a href="../notes/on-personal-websites.gmi"> On personal websites</a><br>
<a href="https://www.karl.berlin/static-site.html"> Karl Bartel - 'make' as a static site generator</a><br>
<a href="https://shadowm00n.neocities.org/tech/how_this_site_is_built"> ShadowM00N - How this site is built</a><br>
</body>
</html>

View File

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>techn0path's website</title>
</head>
<body>
<h1>techn0path's website</h1>
<p>On this personal website of mine, I talk about stuff.</p>
<p></p>
<h2>Highlights</h2>
<a href="howto/website-generation.gmi"> One way to generate a website, I guess</a><br>
<a href="notes/on-personal-websites.gmi"> On personal websites</a><br>
<a href="useful/addons.gmi"> Useful addons</a><br>
</body>
</html>

View File

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Notes</title>
</head>
<body>
<h1>Notes</h1>
<p>An ever-growing collection of information.</p>
<p></p>
<a href="on-personal-websites.gmi"> On personal websites</a><br>
<a href="software-freedom"> On software freedom</a><br>
</body>
</html>

View File

@ -1,20 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>On Personal Websites</title>
</head>
<body>
<h1>On Personal Websites</h1>
<p>You are currently on my personal website. :) On my personal website, I talk about basically whatever I want. Reviews, tutorials, articles, you name it. I want to talk about some of the reasons for building it.</p>
<p></p>
<p>I am mostly doing it for fun; designing, writing, and structure are all enjoyable, and part and parcel of website-building. But there are of course other reasons too. Others could learn from me and my experiences; people could query the internet and use my website to solve a problem.. People can give me feedback that allows me to improve my skills, ya know? (Also known as learning in public.)</p>
<p></p>
<p>Of course, people may have many reasons to build a website. They may make one for personal branding, restoring the Old/Personal web, or, again, having fun like I aim to do with this website.</p>
<p></p>
<h2>Related</h2>
<a href="../howto/website-generation.gmi"> One way to build a website, I guess</a><br>
<a href="https://ijver.me/blog/internet-tenancy/"> Internet tenancy is a major problem</a><br>
<a href="https://www.jvt.me/posts/2019/07/22/why-website/"> Jamie Tanna: Why I have a website and why you should too</a><br>
</body>
</html>

View File

@ -1,19 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>On software freedom</title>
</head>
<body>
<h1>On software freedom</h1>
<p>I am a big advocate for libre/free software. If you didn't know, it is software which allows you to use it for whatever end goal you desire, modify it, distribute it, and distribute modified versions of it. This is important since it lets people collaborate on libre software, change it to suit their needs, add new features, or remove anti-features added by the developer, which you can't do with proprietary software.</p>
<p></p>
<p>But I do understand that these benefits may seem too vague. I think that showing some practical examples will help.</p>
<p></p>
<p>First of all, there is NewPipe. It's an alternative YouTube app you can download on FDroid.In many ways, NewPipe represents the best of FOSS: it is functionally superior to the official ThemTube App, there's a fork called NewPipexSponsorBlock with added features, which I'll get to in a moment, and generally it shows the benefits of FOSS in a practical example.</p>
<p></p>
<p>Here are some ways that NewPipe is superior to the official YouTube app: It has no advertisements, it allows you to play videos even when your phone screen is off, it allows you to download videos locally to wherever you want (unlike YouTube's official app, which heavily restricts on your downloads), it saves battery, it has a dark mode setting for OLED (which means that it's completely black, not just gray), it even supports PeerTube, and so on. I could continue listing benefits, but the lesson is clear: NewPipe is better then the official YouTube app. It is designed by the users, for the users (since it's users can also contribute to it as well), rather then being a trashy piece of vendorware that serves to line the wallets of it's developers.</p>
<p></p>
<p>Let me continue with NewPipexSponsorblock, which I briefly mentioned earlier. Some people decided they wanted to add features into the NewPipe app, so they forked the project and added features such as a dislike counter on videos (powered by Return Youtube Dislike), SponsorBlock, and so on.</p>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Todo</title>
</head>
<body>
<h1>Todo</h1>
<p>* Add a feed to this site.</p>
<p>* Also add a search-engine targeted sitemap document</p>
</body>
</html>

View File

@ -1,24 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Useful Addons For Palemoon</title>
</head>
<body>
<h1>Useful Addons For Palemoon</h1>
<p>Here are some addons for Pale Moon which will significantly improve your experience.</p>
<p></p>
<p>* Classic Add-ons Archive - An addon which allows you to install old XUL Firefox addons, that were made before Firefox switched to Web Extensions. Useful if you can't find certain types of addon at addons.palemoon.org.</p>
<p>* Decentraleyes - It downloads CDN content locally and redirects CDN requests to those local downloads.</p>
<p>* HTTPS Always - Makes it so that HTTPS is used by default.</p>
<p>* HTTPS Inquirer - Some helper addon for HTTPS Always.</p>
<p>* Proxy Privacy Ruler</p>
<p>* Secret Agent - Shuffles certain properties of HTTP requests.</p>
<p>* Stylem - A custom stylesheet manager.</p>
<p>* URL Rewriter - Rewrites URLS.</p>
<p>* Vimperator - Gives you a VIM-like interface for using your browser.</p>
<p>* eMatrix - Gives you granular control over what content is accepted or blocked by your browser. A fork of uMatrix.</p>
<p></p>
<p>Personally, I think that redirectors, stylesheet managers, HTTPs by default addons, and content blockers should be built into the browser itself.</p>
</body>
</html>

View File

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Useful Things</title>
</head>
<body>
<h1>Useful Things</h1>
<p>Welcome to this page! Here I'll list things that I've found worth sharing with others.</p>
<p></p>
<a href="./links.gmi"> Useful Web Links</a><br>
<a href="./addons.gmi"> Useful Addons for Pale Moon</a><br>
</body>
</html>

View File

@ -1,80 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Useful Web Links</title>
</head>
<body>
<h1>Useful Web Links</h1>
<p>Basically a one-man one-page web directory for sharing cool stuff on the web.</p>
<p></p>
<h2>People</h2>
<a href="https://drewdevault.com"> Drew DeVault</a><br>
<p>A brilliant pro-libre programmer that designed many of the tools that I use myself. Makes articles on programming, tech in general, although he occasionaly veers into other areas.</p>
<p></p>
<a href="https://lukesmith.xyz"> Luke Smith</a><br>
<p>A pro-libre traditionalist. He focuses less on tech, and more on general real life things. He also tries to live in real life more, rather then being chronically online. Has a channel on PeerTube as well.</p>
<p></p>
<a href="https://seirdy.one"> Seirdy</a><br>
<p>A pro-libre FOSS enthusiast who writes on a variety of topics concerning tech.</p>
<p></p>
<a href="https://atthis.link"> Marc</a><br>
<p>A PhD student who mainly talks about artifical intelligence, libre software, and technology in general.</p>
<p></p>
<h2>Technology</h2>
<h3>Unix/Linux</h3>
<a href="https://wiki.archlinux.org"> Arch Linux Wiki</a><br>
<p>A helpful resource for managing an Arch Linux system; it may even be helpful for Linux in general, since it also covers IN DETAIL things that aren't specific to Arch, such as GRUB, and partitioning.</p>
<p></p>
<a href="http://www.catb.org/~esr/halloween/index.html"> The Halloween Documents</a><br>
<p>A series of leaked Microsoft memos that clearly show that Microsoft wanted to destroy Linux, and that Linux presented a real threat against them.</p>
<p></p>
<h3>Programming</h3>
<a href="https://ewontfix.com"> EWONTFIX</a><br>
<p>A blog about bugs in software. It is written by Rich Felker, the founder of musl libc, and it serves to teach young programmers about mistakes in software, so that they aren't repeated. As they say: those who don't know history are doomed to repeat it.</p>
<p></p>
<h3>Email</h3>
<a href="https://useplaintext.email"> Use Plaintext Email</a><br>
<p>A great website about why you should use Plaintext email.</p>
<p></p>
<h3>Internet</h3>
<a href="http://searchingspot.com"> Searching Spot</a><br>
<p>A guide for using search engines more effectively.</p>
<p></p>
<a href="https://landchad.net"> LandChad</a><br>
<p>A self-hosting guide for various services, such as websites, Peertube instances, Plemora instances, the list goes on. One of the problems with the internet nowadays is that most people aren't independent from their walled gardens yet, and especially don't host their own websites, which means that they are at the whims of a few people at the top of Facebook, Twitter, e.t.c.</p>
<p></p>
<a href="https://jeffhuang.com/designed_to_last"> Jeff Huang's Manifesto "This Page Is Designed To Last"</a><br>
<p>A manifesto on how to increase the maintainability of your webpages. Many webpages die simply because it was too much of a hassle for the author, which could have been avoided if they followed these principles.</p>
<p></p>
<a href="https://anybrowser.org/campaign"> The Any Browser Campaign</a><br>
<p>A campaign about designing for all browsers.</p>
<p></p>
<a href="https://tante.cc/the-third-web"> Tante: Web3</a><br>
<p>An article covering why Web3 is A Bad Idea.</p>
<p></p>
<h3>Privacy</h3>
<a href="https://spyware.neocities.org"> Spyware Watchdog</a><br>
<p>This website shows unsolicited/spyware connections of software, and even has mitigation guides for some software, that mostly or completely removes those connections.</p>
<p></p>
<a href="https://mitmproxy.org"> mitmproxy</a><br>
<p>mitmproxy monitors and displays all connections sent through it and can be used to discover unsolicited connections made by software that connects to the internet.</p>
<p></p>
<h3>Services</h3>
<a href="https://wttr.in"> wttr.in</a><br>
<p>The best weather service I've seen so far with a minimal and quality interface. Best viewed with cURL.</p>
<p></p>
<h2>Humanities</h2>
<h3>Writing</h3>
<a href="https://paulgraham.com/talk.html"> Paul Graham: Write like you talk</a><br>
<p>An excellent article by Paul Graham detailing why you should use a conversational tone in your writings.</p>
<p></p>
<h3>Languages</h3>
<a href="https://lukesmith.xyz/articles/notes-on-learning-languages/"> Luke Smith's notes on learning languages</a><br>
<p>Some tips for learning languages.</p>
<p></p>
<h2>Media</h2>
<a href="https://yewtu.be/channel/UCECl4aNz5hvuRzW5fgCOHKQ"> Jerobeam Fendorson</a><br>
<p>This guy makes oscilloscope music, which is a unique type of music where the sound in his videos can also be plugged into an oscilloscope, to generate the images shown in his videos. This is really unique and interesting, and I highly recommend you go and listen (or watch!).</p>
</body>
</html>

View File

@ -1,23 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Great Software</title>
</head>
<body>
<h1>Great Software</h1>
<p>* Password Store</p>
<p>* Vis</p>
<p>* AWK</p>
<p>* make</p>
<p>* execline</p>
<p>* zathura</p>
<p>* qemu</p>
<p></p>
<p>So yeah today we are going to be talking about pieces of software that vastly outcompete their competitors.</p>
<p></p>
<p>First of all, there's execline, a non-interactive scripting language. It's better then shell because it's way less complex, and therefore has less things that could go wrong. The UNIX philosophy is about making things less complex, after all.</p>
<p></p>
<p>Then there's make</p>
</body>
</html>

33
tmpl/gemini.awk Normal file
View File

@ -0,0 +1,33 @@
function getDirname(path, pathComponents, npathComponents, dirname) {
pathComponents[1] = ""
npathComponents = split(path, pathComponents, "/")
dirname = ""
if (npathComponents < 1) return "."
for (i = 1; i < npathComponents; i++)
dirname = dirname pathComponents[i] "/"
return dirname
}
function relpath(base, path, resolvedPath) {
sprintf("realpath --relative-to=\"%s\" \"%s\"", base, path) | getline resolvedPath
return resolvedPath
}
BEGIN {}
BEGINFILE {
dirname = getDirname(relpath(ENVIRON["PWD"], FILENAME))
printf "Navigation:\n\
=> %s home\n\
=> %s notes\n\
=> %s useful\n\
=> %s howto\n", \
relpath(dirname, ENVIRON["PWD"] "/src/index.gmi"), \
relpath(dirname, ENVIRON["PWD"] "/src/notes/index.gmi"), \
relpath(dirname, ENVIRON["PWD"] "/src/useful/index.gmi"), \
relpath(dirname, ENVIRON["PWD"] "/src/howto/index.gmi")
}
{ print }

View File

@ -42,7 +42,7 @@ BEGIN {
}
if (!match(link, "^([a-zA-Z0-9_]*):"))
sub("\.gmi$", ".html", link)
sub("\\.gmi$", ".html", link)
body = body "<a href=\"" link "\">" description "</a><br>\n"
next