commit 053968724f6fbad2611885da7d263b367579997e Author: dogeystamp Date: Sun May 14 13:20:25 2023 -0400 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..567609b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ffbc24a --- /dev/null +++ b/Makefile @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..c7d0d84 --- /dev/null +++ b/README.md @@ -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. diff --git a/barf b/barf new file mode 100755 index 0000000..d0e7f5d --- /dev/null +++ b/barf @@ -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 "$created — $title" + 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 < + + $(sed -n '/^# /{s/# //p; q}' index.md) + + $(date +%FT%TZ) + + $(git config user.name) + + $domain,$first_commit_date:default-atom-feed/ +EOF + + while read -r f title created; do + + content=$($MARKDOWN "$f" | sed 's/&/\&/g; s//\>/g; s/"/\"/g; s/'"'"'/\'/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 < + $title + $content + + $domain/$post_link + $published_date + $published_date + +EOF + done < "$1" + + echo '' +} + +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 diff --git a/footer.html b/footer.html new file mode 100644 index 0000000..2c2a67e --- /dev/null +++ b/footer.html @@ -0,0 +1,6 @@ + diff --git a/header.html b/header.html new file mode 100644 index 0000000..d15d465 --- /dev/null +++ b/header.html @@ -0,0 +1,37 @@ + + + + + + + + {{TITLE}} + + + + + + + + +
+ + dogeystamp + home + about me +
+ +
diff --git a/index.md b/index.md new file mode 100644 index 0000000..5d8a4c3 --- /dev/null +++ b/index.md @@ -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 diff --git a/pages/about.md b/pages/about.md new file mode 100644 index 0000000..1bbdd78 --- /dev/null +++ b/pages/about.md @@ -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----- +``` diff --git a/pages/priv.md b/pages/priv.md new file mode 100644 index 0000000..b474d74 --- /dev/null +++ b/pages/priv.md @@ -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 diff --git a/public/css/style.css b/public/css/style.css new file mode 100644 index 0000000..ca60755 --- /dev/null +++ b/public/css/style.css @@ -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; +} + diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 0000000..02e77de --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1,50 @@ + + + + + + + + + + diff --git a/public/fonts/JetBrainsMono-Bold.ttf b/public/fonts/JetBrainsMono-Bold.ttf new file mode 100644 index 0000000..0a92809 Binary files /dev/null and b/public/fonts/JetBrainsMono-Bold.ttf differ diff --git a/public/fonts/JetBrainsMono-Regular.ttf b/public/fonts/JetBrainsMono-Regular.ttf new file mode 100644 index 0000000..8da8aa4 Binary files /dev/null and b/public/fonts/JetBrainsMono-Regular.ttf differ diff --git a/public/img/golde3-thumb.jpg b/public/img/golde3-thumb.jpg new file mode 100644 index 0000000..448cc59 Binary files /dev/null and b/public/img/golde3-thumb.jpg differ diff --git a/public/img/golde3.jpg b/public/img/golde3.jpg new file mode 100644 index 0000000..2f25595 Binary files /dev/null and b/public/img/golde3.jpg differ diff --git a/public/img/logo.svg b/public/img/logo.svg new file mode 100644 index 0000000..02e77de --- /dev/null +++ b/public/img/logo.svg @@ -0,0 +1,50 @@ + + + + + + + + + + diff --git a/public/img/uwsnb-thumb.jpg b/public/img/uwsnb-thumb.jpg new file mode 100644 index 0000000..029dbff Binary files /dev/null and b/public/img/uwsnb-thumb.jpg differ diff --git a/public/img/uwsnb.jpg b/public/img/uwsnb.jpg new file mode 100644 index 0000000..e569e90 Binary files /dev/null and b/public/img/uwsnb.jpg differ