From 375204f6a5e76ea1629f61628a3f9537969e3774 Mon Sep 17 00:00:00 2001 From: Pranshu Sharma Date: Fri, 13 Dec 2024 01:02:38 +1000 Subject: Inital commit --- cork/.index.html.swo | Bin 0 -> 16384 bytes cork/.index.html.swp | Bin 0 -> 12288 bytes cork/index.html | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 cork/.index.html.swo create mode 100644 cork/.index.html.swp create mode 100644 cork/index.html (limited to 'cork') diff --git a/cork/.index.html.swo b/cork/.index.html.swo new file mode 100644 index 0000000..20d71b4 Binary files /dev/null and b/cork/.index.html.swo differ diff --git a/cork/.index.html.swp b/cork/.index.html.swp new file mode 100644 index 0000000..71713de Binary files /dev/null and b/cork/.index.html.swp differ diff --git a/cork/index.html b/cork/index.html new file mode 100644 index 0000000..dc637d0 --- /dev/null +++ b/cork/index.html @@ -0,0 +1,103 @@ + + + + + + + + + Cork + + +
+

Cork

+
Small, Fast, Performant
+ +
+ +
+
+
+

Author: Christos

+
+

What is Cork?

+

Cork is a fast and performant static-site generator written in RC shell, leveraging Plan9's simple core-utils. Originally, just a fork of werc, Cork has become my software philosophy put into practice (more on that further down) +

+

Why fork werc?

+

I assume many people have never heard of werc. Werc power's sites such as cat-v, suckless and 9front to name a few. +

I fell in love with werc because of it's design simplicity and how easy it was to deploy to manage multiple subdomains and sites +

However during the honeymoon period some creaks had started to show, due to werc's generous list of things it can support (apps, caching etc.) it made changing fundemental scripting behaviour a lot more difficult. Moreover, said support meant a lot more system calls, system calls for features I would never have a need for. +

Werc rightfully so can boast of having a core that is only 150 sloc, whereas the entirety of cork is under 70 sloc and base cork is under 50. +

I respectfully believe werc provides features that 90 percent of users would never need +

+

What isn't cork

+

Cork is not a markdown to html converter. +

You can use any md2html program +

Some popular ones (that I know of are) +

  • smu
  • discount
md2html.awk +
+

Why Cork?

+

Ability to use shell to script custom functions +

A scriptable static sidebar listing directory contents. +

+

+

+

+

+

+

+

Installation

+

Cork has only been tested with OpenBSD's webserver `httpd`, +

First you must install the Plan9 core-utils +

plan9port or 9base can be used (if you don't want a full-blown 9 install) +

For plan9port installation, Download 9base +

Now, download and save the entire cork script one directory outside where you plan to keep your site +

Add the following to `/etc/httpd.conf` +

This is a 'sane' template, which I'll get to why it is later +

+
+server "c.bauherren.ovh" {
+	listen on * port 80
+	connection request timeout 4
+	location "/pix/*" {
+		root "/example.org"
+	}
+	location found "/*" {
+		root "/example.org/home"
+	}
+	location not found "/*" {
+		root "/"
+		fastcgi {
+			param PATH "/bin"
+			param PLAN9 "/usr/local/plan9"
+			param SCRIPT_FILENAME "/example.org/cork"
+			socket "/run/slowcgi.sock"
+		}
+	}
+}
+	
+

httpd
searches in
/var/www
so create a directory with your site's name, cd into it and create two more directories. +

One called home (this is where you're .md content will go) and one called pix/ +

Run `rcctl start httpd slowcgi +

Post installation tips

+

As stated earlier, cork strides to reduce system calls. This is very inline with it's author's software philosophy +

I do not like invoking

sed or its UNIX buddies
many times, so as to not oncur their wrath please practice a form of file hygiene +

The following are things I don't like you keeping public +

    +
  • dot files +
  • filenames with spaces +
  • executables +
+

You can keep pictures public but they'll be indexed in the sidebar, if they're directory is visible. That might be something you want. +

+

Issues

+

I'm currently writing the script for a full Cork demo and setup walkthrough, so I hope that will cover any foreseeable issues. +

My email is always open +

+
+
-- cgit v1.2.3