Initial zola commit

Deleted all unk-related business, ran `zola init`, and forgot to commit for a
while.  What I've done in since then is as follows:

- write templates with inheritance
  - base template is "base.html". {index,page}.html extend base. section.html
    extends index.
  - also wrote "river.html", which extends section and instead of listing
    posts, expands them all in the page itself.
  - none of these templates do pagination yet.
- port index, news, joining from old site
- add style (still CSS but with SCSS extension), favicon, and other images.

I think that's it.  There might be a few more things.
This commit is contained in:
Case Duckworth 2021-11-20 17:53:31 -06:00
parent b5a8bf3d6b
commit 0b9aa0ac9f
41 changed files with 264 additions and 422 deletions

24
Dp
View File

@ -1,24 +0,0 @@
{
"name": "breadpunk.club",
"url": "https://breadpunk.club",
"signup_url": "https://breadpunk.club/join",
"user_count": "$(getent group|grep '^bakers:'|cut -d: -f4|tr , '\n'|wc -l)",
"want_users": true,
"admin_email": "breadpunk@acdw.net",
"description": "We are a shared Unix computer focused on bread: baking it, eating it, using it as fiat currency in the event of a cataclysm, that sort of thing.",
"users": [
$(lastuser="$(getent group|grep '^bakers:'|cut -d: -f4|tr , '\n'|tail -n1)"
for user in $(getent group|grep '^bakers:'|cut -d: -f4|tr , '\n'); do
cat <<-ENDUSER
{
"username": "$user",
"title": "$(awk '/<title>/{gsub("</?title>","");
sub(/^[ ]/,"");sub(/[ ]$/,"");
print;}' /home/$user/public_html/index.html)",
"mtime": "$(stat -c %Y /home/$user/public_html/index.html)"
}$( [ "$lastuser" = "$user" ] || printf ',' )
ENDUSER
done
)
]
}

View File

@ -1,19 +0,0 @@
title docs
$([ -d "$BREADDOCS" ] &&
for F in $(find "$BREADDOCS" -path "$BREADDOCS/.git" -prune -o -type f -print); do
case "$F" in
*manifesto.md) ;;
*man*) continue;;
esac
l "doc: $F"
dir="$UNKO/docs/$(NN)"
rm -rf "$dir"
mkdir -p "$dir"
X "$UNKL" > "$dir/index.html"
cat <<ENDOFITEM
- [$(M title)](/docs/$(NN))
ENDOFITEM
done
)

View File

@ -1,9 +0,0 @@
id joining
title join us!
we're still a pretty small server:
we only have $(ls /home|wc -l) bakers!
we're all pretty friendly and would love to have you along.
check out our [joining page](/join)
to apply for membership to breadpunk.club.

View File

@ -1,11 +0,0 @@
title news
id news
<ul>
$(for art in $(find "$BREADNEWS" -path "$BREADNEWS/.git" -prune -o -type f -print | sort -nr|head -n3); do
cat <<-ENDOFARTICLE
<li>$(M date "$art"|defstr $(NN "$art")|wrapstr span class="time")
<a href="/news#$(NN "$art")">$(M title "$art")</a></li>
ENDOFARTICLE
done)
</ul>

View File

