all repos — site @ ef756fa738c2757d20021cde081797e86879389d

source for my site, found at icyphox.sh

Init wiki
Anirudh Oppiliappan x@icyphox.sh
Tue, 16 Mar 2021 22:13:48 +0530
commit

ef756fa738c2757d20021cde081797e86879389d

parent

87e1d30a82434655f126610c7d9f45cd25d642e7

M bin/plaintext.shbin/plaintext.sh

@@ -1,4 +1,4 @@

-#!/bin/sh +#!/bin/sh if ! command -v lynx then
A bin/wiki.sh

@@ -0,0 +1,39 @@

+#!/usr/bin/env bash + +# wiki.sh -- helper script to generate a wiki +# does all kinds of weird shit. this is NOT how you engineer software, people. + +WIKI_PATH="pages/wiki" +ROOT_INDEX_MD="pages/wiki/_index.md" + +generate_index() { + mapfile -d $'\0' entries < <(find "$WIKI_PATH" ! -path "$WIKI_PATH" -print0) + prevdir='' + for r in "${entries[@]}"; do + path="$(basename "$r")" + [ "$path" != "_index.md" ] && { + if [ -d "$r" ]; then + printf '%s\n' "- [$path](/wiki/$path)" + prevdir="$path" + elif [ "$(basename "$(dirname "$r")")" == "$prevdir" ]; then + noext="${path%%'.md'}" + printf ' %s\n' "- [$noext](/wiki/$prevdir/$noext)" + else + printf '%s\n' "- [$path](/wiki/$path)" + fi + } + done +} + +printf '%s' "--- +title: wiki +subtitle: Ideas, beliefs and thoughts. +template: page.html +--- + +# The wiki. + +" > "$ROOT_INDEX_MD" +generate_index >> "$ROOT_INDEX_MD" + +exit 0
M config.yamlconfig.yaml

@@ -1,5 +1,5 @@

title: icyphox's blog -header: | +header: | <a href=/> <img class="logo" src="/static/white.svg" alt="icyphox's avatar"/> </a>

@@ -34,7 +34,7 @@ </section>

prebuild: - # - bin/update_index.py + - bin/wiki.sh postbuild: # - bin/plaintext.sh
M pages/_index.mdpages/_index.md

@@ -3,10 +3,3 @@ template: index.html

title: icyphox's blog subtitle: Computers, security & computer security. --- - -<!-- -<section class="hero"> -<a href=/> -<img class="logo" src="/static/white.svg" alt="icyphox's avatar"/> -</a> -</section>-->
A pages/wiki/_index.md

@@ -0,0 +1,10 @@

+--- +title: wiki +subtitle: Ideas, beliefs and thoughts. +template: page.html +--- + +# The wiki. + +- [identity](/wiki/identity) + - [name](/wiki/identity/name)
A pages/wiki/identity/_index.md

@@ -0,0 +1,1 @@

+something
A pages/wiki/identity/name.md

@@ -0,0 +1,11 @@

+--- +template: page.html +title: name +date: 2021-03-16 +--- + +# What's an *icyphox*? + +There isn't much to it. A common explaination I like to give: I like the +color of ice, and I like foxes; `icyfox` was taken, so `icyphox` was the +next best thing.
A templates/wiki.html

@@ -0,0 +1,41 @@

+<!DOCTYPE html> +<html lang=en> +<head> + <link rel="stylesheet" href="/static/style.css" type="text/css"> + <meta name="viewport" content="initial-scale=1"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta charset="UTF-8"> + <meta name="HandheldFriendly" content="true"> + <meta name="twitter:card" content="summary_large_image"> + <meta name="twitter:site" content="@icyphox"> + <meta name="twitter:title" content="{{ .Fm.Title }}"> + <meta name="twitter:image" content="/static/icyphox.png"> + <meta property="og:title" content="{{ .Fm.Title }}"> + <meta property="og:type" content="website"> + <meta property="og:url" content="https://icyphox.sh"> + <meta property="og:image" content="/static/icyphox.png"> + + <link rel="icon" type="image/png" sizes="16x16" href="/favicon.png"> + <meta name="theme-color" content="#ffffff"> +</head> + <title> + {{ .Fm.Title }} + </title> + <body> + <div class="container"> + <div class="pull-left"> + <div class="content"> + <header> + {{ .Cfg.Header }} + </header> + <main> + {{ .Fm.Body }} + </main> + </div> + <footer> + {{ .Cfg.Footer }} + </footer> + </div> + </div> + </body> +</html>