initial commit

This commit is contained in:
dogeystamp 2023-05-14 13:20:25 -04:00
commit 053968724f
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
18 changed files with 588 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
build/

16
Makefile Normal file
View File

@ -0,0 +1,16 @@
build:
./barf
rsync -r public/ build/public
deploy: build
rsync -r build/ ${OUTPUT}
clean:
rm -rf build/*
watch:
while true; do \
ls -d .git/* * posts/* pages/* header.html | entr -cd make ;\
done
.PHONY: build deploy clean watch

40
README.md Normal file
View File

@ -0,0 +1,40 @@
# wb5
5th iteration of the dogeystamp personal website, based on [barf](https://barf.bt.ht).
The following is an abridged version of the original README.
## Requirements
- rsync
- lowdown (other markdown parsers are good too)
- entr (optonal, for `make watch`)
- standard UNIX tools
---
## Basic Setup
```sh
make build
```
Blog content will be in the `build` directory.
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.

124
barf Executable file
View File

@ -0,0 +1,124 @@
#!/bin/sh
# 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.
set -eu
MARKDOWN=lowdown
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
# Posts
while read -r f title created; do
link=$(echo "$f" | sed -E 's|.*/(.*).md|\1/|')
created=$(echo $(head -3 "$f" | tail -1))
echo "<span class='created'>$created &mdash; <a href=\"$link\">$title</a></span>"
done < "$1" | sort -r
# Print footer after post list
cat footer.html
}
atom_xml() {
uri=$(sed -rn '/atom.xml/ s/.*href="([^"]*)".*/\1/ p' header.html)
domain=$(echo "$uri" | sed 's/atom.xml//g' | sed 's|/[^/]*$||')
first_commit_date=$(git log --pretty='format:%ai' . | cut -d ' ' -f1 | tail -1)
cat <<EOF
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>$(sed -n '/^# /{s/# //p; q}' index.md)</title>
<link href="$domain/atom.xml" rel="self" />
<updated>$(date +%FT%TZ)</updated>
<author>
<name>$(git config user.name)</name>
</author>
<id>$domain,$first_commit_date:default-atom-feed/</id>
EOF
while read -r f title created; do
content=$($MARKDOWN "$f" | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/"/\&quot;/g; s/'"'"'/\&#39;/g')
post_link=$(echo "$f" | sed -E 's|posts/(.*).md|\1|')
basic_date=$(echo $(head -3 "$f" | tail -1))
published_date=$(date -d $basic_date -u +%Y-%m-%dT10:%M:%SZ)
cat <<EOF
<entry>
<title>$title</title>
<content type="html">$content</content>
<link href="$domain/$post_link"/>
<id>$domain/$post_link</id>
<updated>$published_date</updated>
<published>$published_date</published>
</entry>
EOF
done < "$1"
echo '</feed>'
}
write_page() {
filename=$1
directory=$(echo $(basename "$filename" .md))
$(mkdir -p build/$directory)
target=$(echo "$filename" | sed -r 's|\w+/(.*).md|build/\1/index.html|')
created=$(echo $(head -3 "$filename" | tail -1))
title=$2
$MARKDOWN "$filename" | \
cat header.html - |\
sed "s|{{TITLE}}|$title|" \
> "$target" && cat footer.html >> "$target"
}
rm -fr build && mkdir build
# Blog posts
index_tsv posts | sort -rt " " -k 3 > build/posts.tsv
index_html build/posts.tsv > build/index.html
atom_xml build/posts.tsv > build/atom.xml
while read -r f title created; do
write_page "$f" "$title" "$created"
done < build/posts.tsv
# Pages
index_tsv pages > build/pages.tsv
while read -r f title created; do
write_page "$f" "$title" "$created"
done < build/pages.tsv

6
footer.html Normal file
View File

@ -0,0 +1,6 @@
<footer role="contentinfo">
<span><a href="#">↑ Back to Top</a></span><br><br>
<small>
Built with <a href="https://git.sr.ht/~bt/barf">barf</a>. <br>
</small>
</footer>

37
header.html Normal file
View File

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/svg" href="/public/favicon.svg">
<title>{{TITLE}}</title>
<link href="https://www.dogeystamp.com/atom.xml" type="application/atom+xml" rel="alternate" title="Atom feed for blog posts" />
<meta name="description" content="dogeystamp's personal website">
<meta name="author" content="dogeystamp">
<style>
@font-face
{
font-family: JetBrainsMono;
src: url(/public/fonts/JetBrainsMono-Regular.ttf);
}
@font-face
{
font-family: JetBrainsMono;
src: url(/public/fonts/JetBrainsMono-Bold.ttf);
font-weight: bold;
}
</style>
<link rel="stylesheet" href="/public/css/style.css">
</head>
<div class="header">
<img src="/public/img/logo.svg" class="logo">
<b>dogeystamp</b>
<a href="/index.html">home</a>
<a href="/about">about me</a>
</div>
<article>

12
index.md Normal file
View File

@ -0,0 +1,12 @@
# welcome to my website!
This is a place where I host some services and a blog.
For more info about me, including contact info, check out [my about page.](/about)
## services
### [gitea](https://git.dogeystamp.com)
Local git server, along with frontend. This hosts the majority of the projects I have done in the past.
## blog articles

96
pages/about.md Normal file
View File

@ -0,0 +1,96 @@
# about me
**Hi! I'm dogeystamp.** I'm a Canadian high school student with an interest in tech and libre software.
## what i do
### competitive programming
I participate in some programming contests like the University of Waterloo's [CCC.](https://cemc.uwaterloo.ca/contests/computing.html)
In 2021's contest, I got a score of 48/75 in the senior division. [Here's](https://github.com/dogeystamp/waterlooccc) a repo with my solutions.
### projects
In my free time I do programming projects, some of which have have full articles in my blog.
#### [minrss](/minrss)
This is a minimal RSS/Atom feed reader I made using C. It relies mostly on libcurl for multi-threaded downloads of RSS feeds, and libxml2 for XML parsing.
The main feature of this program is that it represents feeds as folders with
articles as files within them.
```
rss
|--news
| |--article1
| `--article2
`--blog
|--post
`--other_post
```
As such, external scripts - or even a plain shell - can be easily used to read feeds with minrss.
This is similar to suckless.org's programs
[ii](http://tools.suckless.org/ii/) and [sic](http://tools.suckless.org/sic/).
#### [encryptme](https://github.com/dogeystamp/encryptme)
Encryptme is a web app that provides cryptography tools.
It aims to be simple and not clutter the interface,
but it still exposes advanced options if desired.
Instead of using an established front-end framework, it's based on a module I
wrote from scratch in JavaScript for creating interfaces.
#### [bitmask](https://github.com/dogeystamp/bitmask)
This is a Python library I made that helps with manipulating bits.
It uses an object-oriented process to deal with bitmasks,
which makes it simple and easy to use in a language like Python.
Example of some common operations (excerpt from the README):
```
marble = Bitmask(Desc.SMALL, Desc.ROUND, Desc.FUNKY)
Desc.SMALL in marble
>>> True
Desc.LARGE in marble
>>> False
Bitmask(Desc.SMALL, Desc.ROUND) in marble
>>> True
```
### art
Some Blender renders I made for fun:
![](/public/img/golde3-thumb.jpg)
![](/public/img/uwsnb-thumb.jpg)
## contact information
* **matrix:** @dogey:d.nerdpol.ovh
* **discord:** dogeystamp#4056
* **email:** dogeystamp[at]disroot.org
#### pgp key:
```
----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEAAAAABYJKwYBBAHaRw8BAQdAVq8Ixy8Upy2YrLEsVLXsbhK2qByl9tJJ07+g
mWqV/Wi0I2RvZ2V5c3RhbXAgPGRvZ2V5c3RhbXBAZGlzcm9vdC5vcmc+iGQEExYI
ABYFAgAAAAAJEHIl/jWS7/o4AhsDAh4BAACXAwD7BeO35GkDfR0/SQXZVE71aBaw
9zNVktGQTHOC+nYuFBYA/Rj2I5mkQg795p659fINKPA2u8NAW2WBWVdLJk+IHl8J
uDgEAAAAABIKKwYBBAGXVQEFAQEHQEgwybssSWkt0m7Ra+iOfipdOYldd2iX1dRj
3ATZum54AwEICYhhBBgWCAATBQIAAAAACRByJf41ku/6OAIbDAAA1bgBAPMTiHMK
d+71o6KSGYRLdb/16tzkdFc2ymHuWp6gmJmUAQDJhHUmj4wJLGI9N++79vXqGs1l
rixgx6WY32pgpumzCw==
=PGFl
-----END PGP PUBLIC KEY BLOCK-----
```

11
pages/priv.md Normal file
View File

@ -0,0 +1,11 @@
# private services
Other than the services listed on the index page, here are some reserved for friends only.
### [rockwell wiki](https://wiki.dogeystamp.com/rw/)
Rockwell Mansion canon wiki
### [bepp wiki](https://wiki.dogeystamp.com/bepp/)
Bepp satire wiki

145
public/css/style.css Normal file
View File

@ -0,0 +1,145 @@
body {
font-family: JetBrainsMono, sans-serif;
width: 85vmin;
margin: auto;
background: #101010;
color: #ffffff;
font-size: 125%;
}
::-webkit-scrollbar {
width: 1vmin;
height: 1vmin;
}
::-webkit-scrollbar-track {
background-color: #050505;
}
::-webkit-scrollbar-thumb {
background-color: #151515;
}
.header {
margin-top: 5%;
}
.header b {
font-size: 175%;
margin-right: 2%;
}
.header a {
margin-right: 1%;
}
* {
box-sizing: border-box;
}
hr {
background-color: grey;
border: 0;
height: 1px;
margin: 2rem 0;
}
nav {
margin: 2rem 0 0;
}
main {
hyphens: auto;
}
main p {
margin: 1rem;
}
h1,h2,h3,h4 {
margin: 2rem 0 0;
}
p {
margin-left: 1rem;
}
h2 {
margin-left: 0.25rem;
}
h3 {
margin-left: 0.6rem;
}
h4 {
margin-left: 0.75rem;
}
h1 {
margin-bottom: 0.5rem;
}
span.created {
display: block;
margin: 4px 15px;
}
img {
border: 1px solid lightgrey;
height: auto;
max-width: 100%;
width: auto;
}
.logo {
border: none;
max-width: 5vh;
position: relative;
top: 1.5vh;
}
blockquote {
border: 1px solid;
border-left: 6px solid;
margin: 2rem 0;
padding: 10px;
}
blockquote p {
margin: 0;
}
figure {
margin: 2rem 0;
}
figcaption {
color: slategrey;
}
code {
border: 1px solid;
padding: 0.1rem 0.3rem;
tab-size: 4;
}
pre {
border: 1px solid;
}
pre code {
border: 0;
display: block;
overflow-x: auto;
padding: 0.3rem 0.6rem;
}
table {
border-collapse: collapse;
margin: 2rem 0;
text-align: left;
width: 100%;
}
tr {
border-bottom: 1px solid lightgrey;
}
tr:nth-of-type(odd) td {
background-color: #f8f8f8;
}
th,td {
padding: 6px;
}
footer {
border-top: 1px dashed grey;
margin: 2rem 0;
padding: 1rem 15px;
}
a {
display: inline;
color: #aaaaaa;
}

50
public/favicon.svg Normal file
View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="189.17741mm"
height="198.08646mm"
viewBox="0 0 189.17741 198.08646"
version="1.1"
id="svg991"
inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)"
sodipodi:docname="logo.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview993"
pagecolor="#505050"
bordercolor="#ffffff"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.76078844"
inkscape:cx="236.59665"
inkscape:cy="417.98742"
inkscape:window-width="2460"
inkscape:window-height="1340"
inkscape:window-x="50"
inkscape:window-y="50"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs988" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-42.782484,47.224729)">
<path
id="path922"
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:3.51033;stroke-linejoin:round;stroke-dashoffset:73.3228;stop-color:#000000"
inkscape:transform-center-x="0.63497657"
inkscape:transform-center-y="-0.64853615"
d="m 137.40639,-47.224729 -12.76314,18.822753 -17.9685,-13.986433 -6.29832,21.830481 -21.4288,-7.772399 0.783116,22.7005102 -22.791543,-0.796333 7.788506,21.3478768 -21.923128,6.257019 14.030308,17.906666 -0.04265,0.02866 h 28.048289 c -0.07297,-1.238806 -0.223739,-2.679688 -0.446026,-4.457604 -0.551286,-4.409341 -1.026247,-8.890135 -1.054946,-9.956679 -0.02871,-1.066553 -0.322748,-6.197144 -0.654652,-11.401432 -0.618404,-9.6966148 0.342357,-13.69904583 4.175588,-17.3887428 3.66112,-3.524001 7.481597,-2.0816 17.945888,6.773918 6.40918,5.423851 10.76864,8.3657418 12.39522,8.3655538 7.81476,-9.9e-4 26.15732,-1.6149178 28.55648,-2.5128378 3.02912,-1.133666 8.99,-7.75317403 12.83919,-14.25819 1.87368,-3.166465 3.71431,-4.7759822 5.38572,-4.7539222 0.65405,0.0086 1.28188,0.267307 1.87609,0.7799532 0.76673,0.661476 1.58018,5.548096 1.88689,11.335411 0.63887,12.0564848 1.91761,14.1292208 11.24931,18.2367658 3.43355,1.511343 7.37373,3.856128 8.7561,5.209918 1.89218,1.853056 4.36385,7.416984 6.60715,14.027888 h 23.5798 l 14.02157,-17.868285 -21.9185,-6.272885 7.80341,-21.3422448 -22.79206,0.779952 0.79957,-22.6994842 -21.43498,7.756536 -6.28239,-21.834063 -17.97878,13.973637 z m -80.63676,111.79115 -13.987146,17.82479 21.919018,6.27288 -7.803923,21.342239 22.792574,-0.78046 -0.799562,22.69949 21.434449,-7.75654 6.28292,21.83458 17.97877,-13.97415 12.74927,18.83248 12.76365,-18.82327 17.9685,13.98643 6.29832,-21.82996 21.4288,7.77137 -0.78363,-22.69948 22.79155,0.79632 -7.78799,-21.348379 21.92312,-6.25702 -14.019,-17.89132 h -17.74549 c 0.0258,0.50616 0.0422,0.99503 0.038,1.44323 -0.0567,6.09202 -2.03525,15.17222 -4.38524,20.12574 -1.94708,4.10423 -8.10069,11.87094 -10.95541,13.82778 -5.55636,3.808739 -14.69088,7.956419 -20.02494,9.092279 -8.28314,1.76387 -27.08721,1.52179 -35.86608,-0.46163 C 104.75215,103.11994 96.885633,97.668001 89.606989,81.306741 87.51109,76.595491 85.166723,69.731601 83.833306,64.566421 Z"
sodipodi:nodetypes="ccccccccccccssscscsscscssccccccccccccccccccccccccccccccccssssscc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Binary file not shown.

BIN
public/img/golde3-thumb.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 KiB

BIN
public/img/golde3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 MiB

50
public/img/logo.svg Normal file
View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="189.17741mm"
height="198.08646mm"
viewBox="0 0 189.17741 198.08646"
version="1.1"
id="svg991"
inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)"
sodipodi:docname="logo.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview993"
pagecolor="#505050"
bordercolor="#ffffff"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.76078844"
inkscape:cx="236.59665"
inkscape:cy="417.98742"
inkscape:window-width="2460"
inkscape:window-height="1340"
inkscape:window-x="50"
inkscape:window-y="50"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs988" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-42.782484,47.224729)">
<path
id="path922"
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:3.51033;stroke-linejoin:round;stroke-dashoffset:73.3228;stop-color:#000000"
inkscape:transform-center-x="0.63497657"
inkscape:transform-center-y="-0.64853615"
d="m 137.40639,-47.224729 -12.76314,18.822753 -17.9685,-13.986433 -6.29832,21.830481 -21.4288,-7.772399 0.783116,22.7005102 -22.791543,-0.796333 7.788506,21.3478768 -21.923128,6.257019 14.030308,17.906666 -0.04265,0.02866 h 28.048289 c -0.07297,-1.238806 -0.223739,-2.679688 -0.446026,-4.457604 -0.551286,-4.409341 -1.026247,-8.890135 -1.054946,-9.956679 -0.02871,-1.066553 -0.322748,-6.197144 -0.654652,-11.401432 -0.618404,-9.6966148 0.342357,-13.69904583 4.175588,-17.3887428 3.66112,-3.524001 7.481597,-2.0816 17.945888,6.773918 6.40918,5.423851 10.76864,8.3657418 12.39522,8.3655538 7.81476,-9.9e-4 26.15732,-1.6149178 28.55648,-2.5128378 3.02912,-1.133666 8.99,-7.75317403 12.83919,-14.25819 1.87368,-3.166465 3.71431,-4.7759822 5.38572,-4.7539222 0.65405,0.0086 1.28188,0.267307 1.87609,0.7799532 0.76673,0.661476 1.58018,5.548096 1.88689,11.335411 0.63887,12.0564848 1.91761,14.1292208 11.24931,18.2367658 3.43355,1.511343 7.37373,3.856128 8.7561,5.209918 1.89218,1.853056 4.36385,7.416984 6.60715,14.027888 h 23.5798 l 14.02157,-17.868285 -21.9185,-6.272885 7.80341,-21.3422448 -22.79206,0.779952 0.79957,-22.6994842 -21.43498,7.756536 -6.28239,-21.834063 -17.97878,13.973637 z m -80.63676,111.79115 -13.987146,17.82479 21.919018,6.27288 -7.803923,21.342239 22.792574,-0.78046 -0.799562,22.69949 21.434449,-7.75654 6.28292,21.83458 17.97877,-13.97415 12.74927,18.83248 12.76365,-18.82327 17.9685,13.98643 6.29832,-21.82996 21.4288,7.77137 -0.78363,-22.69948 22.79155,0.79632 -7.78799,-21.348379 21.92312,-6.25702 -14.019,-17.89132 h -17.74549 c 0.0258,0.50616 0.0422,0.99503 0.038,1.44323 -0.0567,6.09202 -2.03525,15.17222 -4.38524,20.12574 -1.94708,4.10423 -8.10069,11.87094 -10.95541,13.82778 -5.55636,3.808739 -14.69088,7.956419 -20.02494,9.092279 -8.28314,1.76387 -27.08721,1.52179 -35.86608,-0.46163 C 104.75215,103.11994 96.885633,97.668001 89.606989,81.306741 87.51109,76.595491 85.166723,69.731601 83.833306,64.566421 Z"
sodipodi:nodetypes="ccccccccccccssscscsscscssccccccccccccccccccccccccccccccccssssscc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
public/img/uwsnb-thumb.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

BIN
public/img/uwsnb.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 MiB