summaryrefslogtreecommitdiff
path: root/cork
diff options
context:
space:
mode:
authorPranshu Sharma <pranshu@pebl>2024-12-13 01:02:38 +1000
committerPranshu Sharma <pranshu@pebl>2024-12-13 01:02:38 +1000
commit375204f6a5e76ea1629f61628a3f9537969e3774 (patch)
treed2b9b7bec13da3541cb57f39842feaaeb0bf0f12 /cork
Inital commit
Diffstat (limited to 'cork')
-rw-r--r--cork/.index.html.swobin0 -> 16384 bytes
-rw-r--r--cork/.index.html.swpbin0 -> 12288 bytes
-rw-r--r--cork/index.html103
3 files changed, 103 insertions, 0 deletions
diff --git a/cork/.index.html.swo b/cork/.index.html.swo
new file mode 100644
index 0000000..20d71b4
--- /dev/null
+++ b/cork/.index.html.swo
Binary files differ
diff --git a/cork/.index.html.swp b/cork/.index.html.swp
new file mode 100644
index 0000000..71713de
--- /dev/null
+++ b/cork/.index.html.swp
Binary files 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 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link rel="stylesheet" href="/style.css">
+<style>
+main img {
+ border: 0.2em solid black;
+ padding: 0.2em;
+}
+</style>
+ <title>Cork</title>
+</head>
+<body>
+ <header>
+ <h1>Cork</h1>
+ <blockquote>Small, Fast, Performant</blockquote>
+ <img src="/img/ornament.svg" type="svg" id="ornament"/>
+ <header>
+
+ <main>
+ <section id="projects">
+ <div class="project">
+ <p><em>Author: <a href=//c.bauherren.ovh>Christos</a></em></p>
+ <br>
+ <h3>What is Cork?</h3>
+ <p>Cork is a fast and performant static-site generator written in RC shell, leveraging Plan9's simple core-utils. Originally, just a fork of <a href="//werc.cat-v.org/"><i>werc</i></a>, Cork has become my software philosophy put into practice (more on that further down)
+ <br><br>
+ <h3>Why fork werc?</h3>
+ <p>I assume many people have never heard of werc. Werc power's sites such as <a href=http://cat-v.org>cat-v</a>, <a href=https://git.suckless.org/swerc/>suckless</a> and <a href=http://9front.org>9front</a> to name a few.
+ <p>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
+ <p>However during the honeymoon period some creaks had started to show, due to werc's generous list of things it can support (<a href=https://werc.cat-v.org/apps/>apps</a>, 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.
+ <p>Werc rightfully so can boast of having a <b>core</b> that is only 150 sloc, whereas the <b>entirety</b> of cork is under 70 sloc and base cork is under 50.
+ <p>I respectfully believe werc provides features that 90 percent of users would never need
+ <br><br>
+ <h3>What isn't cork</h3>
+ <p>Cork is not a markdown to html converter.
+ <p>You can use any md2html program
+ <p>Some popular ones (that I know of are)
+ <ul><li>smu<li>discount</ul>md2html.awk
+<br>
+ <h3>Why Cork?</h3>
+ <p>Ability to use shell to script custom functions
+ <p>A scriptable static sidebar listing directory contents.
+ <br><br>
+ <center>
+<p><img src="//c.bauherren.ovh/pix/cork-demo1.png" style="width: 300px;">
+ <p><img src="//c.bauherren.ovh/pix/cork-demo2.png" style="width: 350px;">
+ <p><img src="//c.bauherren.ovh/pix/cork-demo3.png" style="width:350px;">
+ </center>
+ <br><br>
+ <h3>Installation</h3>
+ <p>Cork has only been tested with OpenBSD's webserver `httpd`,
+ <p>First you must install the Plan9 core-utils
+ <p>plan9port or 9base can be used (if you don't want a full-blown 9 install)
+ <p>For <a href=//0x19.org/posts/2021-11-28.php>plan9port</a> installation, Download <a href=//tools.suckless.org/9base/>9base</a>
+ <p>Now, <a href=https://c.bauherren.ovh/src/run/c.txt>download</a> and save the entire cork script one directory outside where you plan to keep your site
+ <p>Add the following to `/etc/httpd.conf`
+ <p>This is a 'sane' template, which I'll get to why it is later
+ <pre>
+
+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"
+ }
+ }
+}
+ </pre>
+ <p><pre>httpd</pre> searches in <pre>/var/www</pre> so create a directory with your site's name, cd into it and create two more directories.
+ <p>One called home (this is where you're .md content will go) and one called pix/
+ <p>Run `rcctl start httpd slowcgi</pre>
+ <h3>Post installation tips</h3>
+ <p>As stated earlier, cork strides to reduce system calls. This is very inline with it's author's software philosophy
+ <p>I do not like invoking <pre>sed or its UNIX buddies</pre> many times, so as to not oncur their wrath please practice a form of file hygiene
+ <p>The following are things I don't like you keeping public
+ <ul>
+ <li>dot files
+ <li>filenames with spaces
+ <li>executables
+ </ul>
+ <p>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.
+ <br><br>
+ <h3>Issues</h3>
+ <p>I'm currently writing the script for a full Cork demo and setup walkthrough, so I hope that will cover any foreseeable issues.
+ <p>My <a href=mailto:christos@bauherren.ovh>email</a> is always open
+ </div>
+ </section>
+</main><footer><a href=/><img src="/img/footer.svg" type="svg" width="25%;"/></a></footer></body></html>