Merge pull request #15 from audiodude/wiki-categories

Categorize the wiki
This commit is contained in:
Ben Harris 2020-04-13 01:26:48 -04:00 committed by GitHub
commit b46459e4c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 58 additions and 7 deletions

View File

@ -8,17 +8,37 @@ include __DIR__."/../header.php";
<p>here's the articles on our wiki:</p> <p>here's the articles on our wiki:</p>
<ul> <ul>
<?php <?php
$article_to_title = []; $category_to_articles = [];
foreach (glob("source/*.md") as $file) { foreach (glob("source/*.md") as $file) {
$article = basename($file, ".md"); $article = basename($file, ".md");
$title = preg_match("/title: (.*)/i", file_get_contents($file), $matches) ? $matches[1] : $article; $title = preg_match("/title: (.*)/i", file_get_contents($file), $matches) ? $matches[1] : $article;
$article_to_title[$article] = $title; $category = preg_match("/category: (.*)/i", file_get_contents($file), $matches) ? $matches[1] : 'default';
if (array_key_exists($category, $category_to_articles)) {
array_push($category_to_articles[$category], [$article, $title]);
} else {
$category_to_articles[$category] = [[$article, $title]];
}
ksort($category_to_articles);
} }
asort($article_to_title);
?> ?>
<?php foreach ($article_to_title as $article => $title) { ?> <?php foreach ($category_to_articles as $category => $articles) { ?>
<li><a href="/wiki/<?=$article?>.html"><?=$title?></a></li> <li><?=$category?></li>
<?php } ?> <ul>
<?php
$article_titles = [];
$article_names = [];
foreach ($articles as $article) {
array_push($article_names, $article[0]);
array_push($article_titles, $article[1]);
}
$name_to_title = array_combine($article_names, $article_titles);
asort($name_to_title);
foreach ($name_to_title as $name => $title) { ?>
<li><a href="/wiki/<?=$name?>.html"><?=$title?></a></li>
<?php } ?>
</ul>
<?php } ?>
</ul> </ul>
<?php include __DIR__."/../footer.php"; <?php include __DIR__."/../footer.php";

View File

@ -1,6 +1,7 @@
--- ---
title: USING Two-Factor Authentication (2FA) ON TILDE.CLUB title: USING Two-Factor Authentication (2FA) ON TILDE.CLUB
author: deepend author: deepend
category: tilde.club
--- ---
# Using Two-Factor Authentication (2FA). # Using Two-Factor Authentication (2FA).

View File