@ -1,14 +0,0 @@
title bakers
subtitle in order of most recent bake
id bakers
<ul>
$(for u in $(
find /home/*/public_html -maxdepth 0 -printf '%T@\t%p\n'|
sort -nr |
cut -f2- |
sed 's,/home/\(.*\)/public_html,\1,')
do
p "<li><a href=\"/~$u\">~$u</a></li>"
done)
</ul>

View File

@ -1,16 +0,0 @@
title joining
breadpunk.club is open to anyone. it's suggested that you look at our
[manifesto](/docs/manifesto) and make sure it's something you're interested in,
as well as our [code of conduct](/docs/code-of-conduct) to make sure you agree
with our terms.
to become a baker, just send an email to [breadw](/~breadw) with your SSH key (attached, please!),
desired username (must be bread-oriented), realname (can be your “normal”
username), and what shell youd like to use (we have
$(cat /etc/shells|
awk -F/ '/^#/{next}/tmux$/{next}/screen$/{next}
{if (!match(shs, $NF)) shs = (shs ? shs", " : shs) $NF}
END{sub(/[^,]+$/," and&",shs);print shs}')).
well see you around the bakery!

View File

@ -1,12 +0,0 @@
title news
$(for art in $(find "$BREADNEWS" -path "$BREADNEWS/.git" -prune -o -type f -print | sort -nr); do
l "news: $art"
cat <<-ENDOFARTICLE
<div class="article" id="$(NN "$art")">
<div class="header">$(M title "$art"|wrapstr h1)
$(M date "$art"|wrapstr span class="time")
$(C "$art"|X|$DISCOUNT)
</div>
ENDOFARTICLE
done)

View File

@ -1,10 +0,0 @@
title recipes
$(mkdir "$UNKO/recipes")
<ul>
$(for r in /bread/cookbook/html/*; do
l "recipe: $r"
echo "<li><a href=\"/recipe/$(NN "$r")\">$(NN "$r")</a></li>"
done)
</ul>

41
L
View File

@ -1,41 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<!-- updated $(date) -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="a collaborative bread-positive space">
<title>$(M title|addstr ' | ')BREADPUNK</title>
<link rel="stylesheet" media="screen" type="text/css"
href="https://fontlibrary.org/face/cmu-typewriter" >
<link rel="stylesheet" type="text/css" href="/S/breadpunk.css" >
<link rel="icon" type="image/png" href="/S/breadpunk.png">
</head>
<body>
<div id="header">
<div class="nav">
$(cat header.txt)
$([ "$(N)" = index ] || {
cat <<-ENDHEADER
(#) <a href="/">home</a>
ENDHEADER
})
</div>
<marquee id="users">
$(./update-footer.awk footer.txt | sed 's/#.*//')
</marquee>
</div>
<div id="main">
<div class="header">
$(M title | wrapstr h1)
$(M subtitle | wrapstr p class=subtitle)
$(M author | wrapstr p class=author)
</div>
$(C|X|$DISCOUNT)
</div>
<div id="footer">
</div>
</body>
</html>
<!-- vim: ft=unk
-->

View File

@ -1,48 +0,0 @@
# breadpunk.club
DEBUG ?= false
BREADNEWS ?= /bread/news
BREADDOCS ?= /bread/docs
RSYNC_EXCLUDES := \
.well-known \
old \
node_modules \
wip
RSYNC := rsync \
--verbose \
--archive \
--compress \
--checksum \
--delete \
$(foreach e,$(RSYNC_EXCLUDES),--exclude=$(e))
SERVE ?= php -S 127.0.0.1:2733 -t O/
WATCH := I/* I/*/* \
unk lib.sh L *.txt \
$(BREADNEWS)/* $(BREADDOCS)/*
watch:
@echo entr -d -r $(MAKE) _serve
@while :; do\
(ls -d $(WATCH)) | \
entr -d -r $(MAKE) _serve;\
done
_serve: build
@pkill php||:
$(SERVE)
publish: build
$(RSYNC) O/ /var/www/breadpunk.club/
# push: publish
# @test -z "$$(git status --porcelain)" && \
# { echo "Pushing changes..."; MAKE_PUSH=1 git push; } || \
# echo "Commit changes!"
build:
DEBUG=$(DEBUG) BREADNEWS=$(BREADNEWS) BREADDOCS=$(BREADDOCS) ./unk
PHONY: build _serve publish watch

16
config.toml Normal file
View File

@ -0,0 +1,16 @@
# The URL the site will be built for
base_url = "https://breadpunk.club"
# Whether to automatically compile all Sass files in the sass directory
compile_sass = true
# Whether to build a search index to be used later on by a JavaScript library
build_search_index = false
[markdown]
# Whether to do syntax highlighting
# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola
highlight_code = false
[extra]
# Put all your custom variables here

View File

@ -1,5 +1,7 @@
title BREADPUNK
subtitle baking the net since 2020
+++
title = "BREADPUNK"
description = "baking the net since 2020"
+++
Hello, and welcome to **breadpunk.club**.
We are a shared Unix computer focused on bread:
@ -14,12 +16,8 @@ namely *anti-commoditization*,
*self-reliance*,
and *radical cooperation*.
$(for s in "$UNKI/index_sections"/*; do
cat <<-ENDSECTION
<div class="section" id="$(M id "$s")">
<div class="header">$(M title "$s" |wrapstr h1)$(M subtitle "$s" |wrapstr p class=subtitle)
</div>$(C "$s" | X | $DISCOUNT)
</div>
ENDSECTION
done
)
## join us!
if you like to bake, want to learn more about baking,
or just love bread, come [join us](/join)!
it's easy to apply for membership and we're looking forward to having you.

14
content/join.md Normal file
View File

@ -0,0 +1,14 @@
+++
title = "joining"
+++
breadpunk.club is open to anyone. it's suggested that you look at our
[manifesto](/docs/manifesto) and make sure it's something you're interested in,
as well as our [code of conduct](/docs/code-of-conduct) to make sure you agree
with our terms.
to become a baker, just send an email to [breadw](/~breadw) with your SSH key
(attached, please!), desired username (must be bread-oriented), realname (can
be your “normal” username), and what shell youd like to use.
well see you around the bakery!

View File

@ -0,0 +1,17 @@
+++
title = "We're baking!"
author = "breadw"
date = 2020-04-11
+++
Breadpunk is officially live!
We don't have a ton of services yet,
but if you [join us](/join)
you can come say hi on [IRC](/docs/irc),
build your own [web page](/docs/web),
[gopher hole](/docs/gopher),
[gemini constellation](/docs/gemini),
or [email](/docs/email) other bakers.
We're going to be adding other stuff soon,
so come on by!

View File

@ -0,0 +1,26 @@
+++
title = "Join us in Nomic!"
author = "breadw"
date = 2020-04-29
+++
We've been baking up a storm here at breadpunk.club,
and one of the things we've been working on is a game of
[nomic](//en.wikipedia.org/wiki/Nomic).
It's a game where the rules can change any time,
and in fact that's the point!
Check out
[~lucitoast's page on nomic](/~lucitoast/nomic/)
for more information.
When you're ready to join (if you're a baker already, that is),
make a pull request on the
[tildegit repo](//tildegit.org/breadpunk/nomic)
adding your name in the `players` folder.
We also discuss the game on our NNTP server
(oh, right, did you know we have an
[NNTP server](/docs/news/)? It's pretty cool)
at bread.nomic.
According to the first round of rules, a game can't start
til there are 5 players, so come join us!

View File

@ -0,0 +1,32 @@
+++
title = "We have Gemini User Capsules"
author = "breadw"
date = 2020-05-04
+++
Thanks to a new [gemini server](https://tildegit.org/solderpunk/molly-brown),
we have set up user capsules for everyone on breadpunk.club.
So if you point your
[favorite](https://git.sr.ht/~julienxx/castor)
[gemini](https://rawtext.club/~sloum/bombadillo.html)
[client](https://gemini.circumlunar.space/clients.html)
at <gemini://breadpunk.club/~breadw>,
for instance,
you'll see individual user pages.
You can also see a listing at <gemini://breadpunk.club>.
**What is Gemini?**
Gemini is a new texty protocol that sits somewhere between gopher and http.
Check it out at <https://gemini.circumlunar.space/>,
or of course <gemini://gemini.circumlunar.space>.
**For bakers**
You should have a user directory under `/var/gemini/bakers/`.
Feel free to drop your `*.gmi` files directly under there, or
symlink your directory to your `$HOME`.
The server *does* have CGI capabbilities,
but the admins haven't set any of that up yet.
If you'd like to take a crack at some dynamic Gemini content,
please contact one of them (`man 7 admins`).

View File

@ -0,0 +1,10 @@
+++
title = "Ubuntu 20.04.1 upgrade"
author = "lucitoast"
date = 2020-11-14
+++
We successfully did the first upgrade of breadpunk.club, to Ubuntu 20.04.1,
with a little bit of downtime.
Please report any broken stuff to either me (~lucitoast) or ~breadw!

View File

@ -0,0 +1,13 @@
+++
title = "Celebrating 40 bakers strong!"
author = "breadw"
date = 2021-01-30
+++
breadpunk.club just welcomed its <strong>FORTIETH</strong> baker tonight!
We've had a bit of an uptick in new registrations,
and there's a bunch of great content they've put together.
I'm just happy that this dumb website, started out of a joke on IRC,
is such a fun place for so many people.
Anyway, happy baking everyone! See you around!

View File

@ -0,0 +1,7 @@
+++
title = "Now accepting donations"
author = "breadw"
date = 2021-02-06
+++
Since breadpunk.club has grown a lot since its founding last year, I've created a new [/donate](/donate) page. Breadpunk is, and will always be, 100% free to use, but we're a cooperative bunch here. 100% of donations will fund the operations and hosting costs of breadpunk.club. Thanks!

5
content/news/_index.md Normal file
View File

@ -0,0 +1,5 @@
+++
title = "news"
sort_by = "date"
template = "river.html"
+++

View File

@ -1,7 +0,0 @@
title history
breadpunk.club was envisioned by some folx over at
[tilde.town](https://tilde.town) as a new tilde server,
where we could talk about bread all day.
for more information, see our [manifesto](/manifesto/).

View File

@ -1,5 +0,0 @@
4 # USERS_TOTAL
bakers
/
9 # USERS_CURRENT
baking now

View File

@ -1,5 +0,0 @@
<ul>
<li><a href="/news">news</a></li>
<li><a href="/join">join</a></li>
<li><a href="/docs">docs</a></li>
</ul>

125
lib.sh
View File

@ -1,125 +0,0 @@
# UNKLIB
# convenience functions
#shellcheck disable=2034
DISCOUNT="markdown -f links,image,pants,html,autolink,fencedcode"
alias p=echo
alias l='p >&2'
N(){ f="${1:-$F}";n="${f#$UNKI/}";p "${n%.*}";}
NN(){ f="${1:-$F}";n="${f##*/}";p "${n%%.*}";}
N_(){ f="${1:-$F}";n="$(N "$f")";p "${n#_}";}
M(){ sed '/^$/q' "${2:-$F}"|grep "^$1"|cut -f2-;}
C(){ sed '1,/^$/d' "${1:-$F}";}
X(){
Xd=$((Xd+1));
eval "$(p "set -e";p "cat<<$UNKZ$Xd";cat "${1:--}"|sed 's/`/\\`/g';p;p "$UNKZ$Xd")";
}
modmsg()
{ # message as to when a page was modified
date -d "$1" \
+'this page was updated on <time datetime="%F">'"${2:-%e %B %Y}"'</time>'
}
series()
{
in="$(cat)"
s="$*"
if [ -n "$in" ]; then
s="$s $in"
fi
if [ -z "$s" ]; then
return
fi
tx "part of the $s series"
}
wrapstr()
{ # wrap a non-empty string
sed -e "s_^._<$*>&_" -e "s_.\$_&</$1>_"
}
addstr()
{ # add a string after, but not after an empty string
sed "s/^.\+\$/&$*/"
}
defstr()
{ # replace an empty string with a default
sed "s/^\$/$*/"
}
slugify()
{ # turn a string into a slug
if [ "$#" -gt 0 ]; then
echo "$*"
else
cat
fi |
tr '[:upper:]' '[:lower:]' |
sed \
-e 's/[[:punct:]]//g' \
-e 's/[^[:alnum:]_]/-/g' \
-e 's/-+/-/g' \
-e 's/^-//' -e 's/-$//'
}
recent_files()
{ # list files
# WARNING: find -printf is NOT posix :(
dir="$1"
shift
find "$dir" -maxdepth 1 \
-not -name '.*' "$@" \
-printf '%T@\t%p\n' \
| sort -nr \
| cut -f2
}
maybe_expand()
{ # expand a file based on its metadata (or lack thereof)
F="${1:-$F}"
expand="$(M expand "$F")"
if [ -z "$expand" ] || "$expand"; then
C "$F" | ./lht | X
else
C "$F"
fi
}
#shellcheck disable=2120
build()
{ # X on a file
F="${1:-$F}"
[ -f "$F" ] || return 1
l "$F"
dir="$UNKO/$(N)"
rm -rf "$dir"
mkdir -p "$dir"
X "$UNKL" > "$dir/index.html"
}
build_dir()
{ # build a directory
for F in "$UNKI/$1"/*; do
build || l "$F: not a file"
done
}
listing()
{ # print a listing
p "<ul class='listing'>"
for F in $(recent_files "$UNKI/$1" -type f); do
build && {
p "<li><a href='/$(N)/'>$(M title)</a>"
if [ -n "$(M series)" ]; then
p "<span class='series desc'>$(series "$(M series)")</span>"
fi
p "</li>"
}
done
p "</ul>"
}

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

1
public/breadpunk.css Normal file
View File

@ -0,0 +1 @@
*{position:relative}body,html{width:100%;margin:0;padding:0;font:18px/1.3 CMUTypewriterTextRegular, monospace;background-color:wheat;background:url("/bread.png") repeat}#main{max-width:40em;padding:1em;margin:auto;background:white}#footer{margin-top:1em;text-align:center}#header,#footer{background:white;width:100%}#header{margin-bottom:1em}#header .nav{z-index:100;background:white;padding-right:1em}#header *{margin:0;padding:0;display:inline}.nav li:after{content:" (#) "}.subtitle{font-style:italic}pre,code{font:14px/1.1 monospace;background:#ddd}#users{text-align:right;position:absolute;right:0}

View File

Before

Width:  |  Height:  |  Size: 759 B

After

Width:  |  Height:  |  Size: 759 B

View File

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 318 B

1
sass/.#breadpunk.css Symbolic link
View File

@ -0,0 +1 @@
acdw@larry.114172:1636293848

View File

@ -6,7 +6,7 @@ html {
padding: 0;
font: 18px/1.3 CMUTypewriterTextRegular, monospace;
background-color: wheat;
background: url("/S/bread.png") repeat;
background: url("/bread.png") repeat;
}
#main {
max-width: 40em;

BIN
static/bread.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
static/breadpunk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

BIN
static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

1
templates/.#river.html Symbolic link
View File

@ -0,0 +1 @@
acdw@larry.114172:1636293848

66
templates/base.html Normal file
View File

@ -0,0 +1,66 @@
{% block doctype -%}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
{%- endblock doctype %}
<html lang="en">
<head>
{% block head -%}
{% block head_meta -%}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description"
content="{%- block desc -%}
{{ config.description }}
{%- endblock desc -%}">
{%- endblock head_meta %}
<title>{% block title %}{% endblock title %}</title>
{% block head_links -%}
<link rel="stylesheet" media="screen" type="text/css"
href="https://fontlibrary.org/face/cmu-typewriter" >
<link rel="stylesheet" type="text/css" href="/breadpunk.css" >
<link rel="icon" type="image/png" href="/breadpunk.png">
{%- endblock head_links %}
{%- endblock head %}
</head>
<body>
{% block body -%}
<div id="header">
{% block header -%}
<div class="nav">
{% block sitenav -%}
<ul>
<li><a href="/">breadpunk</a></li>
<li><a href="/join">join</a></li>
<li><a href="/news">news</a></li>
<li><a href="/docs">docs</a></li>
</ul>
{%- endblock sitenav %}
</div>
{% block users %}<marquee id="users"></marquee>{% endblock users %}
{%- endblock header -%}
</div>
<div id="main">
{%- block main -%}
<div class="header">
{%- block main_header %}
<h1>
{%- if page.title -%}{{ page.title }}
{%- elif section.title -%}{{ section.title }}
{%- endif -%}
</h1>
{%- if page.description -%}
<p class="subtitle">{{ page.description }}</p>
{%- elif section.description -%}
<p class="subtitle">{{ section.description }}</p>
{%- endif -%}
{%- endblock main_header -%}
</div>
{%- block main_content %}{% endblock main_content -%}
{%- endblock main -%}
</div>
<div id="footer">
{%- block footer -%}
{%- endblock footer -%}
</div>
{%- endblock body %}
</body>
</html>

5
templates/index.html Normal file
View File

@ -0,0 +1,5 @@
{% extends "base.html" %}
{% block title %}BREADPUNK{% endblock title %}
{% block main_content %}
{{ section.content | safe }}
{% endblock main_content %}

5
templates/page.html Normal file
View File

@ -0,0 +1,5 @@
{% extends "base.html" %}
{% block title %}{{ page.title }}{% endblock title %}
{% block main_content %}
{{ page.content | safe }}
{% endblock main_content %}

18
templates/river.html Normal file
View File

@ -0,0 +1,18 @@
{% extends "section.html" %}
{% block section_listing %}
{% for page in section.pages %}
<div class="article">
<div class="header">
<h2>
<a href="{{ page.permalink }}">{{ page.title }}</a>
</h2>
<p class="date">
<span class="time">
{{ page.date }}
</span>
</p>
</div>
{{ page.content | safe }}
</div>
{% endfor %}
{% endblock section_listing %}

17
templates/section.html Normal file
View File

@ -0,0 +1,17 @@
{% extends "index.html" %}
{% block title %}{{ section.title }}{% endblock title %}
{% block main_content %}
<div class="section_header">
{%- block section_header -%}
{{ section.content }}
{%- endblock section_header -%}
</div>
{% block section_listing -%}
<ul id="section_listing">
{% for page in section.pages -%}
<li><a href="{{ page.permalink }}">{{ page.title }}</a></li>
{%- endfor %}
</ul>
{%- endblock section_listing %}
{% endblock main_content %}

54
unk
View File

@ -1,54 +0,0 @@
#!/bin/sh
"$DEBUG" && set -x
set -e
: "${UNKZ:=Z}"
: "${UNKI:=I}"
: "${UNKO:=O}"
: "${UNKL:=L}"
: "${UNKS:=$UNKI/S}"
. ./lib.sh
rm -rf "$UNKO"
mkdir "$UNKO"
cp -r "$UNKS" "$UNKO"||:
# shellcheck disable=2016
[ -f "$UNKL" ]||p '$(X "$F")'>"$UNKL"
for F in "$UNKI"/*
do [ -d "$F" ] && continue
l "$F"
fo="index"
case "$F" in
*.md)
fo="${fo}.html"
;;
*)
fo="${fo}.${F##*.}"
;;
esac
n="$(N)"
d="$UNKO"
case "$n" in
index)
;;
_*)
n="${n#_}"
d="$UNKO/$n"
;;
*)
d="$UNKO/$n"
;;
esac
mkdir -p "$d"
X "$UNKL" > "$d/$fo"
done
#X "$UNKF" > "$UNKO/atom.xml"
l "Building DP"
X Dp > "$UNKO/tilde.json"

View File

@ -1,10 +0,0 @@
#!/usr/bin/awk -f
/USERS_TOTAL/ {
"ls /home|wc -l" | getline $1;
}
/USERS_CURRENT/ {
"users|tr ' ' '\n'|sort -u|wc -l" | getline $1;
}
{ print; }