commit 886271bb3b9a07295ecf7c6c8878fb52bdeff9b4
from: Bradley Taunt
date: Fri Jan 19 14:02:37 2024 UTC
Initial commit for cgit platform
commit - /dev/null
commit + 886271bb3b9a07295ecf7c6c8878fb52bdeff9b4
blob - /dev/null
blob + 936625681e8cfb92d8296d78671c7f029964395c (mode 644)
--- /dev/null
+++ LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 Bradley Taunt
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
blob - /dev/null
blob + b16a580d4287ec6d562703ab8d5de8619a7ca506 (mode 644)
--- /dev/null
+++ Makefile
@@ -0,0 +1,13 @@
+build:
+ sh ./barf
+ rsync -r public/ build/public
+
+clean:
+ rm -rf build/*
+
+watch:
+ while true; do \
+ ls -d .git/* * posts/* pages/* header.html | entr -cd make ;\
+ done
+
+.PHONY: build clean watch
blob - /dev/null
blob + bcd498b788b13d0a7844c3d7576536be668a71f9 (mode 644)
--- /dev/null
+++ README.md
@@ -0,0 +1,151 @@
+# barf
+
+barf is an extremely minimal blog generator.
+
+The entire build script is less than 100 lines of shell.
+
+It could *almost* be called "suckless", but probably isn't.
+
+(barf is a modified/forked version of Karl Bartel's fantastic [blog.sh](https://github.com/karlb/karl.berlin). Be sure to check it out since my version does things slightly different.)
+
+You can see a [live demo here](https://barf.btxx.org)
+
+# Why 'barf'?
+
+> **barf**
+>
+> Blogs Are Really Fun
+
+---
+
+# Core Features
+
+- Extremely portable
+- Automatic, **valid** RSS generation
+- Handles both blog posts and normal pages
+- No front matter or templating, just create markdown files
+
+---
+
+# Requirements
+
+`barf` was originally built on and for Linux, but has since been updated to
+include support for both OpenBSD and MacOS out-of-the-box.
+
+## Linux
+
+- rsync
+- smu (see below)
+- entr (optonal)
+- standard UNIX tools
+
+## OpenBSD
+
+Please refer to the [main tutorial on setting up barf on
+OpenBSD](https://barf.btxx.org/openbsd)
+
+- coreutils
+- gcc
+- cmake
+- rsync
+- gsed
+- smu (see below)
+- entr (optional)
+
+## MacOS
+
+Please refer to the [main tutorial on setting up barf on
+MacOS](https://barf.btxx.org/macos)
+
+- coreutils
+- gnu-sed
+- rsync
+- smu (see below)
+- entr (optional)
+
+---
+
+# Basic Setup
+
+Clone this repo and navigate inside it. Edit the "header.html" and "footer.html" files with your own information, navigation, etc.
+
+Be sure to edit the **RSS meta url** or else your feed won't validate!
+
+Then, clone and build my patched version of smu:
+
+```sh
+git clone https://git.btxx.org/smu
+cd smu
+# OpenBSD users: change sudo to doas
+sudo make install
+```
+
+Then clone this directory and build:
+
+```sh
+make build
+```
+
+Your blog content will be in the `build` directory.
+
+Now you can delete the dummy posts/pages and start making your own!
+
+Media (such as images, videos) are placed in the "public" folder and carried over to the "build" folder via rsync. You can easily remove this altogether inside the main `barf` script if you plan to store media elsewhere (or not use any at all).
+
+---
+
+# Post Structure
+
+The first line of any markdown file inside your `posts` directory should start
+with a h1 heading, then a line break, then the date in `YYYY-MM-DD` format.
+Like so:
+
+
+ # This is the Post Title
+
+ 2023-01-05
+
+
+Changing this structure or date format will break things or require you to edit
+the `barf` script accordingly.
+
+# Projects Goals
+
+- The core focus should be to **reduce** the code of this project, not increase it. Overall scope needs to remain small.
+- Major tweaks/add-ons should be run by individuals via forks/patches - not put into the barf base
+
+---
+
+# Submitting Patches
+
+Please [send me patches via git email](mailto:bt@btxx.org) to submit
+your patches or bug fixes. Thanks!
+
+---
+
+# FAQs
+
+## How do I test locally?
+
+Inside your project directory run:
+
+```sh
+make watch
+cd build && python3 -m http.server 3003
+```
+
+## Do you plan to add "X"? Can *I* add "X"?
+
+Most likely not. I'm happy with how things are currently. If you want to add something - great! The point of this project is to give others the ability to fork it, tweak it, patch it, and share it as much as they'd like. The core of barf will remain minimal for this reason.
+
+Of course, any patches that can help *reduce* the project's footprint or even speed things up are more than welcome!
+
+## Can I use other Markdown parsers?
+
+Of course! Simply edit the main `barf` script and swap out `smu` with something else. I wouldn't advise doing this if you already have pre-existing content based-off `smu`, since this could break some of your pages.
+
+But give [smu](https://git.btxx.org/smu) a try - it is very lightweight and fast!
+
+```
+MORE FAQs TO COME...
+```
blob - /dev/null
blob + 81bbcd2bc21da39eab9f8673b3b79405892919f9 (mode 755)
--- /dev/null
+++ barf
@@ -0,0 +1,105 @@
+#!/bin/sh
+set -eu
+MARKDOWN=smu
+IFS=' '
+
+# Create tab separated file with filename, title, creation date, last update
+index_tsv() {
+ for f in "$1"/*.md
+ do
+ title=$(sed -n '/^# /{s/# //p; q}' "$f")
+ printf '%s\t%s\t%s\t%s\n' "$f" "${title:="No Title"}"
+ done
+}
+
+index_html() {
+ # Print header
+ title=$(sed -n '/^# /{s/# //p; q}' index.md)
+ sed "s/{{TITLE}}/$title/" header.html
+
+ # Intro text
+ $MARKDOWN index.md
+
+ echo "
"
+
+ # Posts
+ while read -r f title created; do
+ link=$(echo "$f" | sed -E 's|.*/(.*).md|\1/|')
+ created=$(echo $(head -3 "$f" | tail -1))
+ echo "
barf is a minimal and suckless-inspired blog generator. It is a tweaked and slightly patched version of Karl Bartel's fantastic blog.sh.
+
Why?
+
This project was created by me, Bradley Taunt, out of frustration with overly complex and bloated blogging options. I tried so many "minimal" generators but each one ended up having some glaring issue or heavy reliance on dependencies.
+
I wanted to have a system that I could easily replicate on any Linux machine. Something that didn't require me to download half the internet just to get up and running. I'm a sucker for keeping things simple.
+
\ No newline at end of file
blob - /dev/null
blob + fcb42f06f9829b0e4d9c007bdaceda5581c26b8f (mode 644)
--- /dev/null
+++ build/atom.xml
@@ -0,0 +1,335 @@
+
+
+ barf
+
+ 2023-12-19T10:20:13Z
+
+ Bradley Taunt
+
+ https://barf.bt.ht,2023-01-04:default-atom-feed/
+
+ Running `barf` on OpenBSD
+ <h1>Running <code>barf</code> on OpenBSD</h1>
+<p>2023-08-12</p>
+<p>The <code>barf</code> project was built on Linux and was catered towards Linux users. The core of the project will remain focused on Linux/GNU tools, but I also need to support OpenBSD since that is my personal operating system of choice.</p>
+<h2>Download Packages</h2>
+<p>Along with your Markdown parser of choice (<code>barf</code> assumes you will be using my version of <a href="https://git.sr.ht/~bt/smu">smu</a>) you will also need to install the required packages on your OpenBSD system:</p>
+<pre><code>doas pkg_add rsync coreutils gsed cmake gcc
+</code></pre>
+<p>Then ensure that you alter all instances of <code>sed</code> with <code>gsed</code> in the core <code>barf</code> file. (Or make an alias if you'd prefer not to alter the main file)</p>
+<p>After that, everything should work perfectly fine when building!</p>
+
+ https://barf.bt.ht/openbsd
+ 2023-08-12T10:00:00Z
+ 2023-08-12T10:00:00Z
+
+
+ Markdown Examples in barf
+ <h1>Markdown Examples in barf</h1>
+<p>2023-01-05</p>
+<p>This following was lifted from <a href="https://github.com/karlb/smu">https://github.com/karlb/smu</a></p>
+<h1><code>smu</code> Syntax</h1>
+<p>smu was started as a rewrite of
+<a href="http://daringfireball.net/projects/markdown/">markdown</a> but became something
+more lightweight and consistent. It differs from <a href="https://commonmark.org/">CommonMark</a> in the following ways:</p>
+<ul>
+<li>No support for <em>reference style links</em></li>
+<li>Stricter indentation rules for lists</li>
+<li>Lists don't end paragraphs by themselves (blank line needed)</li>
+<li>Horizontal rules (<code><hr></code>) must use <code>- - -</code> as syntax</li>
+<li>Code fences have stricter syntax</li>
+</ul>
+<p>Patches that increase the CommonMark compatibility are welcome as long as they don't increase the code complexity significantly.</p>
+<p>This project is a fork of the <a href="https://github.com/gottox/smu">original smu</a> by
+<a href="https://eboland.de">Enno Boland (gottox)</a>. The main differences to the
+original smu are:</p>
+<ul>
+<li>Support for code fences</li>
+<li>Improved <a href="https://commonmark.org/">CommonMark</a> compatibility. E.g.
+<ul>
+<li>Code blocks need four spaces indentation instead of three</li>
+<li>Skip empty lines at end of code blocks</li>
+<li>Ignore single spaces around code spans</li>
+<li>Keep HTML comments in output</li>
+<li>Improved spec compliance for lists</li>
+<li>Nesting code block in blockquotes works</li>
+<li>"Empty" lines in lists behave identically, no matter how much whitespace they contain</li>
+<li>No backslash escapes in code blocks</li>
+<li>Use first number as start number for ordered lists</li>
+</ul>
+</li>
+<li>Added a simple test suite to check for compliance and avoid regressions</li>
+</ul>
+<h2>Inline patterns</h2>
+<p>There are several patterns you can use to highlight your text:</p>
+<ul>
+<li><p>Emphasis</p>
+
+<ul>
+<li>Surround your text with <code>*</code> or <code>_</code> to get <em>emphasised</em> text:
+<pre><code>This *is* cool.
+This _is_ cool, too.
+</code></pre>
+</li>
+<li>Surround your text with <code>**</code> or <code>__</code> to get <strong>strong</strong> text:
+<pre><code>This **is** cool.
+This __is__ cool, too.
+</code></pre>
+</li>
+<li>Surround your text with <code>***</code> or <code>___</code> to get <strong><em>strong and emphasised</em></strong> text:
+<pre><code>This ***is*** cool.
+This ___is___ cool, too.
+</code></pre>
+</li>
+<li>But this example won't work as expected:
+<pre><code>***Hello** you*
+</code></pre>
+<p>This is a wontfix bug because it would make the source too complex.
+Use this instead:
+</p>
+<pre><code>***Hello*** *you*
+</code></pre>
+</li>
+</ul>
+</li>
+<li><p>inline Code</p>
+<p>You can produce inline code by surrounding it with backticks.</p>
+<pre><code>Use `rm -rf /` if you're a N00b.
+Use ``rm -rf /`` if you're a N00b.
+Use ```rm -rf /``` if you're a N00b.
+</code></pre>
+<p>Double and triple backticks can be used if the code itself contains backticks.</p>
+</li>
+</ul>
+<h2>Titles</h2>
+<p>Creating titles in smu is very easy. There are two different syntax styles. The
+first is underlining with at least three characters:</p>
+<pre><code>Heading
+=======
+
+Topic
+-----
+</code></pre>
+<p>This is very intuitive and self explaining. The resulting sourcecode looks like
+this:</p>
+<pre><code><h1>Heading</h1>
+<h2>Topic</h2>
+</code></pre>
+<p>Use the following prefixes if you don't like underlining:</p>
+<pre><code># h1
+## h2
+### h3
+#### h4
+##### h5
+###### h6
+</code></pre>
+<h2>Links</h2>
+<p>The simplest way to define a link is with simple <code><></code>.</p>
+<pre><code><http://s01.de>
+</code></pre>
+<p>You can do the same for E-Mail addresses:</p>
+<pre><code><yourname@s01.de>
+</code></pre>
+<p>If you want to define a label for the url, you have to use a different syntax</p>
+<pre><code>[smu - simple mark up](http://s01.de/~gottox/index.cgi/proj_smu)
+</code></pre>
+<p>The resulting HTML-Code</p>
+<pre><code><a href="http://s01.de/~gottox/index.cgi/proj_smu">smu - simple mark up</a></p>
+</code></pre>
+<h2>Lists</h2>
+<p>Defining lists is very straightforward:</p>
+<pre><code>* Item 1
+* Item 2
+* Item 3
+</code></pre>
+<p>Result:</p>
+<pre><code><ul>
+<li>Item 1</li>
+<li>Item 2</li>
+<li>Item 3</li>
+</ul>
+</code></pre>
+<p>Defining ordered lists is also very easy:</p>
+<pre><code>1. Item 1
+2. Item 2
+3. Item 3
+</code></pre>
+<p>Only the first number in a list is meaningful. All following list items are
+continously counted. If you want a list starting at 2, you could write:</p>
+<pre><code>2. Item 1
+2. Item 2
+2. Item 3
+</code></pre>
+<p>and get the following HTML which will render with the numbers 2, 3, 4:</p>
+<pre><code><ol start="2">
+<li>Item 1</li>
+<li>Item 2</li>
+<li>Item 3</li>
+</ol>
+</code></pre>
+<h2>Code & Blockquote</h2>
+<p>Use the <code>> </code> as a line prefix for defining blockquotes. Blockquotes are
+interpreted as well. This makes it possible to embed links, headings and even
+other quotes into a quote:</p>
+<pre><code>> Hello
+> This is a quote with a [link](http://s01.de/~gottox)
+</code></pre>
+<p>Result:
+</p>
+<pre><code><blockquote><p>
+Hello
+This is a quote with a <a href="http://s01.de/~gottox">link</a></p>
+</blockquote>
+</code></pre>
+<p>You can define a code block with a leading Tab or with <strong>4</strong> leading spaces</p>
+<pre><code> this.is(code)
+
+ this.is(code, too)
+</code></pre>
+<p>Result:
+</p>
+<pre><code><pre><code>this.is(code)</code></pre>
+<pre><code>this.is(code, too)
+</code></pre>
+</code></pre>
+<p>Please note that you can't use HTML or smu syntax in a code block.</p>
+<p>Another way to write code blocks is to use code fences:</p>
+<pre><code>```json
+{"some": "code"}
+```
+</code></pre>
+<p>This has two advantages:</p>
+
+<ul>
+<li>The optional language identifier will be turned into a <code>language-</code> class name</li>
+<li>You can keep the original indentation which helps when doing copy & paste</li>
+</ul>
+<h2>Tables</h2>
+<p>Tables can be generated with the following syntax:</p>
+<pre><code>| Heading1 | Heading2 |
+| -------- | -------- |
+| Cell 1 | Cell2 |
+</code></pre>
+<p>Aligning the columns make the input nicer to read, but is not necessary to get
+correct table output. You could just write</p>
+<pre><code>| Heading1 | Heading2 |
+| --- | --- |
+| Cell 1 | Cell2 |
+</code></pre>
+<p>To align the content of table cells, use <code>|:--|</code> for left, <code>|--:|</code> for right
+and <code>|:--:|</code> for centered alignment in the row which separates the header from
+the table body.</p>
+<pre><code>| Heading1 | Heading2 | Heading3 |
+| :------- | :------: | -------: |
+| Left | Center | Right |
+</code></pre>
+<h2>Other interesting stuff</h2>
+<ul>
+<li><p>to insert a horizontal rule simple add <code>- - -</code> into an empty line:</p>
+<pre><code>Hello
+- - -
+Hello2
+</code></pre>
+<p>Result:
+</p>
+<pre><code><p>
+Hello
+<hr />
+</code></pre>
+<pre><code>Hello2</p>
+</code></pre>
+</li>
+<li><p>Any ASCII punctuation character may escaped by precedeing them with a
+backslash to avoid them being interpreted:</p>
+<pre><code>!"#$%&'()*+,-./:;<=>?@[]^_`{|}~\
+</code></pre>
+</li>
+<li><p>To force a linebreak simple add two spaces to the end of the line:</p>
+<pre><code>No linebreak
+here.
+But here is
+one.
+</code></pre>
+</li>
+</ul>
+<h2>embed HTML</h2>
+<p>You can include arbitrary HTML code in your documents. The HTML will be
+passed through to the resulting document without modification. This is a good
+way to work around features that are missing in smu. If you don't want this
+behaviour, use the <code>-n</code> flag when executing smu to stricly escape the HTML
+tags.</p>
+
+ https://barf.bt.ht/markdown-examples
+ 2023-01-05T10:00:00Z
+ 2023-01-05T10:00:00Z
+
+
+ Running `barf` on MacOS
+ <h1>Running <code>barf</code> on MacOS</h1>
+<p>2023-01-18</p>
+<p>The <code>barf</code> project was built on Linux and was catered towards Linux users. The core of the project will remain focused on Linux/GNU tools, but that doesn't mean MacOS needs to be left out in the cold.</p>
+<p>There are some very minor changes you'll need to make to your default <code>sed</code> and <code>date</code> paths if you plan to run barf on MacOS.</p>
+<h2>Download Packages</h2>
+<p>This walkthrough assumes that you already have <a href="https://brew.sh/">homebrew</a> installed on your machine.</p>
+<p>You will need to install the GNU versions of both <code>date</code> and <code>sed</code> in order to avoid breaking things when <code>barf</code> tries to build.</p>
+<pre><code>brew install coreutils
+brew install gnu-sed
+</code></pre>
+<h2>Setting <code>gsed</code> and <code>gdate</code> as Default</h2>
+<p>Now run the following in a terminal shell:</p>
+<pre><code>sudo ln -fs /opt/homebrew/bin/gsed /usr/local/bin/sed
+sudo ln -fs /opt/homebrew/bin/gdate /usr/local/bin/date
+</code></pre>
+<p>and add the following to your <code>.bash_profile</code> file:</p>
+<pre><code>export PATH="/usr/local/bin:$PATH"
+</code></pre>
+<p>Reload your <code>bash</code> instance and everything should work as intended!</p>
+
+ https://barf.bt.ht/macos
+ 2023-01-18T10:00:00Z
+ 2023-01-18T10:00:00Z
+
+
+ Supporting Basic Dark Mode
+ <h1>Supporting Basic Dark Mode</h1>
+<p>2023-03-07</p>
+<p>The default <code>barf</code> site generator now supports basic dark mode functionality. This has been achieved by including the standard <code>color-scheme</code> meta tag in the core <code>header.html</code> file:</p>
+<pre><code><meta name="color-scheme" content="dark light">
+</code></pre>
+<p>This change also ships with some minor updates to the default <code>blockquote</code> design. You can see an example below:</p>
+<blockquote><p>This is a really <em>cool</em> blockquote</p>
+</blockquote>
+<h2>Minor Caveat</h2>
+<p>Unfortunately, Safari still has minor <code>ahref</code> / link color issue when defaulting to browser dark mode. If this is a problem for your own build of <code>barf</code>, take a look at a <a href="https://bt.ht/safari-default-dark-mode/">solution I wrote about here</a>.</p>
+<p>Personally, I can't be bothered to add that extra code to this project. The Safari team needs to get their shit together and fix such a simple bug. Plus, you shouldn't be using Safari anyway - it's proprietary garbage.</p>
+
+ https://barf.bt.ht/dark-mode
+ 2023-03-07T10:00:00Z
+ 2023-03-07T10:00:00Z
+
+
+ Cleaning Up barf's Structure
+ <h1>Cleaning Up barf's Structure</h1>
+<p>2023-10-09</p>
+<p>Things probably look a little different around here. Both in terms of this demo site <em>and</em> the core <code>barf</code> files itself.</p>
+<p>This project was always intended to be focused on Linux platforms. So, I've removed the included <code>barf_macos</code> and <code>barf_openbsd</code> files to keep the generator more streamlined. But have no fear! Instructions for both Mac and OpenBSD can still be found on the main blog:</p>
+<ul>
+<li><a href="/macos">Running <code>barf</code> on MacOS</a></li>
+<li><a href="/openbsd">Running <code>barf</code> on OpenBSD</a></li>
+</ul>
+<p>As for the "default" look of <code>barf</code>, I've simplified things further. The total CSS styling now consists of only:</p>
+<pre><code>*{box-sizing:border-box;}
+body{font-family:sans-serif;margin:0 auto;max-width:650px;padding:1rem;}
+img{max-width:100%;}
+pre{overflow:auto;}
+</code></pre>
+<p>Users still have the ability to tweak things as much as they'd like, but the standard look should be more than enough for anyone just focusing on writing. Dark mode has also been dropped but is easily added by adding the following inside the <code>head</code> tags:</p>
+<pre><code><meta name="color-scheme" content="dark light">
+</code></pre>
+<p>Hopefully these changes reduce the overall scope of the project, which was a main point made on the README originally!</p>
+
+ https://barf.bt.ht/cleanup
+ 2023-10-09T10:00:00Z
+ 2023-10-09T10:00:00Z
+
+
blob - /dev/null
blob + 1b8e3997ab2e02c9f530d5931a1d42ff3b1e4c8d (mode 644)
--- /dev/null
+++ build/cleanup/index.html
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+ Cleaning Up barf's Structure
+
+
+
+
+
+
+
+
Cleaning Up barf's Structure
+
2023-10-09
+
Things probably look a little different around here. Both in terms of this demo site and the core barf files itself.
+
This project was always intended to be focused on Linux platforms. So, I've removed the included barf_macos and barf_openbsd files to keep the generator more streamlined. But have no fear! Instructions for both Mac and OpenBSD can still be found on the main blog:
Users still have the ability to tweak things as much as they'd like, but the standard look should be more than enough for anyone just focusing on writing. Dark mode has also been dropped but is easily added by adding the following inside the head tags:
+
<meta name="color-scheme" content="dark light">
+
+
Hopefully these changes reduce the overall scope of the project, which was a main point made on the README originally!
+
\ No newline at end of file
blob - /dev/null
blob + 5a4c58a86da5caec8344a450300a8f58afc12fd8 (mode 644)
--- /dev/null
+++ build/dark-mode/index.html
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+ Supporting Basic Dark Mode
+
+
+
+
+
+
+
+
Supporting Basic Dark Mode
+
2023-03-07
+
The default barf site generator now supports basic dark mode functionality. This has been achieved by including the standard color-scheme meta tag in the core header.html file:
+
<meta name="color-scheme" content="dark light">
+
+
This change also ships with some minor updates to the default blockquote design. You can see an example below:
+
This is a really cool blockquote
+
+
Minor Caveat
+
Unfortunately, Safari still has minor ahref / link color issue when defaulting to browser dark mode. If this is a problem for your own build of barf, take a look at a solution I wrote about here.
+
Personally, I can't be bothered to add that extra code to this project. The Safari team needs to get their shit together and fix such a simple bug. Plus, you shouldn't be using Safari anyway - it's proprietary garbage.
+
\ No newline at end of file
blob - /dev/null
blob + 5a2de3f404135b3b092c617c4253d829a9afe6ff (mode 644)
--- /dev/null
+++ build/index.html
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+ barf
+
+
+
+
+
+
+
+
barf
+
barf is an extremely minimal blog generator.
+
The entire build script is less than 100 lines of shell.
+
It could almost be called "suckless", but probably isn't. It was created for those focused on writing, not tinkering.
+
\ No newline at end of file
blob - /dev/null
blob + 09b4b6075c8bf9d2dc12f84ad63640eb1cdbf10a (mode 644)
--- /dev/null
+++ build/macos/index.html
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+ Running `barf` on MacOS
+
+
+
+
+
+
+
+
Running barf on MacOS
+
2023-01-18
+
The barf project was built on Linux and was catered towards Linux users. The core of the project will remain focused on Linux/GNU tools, but that doesn't mean MacOS needs to be left out in the cold.
+
There are some very minor changes you'll need to make to your default sed and date paths if you plan to run barf on MacOS.
+
Download Packages
+
This walkthrough assumes that you already have homebrew installed on your machine.
+
You will need to install the GNU versions of both date and sed in order to avoid breaking things when barf tries to build.
Use the > as a line prefix for defining blockquotes. Blockquotes are
+interpreted as well. This makes it possible to embed links, headings and even
+other quotes into a quote:
+
> Hello
+> This is a quote with a [link](http://s01.de/~gottox)
+
+
Result:
+
+
<blockquote><p>
+Hello
+This is a quote with a <a href="http://s01.de/~gottox">link</a></p>
+</blockquote>
+
+
You can define a code block with a leading Tab or with 4 leading spaces
To align the content of table cells, use |:--| for left, |--:| for right
+and |:--:| for centered alignment in the row which separates the header from
+the table body.
+
| Heading1 | Heading2 | Heading3 |
+| :------- | :------: | -------: |
+| Left | Center | Right |
+
+
Other interesting stuff
+
+
to insert a horizontal rule simple add - - - into an empty line:
+
Hello
+- - -
+Hello2
+
+
Result:
+
+
<p>
+Hello
+<hr />
+
+
Hello2</p>
+
+
+
Any ASCII punctuation character may escaped by precedeing them with a
+backslash to avoid them being interpreted:
+
!"#$%&'()*+,-./:;<=>?@[]^_`{|}~\
+
+
+
To force a linebreak simple add two spaces to the end of the line:
+
No linebreak
+here.
+But here is
+one.
+
+
+
+
embed HTML
+
You can include arbitrary HTML code in your documents. The HTML will be
+passed through to the resulting document without modification. This is a good
+way to work around features that are missing in smu. If you don't want this
+behaviour, use the -n flag when executing smu to stricly escape the HTML
+tags.
+
\ No newline at end of file
blob - /dev/null
blob + f7d57c49b6324c79fb15ccad41182170ea44c7b3 (mode 644)
--- /dev/null
+++ build/openbsd/index.html
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+ Running `barf` on OpenBSD
+
+
+
+
+
+
+
+
Running barf on OpenBSD
+
2023-08-12
+
The barf project was built on Linux and was catered towards Linux users. The core of the project will remain focused on Linux/GNU tools, but I also need to support OpenBSD since that is my personal operating system of choice.
+
Download Packages
+
Along with your Markdown parser of choice (barf assumes you will be using my version of smu) you will also need to install the required packages on your OpenBSD system:
+
doas pkg_add rsync coreutils gsed cmake gcc
+
+
Then ensure that you alter all instances of sed with gsed in the core barf file. (Or make an alias if you'd prefer not to alter the main file)
+
After that, everything should work perfectly fine when building!
+
\ No newline at end of file
blob - /dev/null
blob + a69e2d0ada6ac74abaf28195c0b29d405091bf44 (mode 644)
--- /dev/null
+++ build/pages.tsv
@@ -0,0 +1,2 @@
+pages/about.md About `barf`
+pages/websites.md Websites Built with `barf`
blob - /dev/null
blob + 374d954a0f2583bcc61ab5e8b2164432ec25d644 (mode 644)
--- /dev/null
+++ build/posts.tsv
@@ -0,0 +1,5 @@
+posts/openbsd.md Running `barf` on OpenBSD
+posts/markdown-examples.md Markdown Examples in barf
+posts/macos.md Running `barf` on MacOS
+posts/dark-mode.md Supporting Basic Dark Mode
+posts/cleanup.md Cleaning Up barf's Structure
blob - /dev/null
blob + ee024c8610ac49dfb4f141d1e91993d7b2bf8981 (mode 644)
--- /dev/null
+++ build/public/images/barf.svg
@@ -0,0 +1,17 @@
+
blob - /dev/null
blob + f1e498f98839b60819c9c01ff2f7b567f247bc15 (mode 644)
--- /dev/null
+++ build/websites/index.html
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+ Websites Built with `barf`
+
+
+
+
+
+
+
+
Websites Built with barf
+
Send an email to brad [at] bt [dot] ht if you would like me to add your barf-generated website to this list.
+
\ No newline at end of file
blob - /dev/null
blob + cec016dd66cd169ef4e960cbf436ace4afa60024 (mode 644)
--- /dev/null
+++ footer.html
@@ -0,0 +1,14 @@
+
\ No newline at end of file
blob - /dev/null
blob + 03eac643bb651046893866720b0164d29f6ba436 (mode 644)
--- /dev/null
+++ header.html
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+ {{TITLE}}
+
+
+
+
+
+
+
blob - /dev/null
blob + 238aeba30f439efa6c452d3c090edf57abbb1855 (mode 644)
--- /dev/null
+++ index.md
@@ -0,0 +1,15 @@
+# barf
+
+**barf is an extremely minimal blog generator.**
+
+The entire build script is less than 100 lines of shell.
+
+It could almost be called "suckless", but probably isn't. It was created for those focused on writing, not tinkering.
+
+You can learn more by reading the [official README](https://git.sr.ht/~bt/barf) and view the generated [Atom feed here](/atom.xml)
+
+**barf** = blogs are really fun
+
+---
+
+### Articles
blob - /dev/null
blob + 78eb6efd267cf4a271fc3047961d26416b597b24 (mode 644)
--- /dev/null
+++ pages/about.md
@@ -0,0 +1,9 @@
+# About `barf`
+
+barf is a minimal and suckless-inspired blog generator. It is a tweaked and slightly patched version of Karl Bartel's fantastic [blog.sh](https://github.com/karlb/karl.berlin).
+
+## Why?
+
+This project was created by me, [Bradley Taunt](https://bt.ht), out of frustration with overly complex and bloated blogging options. I tried *so many* "minimal" generators but each one ended up having some glaring issue or heavy reliance on dependencies.
+
+I wanted to have a system that I could easily replicate on any Linux machine. Something that didn't require me to download half the internet just to get up and running. I'm a sucker for keeping things simple.
blob - /dev/null
blob + 582ab7823d0ced617f1ada81301c22a8acbff200 (mode 644)
--- /dev/null
+++ pages/websites.md
@@ -0,0 +1,7 @@
+# Websites Built with `barf`
+
+Send an email to brad [at] bt [dot] ht if you would like me to add your barf-generated website to this list.
+
+- [barf.bt.ht](https://barf.bt.ht)
+- [adast.dk](https://adast.dk)
+- [arena.adast.dk](https://arena.adast.dk)
blob - /dev/null
blob + 6cf73777e7b9591e7ca431c7818b0cd0dc3686d4 (mode 644)
--- /dev/null
+++ posts/cleanup.md
@@ -0,0 +1,27 @@
+# Cleaning Up barf's Structure
+
+2023-10-09
+
+Things probably look a little different around here. Both in terms of this demo site *and* the core `barf` files itself.
+
+This project was always intended to be focused on Linux platforms. So, I've removed the included `barf_macos` and `barf_openbsd` files to keep the generator more streamlined. But have no fear! Instructions for both Mac and OpenBSD can still be found on the main blog:
+
+- [Running `barf` on MacOS](/macos)
+- [Running `barf` on OpenBSD](/openbsd)
+
+As for the "default" look of `barf`, I've simplified things further. The total CSS styling now consists of only:
+
+```
+*{box-sizing:border-box;}
+body{font-family:sans-serif;margin:0 auto;max-width:650px;padding:1rem;}
+img{max-width:100%;}
+pre{overflow:auto;}
+```
+
+Users still have the ability to tweak things as much as they'd like, but the standard look should be more than enough for anyone just focusing on writing. Dark mode has also been dropped but is easily added by adding the following inside the `head` tags:
+
+```
+
+```
+
+Hopefully these changes reduce the overall scope of the project, which was a main point made on the README originally!
\ No newline at end of file
blob - /dev/null
blob + e31c24cafccf076256964fd461c03a3afea24efb (mode 644)
--- /dev/null
+++ posts/dark-mode.md
@@ -0,0 +1,19 @@
+# Supporting Basic Dark Mode
+
+2023-03-07
+
+The default `barf` site generator now supports basic dark mode functionality. This has been achieved by including the standard `color-scheme` meta tag in the core `header.html` file:
+
+```
+
+```
+
+This change also ships with some minor updates to the default `blockquote` design. You can see an example below:
+
+> This is a really *cool* blockquote
+
+## Minor Caveat
+
+Unfortunately, Safari still has minor `ahref` / link color issue when defaulting to browser dark mode. If this is a problem for your own build of `barf`, take a look at a [solution I wrote about here](https://bt.ht/safari-default-dark-mode/).
+
+Personally, I can't be bothered to add that extra code to this project. The Safari team needs to get their shit together and fix such a simple bug. Plus, you shouldn't be using Safari anyway - it's proprietary garbage.
\ No newline at end of file
blob - /dev/null
blob + 85f263078eff8b2e81bc3a78d0a34a4b022c2cab (mode 644)
--- /dev/null
+++ posts/macos.md
@@ -0,0 +1,31 @@
+# Running `barf` on MacOS
+
+2023-01-18
+
+The `barf` project was built on Linux and was catered towards Linux users. The core of the project will remain focused on Linux/GNU tools, but that doesn't mean MacOS needs to be left out in the cold.
+
+There are some very minor changes you'll need to make to your default `sed` and `date` paths if you plan to run barf on MacOS.
+
+## Download Packages
+
+This walkthrough assumes that you already have [homebrew](https://brew.sh/) installed on your machine.
+
+You will need to install the GNU versions of both `date` and `sed` in order to avoid breaking things when `barf` tries to build.
+
+
+ brew install coreutils
+ brew install gnu-sed
+
+
+## Setting `gsed` and `gdate` as Default
+
+Now run the following in a terminal shell:
+
+ sudo ln -fs /opt/homebrew/bin/gsed /usr/local/bin/sed
+ sudo ln -fs /opt/homebrew/bin/gdate /usr/local/bin/date
+
+and add the following to your `.bash_profile` file:
+
+ export PATH="/usr/local/bin:$PATH"
+
+Reload your `bash` instance and everything should work as intended!
blob - /dev/null
blob + dc3d2dcd5d0afb4f50314dba33b9079e64d77565 (mode 644)
--- /dev/null
+++ posts/markdown-examples.md
@@ -0,0 +1,254 @@
+# Markdown Examples in barf
+
+2023-01-05
+
+This following was lifted from [https://github.com/karlb/smu](https://github.com/karlb/smu)
+
+`smu` Syntax
+============
+
+smu was started as a rewrite of
+[markdown](http://daringfireball.net/projects/markdown/) but became something
+more lightweight and consistent. It differs from [CommonMark](https://commonmark.org/) in the following ways:
+
+* No support for _reference style links_
+* Stricter indentation rules for lists
+* Lists don't end paragraphs by themselves (blank line needed)
+* Horizontal rules (``) must use `- - -` as syntax
+* Code fences have stricter syntax
+
+Patches that increase the CommonMark compatibility are welcome as long as they don't increase the code complexity significantly.
+
+This project is a fork of the [original smu](https://github.com/gottox/smu) by
+[Enno Boland (gottox)](https://eboland.de). The main differences to the
+original smu are:
+
+* Support for code fences
+* Improved [CommonMark](https://commonmark.org/) compatibility. E.g.
+ * Code blocks need four spaces indentation instead of three
+ * Skip empty lines at end of code blocks
+ * Ignore single spaces around code spans
+ * Keep HTML comments in output
+ * Improved spec compliance for lists
+ * Nesting code block in blockquotes works
+ * "Empty" lines in lists behave identically, no matter how much whitespace they contain
+ * No backslash escapes in code blocks
+ * Use first number as start number for ordered lists
+* Added a simple test suite to check for compliance and avoid regressions
+
+Inline patterns
+---------------
+
+There are several patterns you can use to highlight your text:
+
+* Emphasis
+ * Surround your text with `*` or `_` to get *emphasised* text:
+ This *is* cool.
+ This _is_ cool, too.
+ * Surround your text with `**` or `__` to get **strong** text:
+ This **is** cool.
+ This __is__ cool, too.
+ * Surround your text with `***` or `___` to get ***strong and emphasised*** text:
+ This ***is*** cool.
+ This ___is___ cool, too.
+ * But this example won't work as expected:
+ ***Hello** you*
+ This is a wontfix bug because it would make the source too complex.
+ Use this instead:
+ ***Hello*** *you*
+
+* inline Code
+
+ You can produce inline code by surrounding it with backticks.
+
+ Use `rm -rf /` if you're a N00b.
+ Use ``rm -rf /`` if you're a N00b.
+ Use ```rm -rf /``` if you're a N00b.
+
+ Double and triple backticks can be used if the code itself contains backticks.
+
+
+Titles
+------
+
+Creating titles in smu is very easy. There are two different syntax styles. The
+first is underlining with at least three characters:
+
+ Heading
+ =======
+
+ Topic
+ -----
+
+This is very intuitive and self explaining. The resulting sourcecode looks like
+this:
+
+
Heading
+
Topic
+
+Use the following prefixes if you don't like underlining:
+
+ # h1
+ ## h2
+ ### h3
+ #### h4
+ ##### h5
+ ###### h6
+
+Links
+-----
+
+The simplest way to define a link is with simple `<>`.
+
+
+
+You can do the same for E-Mail addresses:
+
+
+
+If you want to define a label for the url, you have to use a different syntax
+
+ [smu - simple mark up](http://s01.de/~gottox/index.cgi/proj_smu)
+
+The resulting HTML-Code
+
+ smu - simple mark up
+
+Defining ordered lists is also very easy:
+
+ 1. Item 1
+ 2. Item 2
+ 3. Item 3
+
+Only the first number in a list is meaningful. All following list items are
+continously counted. If you want a list starting at 2, you could write:
+
+ 2. Item 1
+ 2. Item 2
+ 2. Item 3
+
+and get the following HTML which will render with the numbers 2, 3, 4:
+
+
+
Item 1
+
Item 2
+
Item 3
+
+
+Code & Blockquote
+-----------------
+
+Use the `> ` as a line prefix for defining blockquotes. Blockquotes are
+interpreted as well. This makes it possible to embed links, headings and even
+other quotes into a quote:
+
+ > Hello
+ > This is a quote with a [link](http://s01.de/~gottox)
+
+Result:
+
+
+
+You can define a code block with a leading Tab or with __4__ leading spaces
+
+ this.is(code)
+
+ this.is(code, too)
+
+Result:
+
this.is(code)
+
this.is(code, too)
+
+
+Please note that you can't use HTML or smu syntax in a code block.
+
+Another way to write code blocks is to use code fences:
+
+ ```json
+ {"some": "code"}
+ ```
+
+This has two advantages:
+* The optional language identifier will be turned into a `language-` class name
+* You can keep the original indentation which helps when doing copy & paste
+
+Tables
+------
+
+Tables can be generated with the following syntax:
+
+ | Heading1 | Heading2 |
+ | -------- | -------- |
+ | Cell 1 | Cell2 |
+
+Aligning the columns make the input nicer to read, but is not necessary to get
+correct table output. You could just write
+
+ | Heading1 | Heading2 |
+ | --- | --- |
+ | Cell 1 | Cell2 |
+
+To align the content of table cells, use `|:--|` for left, `|--:|` for right
+and `|:--:|` for centered alignment in the row which separates the header from
+the table body.
+
+ | Heading1 | Heading2 | Heading3 |
+ | :------- | :------: | -------: |
+ | Left | Center | Right |
+
+Other interesting stuff
+-----------------------
+
+* to insert a horizontal rule simple add `- - -` into an empty line:
+
+ Hello
+ - - -
+ Hello2
+
+ Result:
+
+ Hello
+
+
+ Hello2
+
+* Any ASCII punctuation character may escaped by precedeing them with a
+ backslash to avoid them being interpreted:
+
+ !"#$%&'()*+,-./:;<=>?@[]^_`{|}~\
+
+* To force a linebreak simple add two spaces to the end of the line:
+
+ No linebreak
+ here.
+ But here is
+ one.
+
+embed HTML
+----------
+
+You can include arbitrary HTML code in your documents. The HTML will be
+passed through to the resulting document without modification. This is a good
+way to work around features that are missing in smu. If you don't want this
+behaviour, use the `-n` flag when executing smu to stricly escape the HTML
+tags.
blob - /dev/null
blob + 82200e0047e319e2ea976dd199e9aaf34282a73e (mode 644)
--- /dev/null
+++ posts/openbsd.md
@@ -0,0 +1,17 @@
+# Running `barf` on OpenBSD
+
+2023-08-12
+
+The `barf` project was built on Linux and was catered towards Linux users. The core of the project will remain focused on Linux/GNU tools, but I also need to support OpenBSD since that is my personal operating system of choice.
+
+## Download Packages
+
+Along with your Markdown parser of choice (`barf` assumes you will be using my version of [smu](https://git.sr.ht/~bt/smu)) you will also need to install the required packages on your OpenBSD system:
+
+```
+doas pkg_add rsync coreutils gsed cmake gcc
+```
+
+Then ensure that you alter all instances of `sed` with `gsed` in the core `barf` file. (Or make an alias if you'd prefer not to alter the main file)
+
+After that, everything should work perfectly fine when building!
blob - /dev/null
blob + ee024c8610ac49dfb4f141d1e91993d7b2bf8981 (mode 644)
--- /dev/null
+++ public/images/barf.svg
@@ -0,0 +1,17 @@
+