@ -1,5 +1,6 @@
--- ---
title: archive.org title: archive.org
category: links
--- ---
archive.org has an archive of tilde.club at [http://web.archive.org/web/*/http://tilde.club](http://web.archive.org/web/*/http://tilde.club) archive.org has an archive of tilde.club at [http://web.archive.org/web/*/http://tilde.club](http://web.archive.org/web/*/http://tilde.club)

View File

@ -3,6 +3,7 @@ title: bashblog
author: author:
- deepend - deepend
- benharri - benharri
category: software
--- ---

View File

@ -3,6 +3,7 @@ title: Socializing and chat
author: author:
- emv - emv
- benharri - benharri
category: tilde.club
--- ---
## irc ## irc

View File

@ -1,6 +1,7 @@
--- ---
title: command line for absolute beginners title: command line for absolute beginners
author: cmccabe author: cmccabe
category: tutorial
--- ---
So, you want to join a public-access shell community like tilde.club, So, you want to join a public-access shell community like tilde.club,

View File

@ -1,6 +1,7 @@
--- ---
title: code of conduct title: code of conduct
author: benharri author: benharri
category: tilde.club
--- ---
> **tl;dr** learn by doing and helping. be excellent to each other. have fun! > **tl;dr** learn by doing and helping. be excellent to each other. have fun!

View File

@ -1,6 +1,7 @@
--- ---
title: donate to tilde.club title: donate to tilde.club
author: deepend author: deepend
category: tilde.club
--- ---
## Methods you can donate to tilde.club. ## Methods you can donate to tilde.club.

View File

@ -1,6 +1,7 @@
--- ---
title: Editing your index.html file title: Editing your index.html file
author: vielmetti author: vielmetti
category: tutorial
--- ---
Type: `nano` index.html to open your index.html file and begin editing Type: `nano` index.html to open your index.html file and begin editing

View File

@ -1,6 +1,7 @@
--- ---
title: email title: email
author: benharri author: benharri
category: tutorial
--- ---
Your shiny, new tilde.club account comes with an email account. `alpine` is a command-line email application to use it, as is `mutt`. Good old-fashioned `mail` works too, although it's a little cryptic. Your shiny, new tilde.club account comes with an email account. `alpine` is a command-line email application to use it, as is `mutt`. Good old-fashioned `mail` works too, although it's a little cryptic.

View File

@ -1,6 +1,7 @@
--- ---
title: custom 404 title: custom 404
author: deepend author: deepend
category: tutorial
--- ---
All users can now setup their own custom 404 error page. Just add a file named `404.html` in `~/public_html` All users can now setup their own custom 404 error page. Just add a file named `404.html` in `~/public_html`

View File

@ -1,6 +1,7 @@
--- ---
title: faq title: faq
author: ford author: ford
category: tilde.club
--- ---
_______________________________________ _______________________________________

View File

@ -1,5 +1,6 @@
--- ---
title: finding your index.html title: finding your index.html
category: tutorial
--- ---
There are some basic command line commands you'll want to Google and learn, but for this tutorial you only need a few: There are some basic command line commands you'll want to Google and learn, but for this tutorial you only need a few:

View File

@ -1,5 +1,6 @@
--- ---
title: how to use git title: how to use git
category: tutorial
--- ---
`git` is a version control system. It's pretty confusing at first, but `git` is a version control system. It's pretty confusing at first, but

View File

@ -1,6 +1,7 @@
--- ---
title: gopher title: gopher
author: benharri author: benharri
category: tutorial
--- ---
tilde.club now serves gopher! we're using tilde.club now serves gopher! we're using

View File

@ -1,5 +1,6 @@
--- ---
title: JSON title: JSON
category: software
--- ---
JSON is the "Javascript Object Notation", basically a file format for JSON is the "Javascript Object Notation", basically a file format for

View File

@ -1,5 +1,6 @@
--- ---
title: Leafnode title: Leafnode
category: links
--- ---
`leafnode` is a news client suitable for "leaf" nodes, that is nodes that have no downstream feeds. `leafnode` is a news client suitable for "leaf" nodes, that is nodes that have no downstream feeds.

View File

@ -1,5 +1,6 @@
--- ---
title: tilde.club netiquette title: tilde.club netiquette
category: tilde.club
--- ---
## Two phrases we use a lot ## Two phrases we use a lot

View File

@ -1,6 +1,7 @@
--- ---
title: safe scripting the tilde way title: safe scripting the tilde way
author: michaelcoyote author: michaelcoyote
category: tutorial
--- ---
Welcome to tilde.club. For many of you this may be your first multi-user host and for even more of you this may be your *first* host. Welcome to all of you. Welcome to tilde.club. For many of you this may be your first multi-user host and for even more of you this may be your *first* host. Welcome to all of you.

View File

@ -1,5 +1,6 @@
--- ---
title: terminal multiplexers - screen title: terminal multiplexers - screen
category: software
--- ---
`screen` is a unix utility that lets you manage multiple shells from within a single window. You switch between them with a few keystrokes. When you disconnect it keeps the processes alive, and you can reconnect from another login. `screen` is a unix utility that lets you manage multiple shells from within a single window. You switch between them with a few keystrokes. When you disconnect it keeps the processes alive, and you can reconnect from another login.

View File

@ -1,6 +1,7 @@
--- ---
title: Editing Basic UNIX Security the Tilde way title: Editing Basic UNIX Security the Tilde way
author: michaelcoyote author: michaelcoyote
category: tutorial
--- ---

View File

@ -1,5 +1,6 @@
--- ---
title: slrn title: slrn
category: links
--- ---
``slrn`` is a news reader for [Usenet](usenet-news.html). ``slrn`` is a news reader for [Usenet](usenet-news.html).

View File

@ -1,6 +1,7 @@
--- ---
author: benharri author: benharri
title: ssh title: ssh
category: tutorial
--- ---

View File

@ -1,6 +1,7 @@
--- ---
author: jeffbonhag author: jeffbonhag
title: SSHFS title: SSHFS
category: software
--- ---
On OS X: On OS X:

View File

@ -1,5 +1,6 @@
--- ---
title: time zones title: time zones
category: tutorial
--- ---
The timezone by default on the server is UTC. The timezone by default on the server is UTC.

View File

@ -1,5 +1,6 @@
--- ---
title: tin title: tin
category: software
--- ---
tin is a threaded NNTP and spool based [UseNet](usenet-news.html) newsreader for a variety of platforms. tin is a threaded NNTP and spool based [UseNet](usenet-news.html) newsreader for a variety of platforms.

View File

@ -1,5 +1,6 @@
--- ---
title: terminal multiplexers - tmux title: terminal multiplexers - tmux
category: software
--- ---
TMUX IS THE BEST. Here's a super basic primer. TMUX IS THE BEST. Here's a super basic primer.

View File

@ -1,5 +1,6 @@
--- ---
title: Tunnelblick title: Tunnelblick
category: links
--- ---
`tunnelblick` is an application for your Mac that allows you to configure `tunnelblick` is an application for your Mac that allows you to configure

View File

@ -1,5 +1,6 @@
--- ---
title: usenet news title: usenet news
category: tutorial
--- ---
## this is out of date and the netnews server is down ## this is out of date and the netnews server is down

View File

@ -1,5 +1,6 @@
--- ---
title: .vimrc file title: .vimrc file
category: tutorial
--- ---
The file `.vimrc` in your home directory has instructions for [[vim]] The file `.vimrc` in your home directory has instructions for [[vim]]

View File

@ -1,5 +1,6 @@
--- ---
title: VPN Gate title: VPN Gate
category: links
--- ---
`VPN Gate` is a project from U Tsukuba in Japan that allows you to `VPN Gate` is a project from U Tsukuba in Japan that allows you to

View File

@ -1,6 +1,7 @@
--- ---
title: how to contribute to this wiki title: how to contribute to this wiki
author: benharri author: benharri
category: tilde.club
--- ---
## got a topic you want to write about? ## got a topic you want to write about?