From b4fdc3017b9c05734b92151d7aa2e0353682fc09 Mon Sep 17 00:00:00 2001 From: "Jakob L. Kreuze" Date: Sat, 20 Jul 2019 17:07:39 -0400 Subject: Stage everything. Bleh, I'll commit to a clean history from now on --- .gitignore | 3 + haunt/data/blogroll.scm | 1008 ++++++++++++++------------------ haunt/data/bookmarks.scm | 203 +++---- haunt/data/replies.scm | 4 + haunt/haunt.scm | 2 + haunt/jakob/builder/blog.scm | 91 +-- haunt/jakob/builder/outbox.scm | 150 ++++- haunt/jakob/builder/static-pages.scm | 4 +- haunt/jakob/theme.scm | 6 +- haunt/jakob/utils/pagination.scm | 103 ++++ haunt/jakob/utils/sxml.scm | 11 +- haunt/pages/about.sxml | 22 +- haunt/pages/weblabels.sxml | 30 + haunt/reload.py | 14 + haunt/static/css/style.css | 43 +- haunt/static/image/profile-picture.jpg | Bin 0 -> 69228 bytes haunt/static/js/webmention.js | 140 +++++ 17 files changed, 1021 insertions(+), 813 deletions(-) create mode 100644 haunt/data/replies.scm create mode 100644 haunt/jakob/utils/pagination.scm create mode 100644 haunt/pages/weblabels.sxml create mode 100644 haunt/reload.py create mode 100644 haunt/static/image/profile-picture.jpg create mode 100644 haunt/static/js/webmention.js diff --git a/.gitignore b/.gitignore index 5575a94..24e97f0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ /haunt/posts/ /haunt/site/ +/haunt/.venv/ + +/haunt-old/ diff --git a/haunt/data/blogroll.scm b/haunt/data/blogroll.scm index e7a3d2e..e51f059 100644 --- a/haunt/data/blogroll.scm +++ b/haunt/data/blogroll.scm @@ -1,866 +1,706 @@ '(("Adam Sawicki" "http://asawicki.info/" - (c++ - game-development - graphics - programming - video-games - windows)) + ("c++" + "game-development" + "graphics" + "programming" + "video-games" + "windows")) ("Bit Cannon" "http://bitcannon.net/" - (linux - rust - programming)) + ("linux" "rust" "programming")) ("(proclaim λ)" "http://blog.macrolet.net/" - (common-lisp - functional-programming - hardware - lisp - programming)) + ("common-lisp" + "functional-programming" + "hardware" + "lisp" + "programming")) ("Brads Blog" "http://bradhodge.ca/blog/" - (hardware - retro-tech)) + ("hardware" "retro-tech")) ("Charlie the Ninja" "http://charliethe.ninja/" - (bsd - c - game-development - graphics - programming - video-games - x86)) + ("bsd" + "c" + "game-development" + "graphics" + "programming" + "video-games" + "x86")) ("DSASMBLR" "http://dsasmblr.com/" - (game-hacking - reversing - security - video-games)) + ("game-hacking" + "reversing" + "security" + "video-games")) ("Emacs Horrors" "http://emacshorrors.com/" - (emacs - emacs-lisp - lisp - programming)) + ("emacs" "emacs-lisp" "lisp" "programming")) ("Emacs Ninja" "http://emacsninja.com/" - (emacs - emacs-lisp - lisp - programming)) + ("emacs" "emacs-lisp" "lisp" "programming")) ("Fabien Sanglard" "http://fabiensanglard.net/" - (c - c++ - game-development - graphics - hardware - programming - video-games)) + ("c" + "c++" + "game-development" + "graphics" + "hardware" + "programming" + "video-games")) ("faehnri.ch" "http://faehnri.ch/" - (c - c++ - game-hacking - reversing - video-games)) + ("c" + "c++" + "game-hacking" + "reversing" + "video-games")) ("gynvael.coldwind//vx.log" "https://gynvael.coldwind.pl/?blog=1&lang=en" - (capture-the-flag - game-development - programming - reversing - security - video-games)) + ("capture-the-flag" + "game-development" + "programming" + "reversing" + "security" + "video-games")) ("Michael Nielsen" "http://michaelnielsen.org/blog/" - (cogsci - math - practices - programming)) + ("cogsci" "math" "practices" "programming")) ("steve losh" "http://stevelosh.com/blog/" - (clojure - common-lisp - game-development - lisp - programming - video-games)) + ("clojure" + "common-lisp" + "game-development" + "lisp" + "programming" + "video-games")) ("jooru//vx tech blog" "http://j00ru.vexillium.org/" - (binary-exploitation - malware - operating-systems - reversing - security - windows)) + ("binary-exploitation" + "malware" + "operating-systems" + "reversing" + "security" + "windows")) ("Bob Nystrom" "http://journal.stuffwithstuff.com/" - (game-development - programming - video-games)) + ("game-development" "programming" "video-games")) ("Lambda the Ultimate" "http://lambda-the-ultimate.org/" - (functional-programming - lisp - programming - scheme)) + ("functional-programming" + "lisp" + "programming" + "scheme")) ("Zach Beane Common Lisp" "http://lispblog.xach.com/" - (common-lisp - lisp - programming)) + ("common-lisp" "lisp" "programming")) ("meh." "http://meh.schizofreni.co/" - (c - linux - programming - rust)) + ("c" "linux" "programming" "rust")) ("null program" "http://nullprogram.com/" - (bsd - c - c++ - emacs - emacs-lisp - graphics - linux - lisp - programming - python - x86)) + ("bsd" + "c" + "c++" + "emacs" + "emacs-lisp" + "graphics" + "linux" + "lisp" + "programming" + "python" + "x86")) ("The Official Radare Blog" "http://radare.today/" - (c - radare2 - programming - reversing)) + ("c" "radare2" "programming" "reversing")) ("妖怪世捨て人" "http://reader.tymoon.eu/" - (common-lisp - game-development - lisp - video-games)) + ("common-lisp" + "game-development" + "lisp" + "video-games")) ("Richard Kallos" "http://rkallos.com/" - (functional-programming - emacs - erlang - lisp - programming - scheme)) + ("functional-programming" + "emacs" + "erlang" + "lisp" + "programming" + "scheme")) ("samskivert" "http://samskivert.com/blog/" - (functional-programming - programming)) + ("functional-programming" "programming")) ("The sh3llc0d3rs blog" "http://sh3llc0d3r.com/" - (binary-exploitation - capture-the-flag - computer-networking - security)) + ("binary-exploitation" + "capture-the-flag" + "computer-networking" + "security")) ("shell-storm" "http://shell-storm.org/" - (binary-exploitation - c - capture-the-flag - linux - operating-systems - reversing - security)) + ("binary-exploitation" + "c" + "capture-the-flag" + "linux" + "operating-systems" + "reversing" + "security")) ("Technomancy" "https://technomancy.us/list" - (fennel - game-development - hardware - lisp - lua - programming - video-games)) - ("Vi Hart" - "http://vihart.com/" - (math)) + ("fennel" + "game-development" + "hardware" + "lisp" + "lua" + "programming" + "video-games")) + ("Vi Hart" "http://vihart.com/" ("math")) ("Charles, etc" "http://www.charlesetc.com/" - (linux - programming - rust)) + ("linux" "programming" "rust")) ("Notes on Programming" "http://www.codersnotes.com/notes/" - (graphics - programming - reversing - video-games)) + ("graphics" + "programming" + "reversing" + "video-games")) ("defmacro" "http://www.defmacro.org/" - (functional-programming - linux - lisp - programming)) + ("functional-programming" + "linux" + "lisp" + "programming")) ("Home Page of Evan Miler" "http://www.evanmiller.org/" - (c - erlang - math - programming - rust - video-games)) + ("c" + "erlang" + "math" + "programming" + "rust" + "video-games")) ("Style Warning" "http://www.stylewarning.com/blog/" - (common-lisp - lisp - math)) + ("common-lisp" "lisp" "math")) ("WezM.net" "https://www.wezm.net/" - (programming - rust)) + ("programming" "rust")) ("0x90r00t" "https://0x90r00t.com/" - (binary-exploitation - capture-the-flag - reversing - security)) + ("binary-exploitation" + "capture-the-flag" + "reversing" + "security")) ("aixxe" "https://aixxe.net/" - (game-hacking - linux - reversing - video-games)) + ("game-hacking" + "linux" + "reversing" + "video-games")) ("Pierre Neidhardts homepage" "https://ambrevar.xyz/" - (emacs - functional-programming - linux - lisp - programming - scheme)) + ("emacs" + "functional-programming" + "linux" + "lisp" + "programming" + "scheme")) ("arp242.net" "https://arp242.net/" - (linux - programming - python)) + ("linux" "programming" "python")) ("The Neo-Babbage Files" "https://babbagefiles.xyz/" - (emacs - lisp - programming)) + ("emacs" "lisp" "programming")) ("Max Bernstein" "https://bernsteinbear.com/blog/" - (functional-programming - lisp - programming)) + ("functional-programming" "lisp" "programming")) ("dmbaturins blog" "https://blog.baturin.org/" - (computer-networking - functional-programming - linux - ocaml - programming - python - x86)) + ("computer-networking" + "functional-programming" + "linux" + "ocaml" + "programming" + "python" + "x86")) ("Andrew Gallants Blog" "https://blog.burntsushi.net/" - (linux - programming - rust)) + ("linux" "programming" "rust")) ("The blog at the bottom of the sea" "https://blog.demofox.org/" - (crypto - game-development - graphics - math - programming - video-games)) + ("crypto" + "game-development" + "graphics" + "math" + "programming" + "video-games")) ("Improved Means for Achieving Deteriorated Ends" "https://blog.kingcons.io/" - (common-lisp - hardware - lisp - programming - retro-tech)) + ("common-lisp" + "hardware" + "lisp" + "programming" + "retro-tech")) ("KRNL386" "https://blog.krnl386.com/" - (retro-tech - reversing - windows)) + ("retro-tech" "reversing" "windows")) ("Separate Concerns" "https://blog.separateconcerns.com/" - (c - linux - lua - programming)) + ("c" "linux" "lua" "programming")) ("Lainblog" "https://blog.soykaf.com/" - (decentralization - programming - retro-tech)) + ("decentralization" "programming" "retro-tech")) ("Bluish Coder" "https://bluishcoder.co.nz/" - (programming)) + ("programming")) ("Cryogenix" "https://cryogenix.net/" - (bsd - retro-tech - reversing - x86)) + ("bsd" "retro-tech" "reversing" "x86")) ("Fedor Indutnys Blog" "https://darksi.de/" - (binary-exploitation - c++ - crypto - programming - security)) + ("binary-exploitation" + "c++" + "crypto" + "programming" + "security")) ("Deftly.net" "https://deftly.net/" - (bsd - erlang - functional-programming - haskell - programming)) + ("bsd" + "erlang" + "functional-programming" + "haskell" + "programming")) ("Bill de hÓra" "https://dehora.net/journal/" - (programming - rust)) + ("programming" "rust")) ("/dev/krzaq" "https://dev.krzaq.cc/" - (c++ - programming - reversing - video-games)) + ("c++" "programming" "reversing" "video-games")) ("Drew DeVaults Blog" "https://drewdevault.com/" - (c - go - linux - programming)) + ("c" "go" "linux" "programming")) ("fuzzy notepad" "https://eev.ee/blog/" - (art - c - doom - game-development - programming - python - retro-tech - rust - video-games)) + ("art" + "c" + "doom" + "game-development" + "programming" + "python" + "retro-tech" + "rust" + "video-games")) ("Eli Grey" "https://eligrey.com/" - (javascript - programming)) + ("javascript" "programming")) ("https://erkaman.github.io/articles.html" "graphics" - (math - programming)) + ("math" "programming")) ("The Brain Dump" "https://floooh.github.io/" - (c - programming - retro-tech - reversing)) + ("c" "programming" "retro-tech" "reversing")) ("Frederik Braun" "https://frederik-braun.com/archives.html" - (programming - python)) + ("programming" "python")) ("General Protection Fault" "https://gpfault.net/" - (c++ - graphics - opengl - programming - retro-tech - reversing)) + ("c++" + "graphics" + "opengl" + "programming" + "retro-tech" + "reversing")) ("Comfortably Numbered" "https://hardmath123.github.io/" - (capture-the-flag - functional-programming - linux - lisp - math - programming - python - scheme)) + ("capture-the-flag" + "functional-programming" + "linux" + "lisp" + "math" + "programming" + "python" + "scheme")) ("Infinity Plus One" "https://infinityplusonemath.wordpress.com/" - (math)) + ("math")) ("jamchambs blog" "https://jamchamb.github.io/" - (c - hardware - powerpc - programming - retro-tech - reversing)) + ("c" + "hardware" + "powerpc" + "programming" + "retro-tech" + "reversing")) ("Daniel Lemires Blog" "https://lemire.me/blog/" - (math - programming - x86)) + ("math" "programming" "x86")) ("Patterns in Cyberspace" "https://leotindall.com/" - (decentralization - linux - programming - retro-tech - rust)) + ("decentralization" + "linux" + "programming" + "retro-tech" + "rust")) ("Marios Lab" "https://marioslab.io/posts/" - (programming)) + ("programming")) ("Tyler Glaiel" "https://medium.com/@tglaiel" - (game-development - programming)) + ("game-development" "programming")) ("Barely Functional" "https://mgattozzi.com/" - (programming - rust)) + ("programming" "rust")) ("Mutos Blog" "https://muto.ca/" - (emacs - functional-programming - programming - scheme)) + ("emacs" + "functional-programming" + "programming" + "scheme")) ("Nerderati" "https://nerderati.com/" - (linux - math - programming - python)) + ("linux" "math" "programming" "python")) ("... and another thing ..." "https://nick.zoic.org/" - (hardware - linux - programming - python)) + ("hardware" "linux" "programming" "python")) ("Nick Cano" "https://nickcano.com/" - (capture-the-flag - game-hacking - hardware - programming - reversing - video-games)) + ("capture-the-flag" + "game-hacking" + "hardware" + "programming" + "reversing" + "video-games")) ("Nora Sandler" "https://norasandler.com/" - (c - compilers - programming)) + ("c" "compilers" "programming")) ("codeblog" "https://outflux.net/blog/" - (linux - operating-systems - programming)) + ("linux" "operating-systems" "programming")) ("Objective-See" "https://objective-see.com/" - (malware - reversing - security)) + ("malware" "reversing" "security")) ("Matt Pharrs blog" "https://pharr.org/matt/blog/" - (graphics - programming - x86)) + ("graphics" "programming" "x86")) ("phoenhex team" "https://phoenhex.re/" - (binary-exploitation - reversing - security)) + ("binary-exploitation" "reversing" "security")) ("programming is terrible" "https://programmingisterrible.com/" - (programming)) + ("programming")) ("./pwnaccelerator BLOG" "https://pwnaccelerator.github.io/" - (crypto - hardware - reversing - security)) + ("crypto" "hardware" "reversing" "security")) ("Computable Multiverse" "https://rakhim.org/" - (emacs - linux - math)) + ("emacs" "linux" "math")) ("John Ramsden" "https://ramsdenj.com/" - (bsd - linux)) + ("bsd" "linux")) ("RETRO.MOE" "https://retro.moe/" - (hardware - retro-tech)) + ("hardware" "retro-tech")) ("Rufflewinds Scratchpad" "https://rufflewind.com/" - (haskell - linux - programming - rust)) + ("haskell" "linux" "programming" "rust")) ("Brandon Skerritt" "https://skerritt.blog/" - (crypto - programming - security)) + ("crypto" "programming" "security")) ("Causal Agency" "https://text.causal.agency/" - (c - programming)) + ("c" "programming")) ("η (eta)" "https://theta.eu.org/posts.html" - (crypto - hardware - linux - programming - rust)) + ("crypto" + "hardware" + "linux" + "programming" + "rust")) ("Travis Goodspeeds Blog" "https://travisgoodspeed.blogspot.com/" - (ham - hardware - reversing - sdr - security)) + ("ham" "hardware" "reversing" "sdr" "security")) ("Two-Bit History" "https://twobithistory.org/" - (linux - lisp - programming - retro-tech)) + ("linux" "lisp" "programming" "retro-tech")) ("Occasionally sane" "https://vfoley.xyz/" - (emacs - programming - rust - video-games)) + ("emacs" "programming" "rust" "video-games")) ("vmcall" "https://vmcall.github.io/" - (game-hacking - programming - reversing - video-games)) + ("game-hacking" + "programming" + "reversing" + "video-games")) ("/dev/ram0" "https://wargio.github.io/" - (hardware - programming - radare2 - reversing)) + ("hardware" "programming" "radare2" "reversing")) ("mindless-area" "https://wbenny.github.io/posts/" - (hardware - reversing - windows)) + ("hardware" "reversing" "windows")) ("wingolog" "https://wingolog.org/" - (functional-programming - linux - lisp - lua - programming - scheme)) + ("functional-programming" + "linux" + "lisp" + "lua" + "programming" + "scheme")) ("Wolf480pl" "https://wolf480pl.github.io/" - (linux - programming)) + ("linux" "programming")) ("Frederic Cambus" "https://www.cambus.net/" - (bsd - c - programming - x86)) + ("bsd" "c" "programming" "x86")) ("The Digital Antiquarian" "https://www.filfre.net/" - (hardware - retro-tech - video-games)) + ("hardware" "retro-tech" "video-games")) ("Kirsle.net" "https://www.kirsle.net/" - (crypto - go - programming - security)) + ("crypto" "go" "programming" "security")) ("Project Nayuki" "https://www.nayuki.io/" - (art - c - c++ - crypto - math - programming - x86)) + ("art" + "c" + "c++" + "crypto" + "math" + "programming" + "x86")) ("Inane Observations" "https://yingtongli.me/blog/" - (crypto - linux - math - reversing - security - video-games)) + ("crypto" + "linux" + "math" + "reversing" + "security" + "video-games")) ("zayenz" "https://zayenz.se/blog" - (programming - rust)) + ("programming" "rust")) ("The Stone Zone" "http://thestone.zone/" - (hardware - lisp - programming - reversing)) + ("hardware" "lisp" "programming" "reversing")) ("David Boddie" "http://www.boddie.org.uk/david/www-repo/Personal/Updates/index.html" - (programming - python - reversing)) + ("programming" "python" "reversing")) ("Alicefs website" "https://alicef.me/" - (gentoo - linux)) - ("~ben" - "https://ben.tild3.org/" - (linux)) + ("gentoo" "linux")) + ("~ben" "https://ben.tild3.org/" ("linux")) ("0day rocks!" "https://0day.rocks/" - (crypto - hardware - linux - math - programming - reversing - security - tor)) + ("crypto" + "hardware" + "linux" + "math" + "programming" + "reversing" + "security" + "tor")) ("Eccentric J" "https://eccentric-j.com/" - (art - clojure - functional-programming - lisp - programming)) + ("art" + "clojure" + "functional-programming" + "lisp" + "programming")) ("Prosthetic Conscience" "https://jfm.carcosa.net/blog/" - (linux - programming)) + ("linux" "programming")) ("Max Justicz" "https://justi.cz/" - (binary-exploitation - reversing - security)) + ("binary-exploitation" "reversing" "security")) ("The Obscuritory" "https://obscuritory.com/feed/" - (retro-tech - video-games)) + ("retro-tech" "video-games")) ("Jon Gjengset" "https://thesquareplanet.com/" - (linux - programming - rust - security)) + ("linux" "programming" "rust" "security")) ("rtl-sdr.com" "https://www.rtl-sdr.com/" - (gnuradio - ham - hardware - programming - sdr)) + ("gnuradio" "ham" "hardware" "programming" "sdr")) ("pancake" "https://medium.com/@trufae" - (c - programming - radare2 - rust)) + ("c" "programming" "radare2" "rust")) ("hexxendmns.motd.org" "https://hexxendmns.motd.org/" - (doom - linux - mapping - programming - quake - video-games)) + ("doom" + "linux" + "mapping" + "programming" + "quake" + "video-games")) ("Random ASCII – tech blog of Bruce Dawson" "https://randomascii.wordpress.com/" - (compilers - hardware - powerpc - programming - windows - x86)) + ("compilers" + "hardware" + "powerpc" + "programming" + "windows" + "x86")) ("David Thompson" "https://dthompson.us/" - (emacs - guile - guix - linux - programming - scheme)) + ("emacs" + "guile" + "guix" + "linux" + "programming" + "scheme")) ("InvisibleUp" "https://invisibleup.com/" - (graphics - programming - retro-tech - reversing - video-games)) + ("graphics" + "programming" + "retro-tech" + "reversing" + "video-games")) ("ancientelectronics" "https://ancientelectronics.wordpress.com/" - (hardware - retro-tech)) + ("hardware" "retro-tech")) ("North Coast News" "https://northcoastsynthesis.com/news/" - (hardware)) + ("hardware")) ("Bodil dot lol" "https://bodil.lol/" - (compilers - programming - rust)) + ("compilers" "programming" "rust")) ("Bits, pixels, cycles and more" "https://zeux.io/" - (c++ - graphics - programming)) + ("c++" "graphics" "programming")) ("Bill Demirkapis Blog" "https://d4stiny.github.io/" - (reversing - security)) + ("reversing" "security")) ("blitter.net" "https://blitter.net/" - (hardware - retro-tech - reversing)) + ("hardware" "retro-tech" "reversing")) ("Breaking Eggs And Making Omelettes" "https://multimedia.cx/eggs/feed/" - (programming - retro-tech - reversing - video-games - x86)) + ("programming" + "retro-tech" + "reversing" + "video-games" + "x86")) ("Halestroms Peregrinations" "https://halestrom.net/darksleep/" - (hardware - linux - programming)) + ("hardware" "linux" "programming")) ("VeXation" "https://log.vexation.ca/" - (malware - programming - retro-tech - reversing - windows)) + ("malware" + "programming" + "retro-tech" + "reversing" + "windows")) ("Skys blog" "https://byebyesky.github.io/blog/" - (capture-the-flag - hardware - programming - reversing - security)) + ("capture-the-flag" + "hardware" + "programming" + "reversing" + "security")) ("Something Something Programming" "https://nickdrozd.github.io/" - (common-lisp - emacs - functional-programming - lisp - math - programming - rust)) + ("common-lisp" + "emacs" + "functional-programming" + "lisp" + "math" + "programming" + "rust")) ("evilsocket" "https://www.evilsocket.net/" - (computer-networking - go - programming - reversing - security)) + ("computer-networking" + "go" + "programming" + "reversing" + "security")) ("GovanifY" "https://govanify.com/post/" - (capture-the-flag - linux - programming - retro-tech - reversing - security)) + ("capture-the-flag" + "linux" + "programming" + "retro-tech" + "reversing" + "security")) ("Code of Connor" "https://codeofconnor.com/" - (game-development - linux - programming)) + ("game-development" "linux" "programming")) ("cowlark.com" "http://cowlark.com/" - (hardware - programming - retro-tech)) - ("danluu.com/" + ("hardware" "programming" "retro-tech")) + ("danluu.com" "https://danluu.com/" - (hardware - linux - programming)) + ("hardware" "linux" "programming")) ("PapaTutuWawas Blog" - "https://blog.latinise.me/" - (linux)) + "https://blog.polynom.me/" + ("linux")) ("Catbolis Blog" "linux" - (programming - retro-tech)) + ("programming" "retro-tech")) ("Tristans Site" "http://thume.ca/archive.html" - (capture-the-flag - compilers - programming - rust - security)) + ("capture-the-flag" + "compilers" + "programming" + "rust" + "security")) ("people.kernel.org" "https://people.kernel.org/read" - (linux - operating-systems - programming)) + ("linux" "operating-systems" "programming")) ("TheFloWs security blog" "https://theofficialflow.github.io/" - (binary-exploitation - hardware - reversing - security)) + ("binary-exploitation" + "hardware" + "reversing" + "security")) ("Christine Dodrills Blog" "https://christine.website/blog" - (linux - programming)) + ("linux" "programming")) ("DustyCloud Brainstorms" "https://dustycloud.org/blog/" - (functional-programming - lisp - programming - scheme)) + ("functional-programming" + "lisp" + "programming" + "scheme")) ("Hot Leaves in a Cold Worlds" "http://www.philipzucker.com/" - (functional-programming - hardware - haskell - math - programming - python)) + ("functional-programming" + "hardware" + "haskell" + "math" + "programming" + "python")) ("Youve Reached the Center of the Internet" "http://blog.benwiener.com/" - (functional-programming - ham - hardware - haskell - programming)) + ("functional-programming" + "ham" + "hardware" + "haskell" + "programming")) ("Grievers Notes" "https://romhack.github.io/doc/" - (programming - retro-tech - reversing - video-games)) + ("programming" + "retro-tech" + "reversing" + "video-games")) ("samiss blag" "https://foldmap.ml/~samis/" - (gentoo - guix - linux)) + ("gentoo" "guix" "linux")) ("James Technical Notes" "https://jamestechnotes.com/blog/" - (android - c - functional-programming - guile - guix - linux - programming - scheme)) + ("android" + "c" + "functional-programming" + "guile" + "guix" + "linux" + "programming" + "scheme")) ("Aearnus' Realm" "https://aearnus.github.io/" - '(functional-programming - haskell - math - perl6 - programming - python))) + ("functional-programming" + "haskell" + "math" + "perl6" + "programming" + "python")) + ("Grid Bugs" + "https://gridbugs.org/" + ("game-development" "programming" "retro-tech" "reversing"))) diff --git a/haunt/data/bookmarks.scm b/haunt/data/bookmarks.scm index 3a27614..b182ce2 100644 --- a/haunt/data/bookmarks.scm +++ b/haunt/data/bookmarks.scm @@ -1,184 +1,155 @@ '(("Finding and Exploiting Hidden Features of Animal Crossings NES Emulator" "https://jamchamb.github.io/2018/07/11/animal-crossing-nes-emulator-hacks.html" - (binary-exploitation - c - dolphin - game-hacking - ida - powerpc - retro-tech - reversing - video-games)) + ("binary-exploitation" + "c" + "dolphin" + "game-hacking" + "ida" + "powerpc" + "retro-tech" + "reversing" + "video-games")) ("Disassembling Jak & Daxter" "http://www.codersnotes.com/notes/disassembling-jak/" - (lisp - mips - retro-tech - reversing - video-games)) + ("lisp" + "mips" + "retro-tech" + "reversing" + "video-games")) ("VMU Hackery" "http://dmitry.gr/index.php?r=05.Projects&proj=25.%20VMU%20Hacking" - (hardware - retro-tech - reversing)) + ("hardware" "retro-tech" "reversing")) ("Fixing a bug in an 18 year old Shockwave game" "https://mattbruv.github.io/ccsr-bugfix/" - (game-hacking - retro-tech - reversing - video-games)) + ("game-hacking" + "retro-tech" + "reversing" + "video-games")) ("Battletoads text decompression (huffman)" "https://forums.nesdev.com/viewtopic.php?t=8609" - (6502 - retro-tech - reversing - video-games)) + ("6502" "nes" "retro-tech" "reversing" "video-games")) + ("Zelda Screen Transitions are Undefined Behavior" + "https://gridbugs.org/zelda-screen-transitions-are-undefined-behaviour/" + ("6502" "nes" "retro-tech" "reversing" "video-games")) ("Investigating a recent ebook DRM system (c. 2018)" "https://yingtongli.me/blog/2019/03/28/drm2.html" - (android - arm - reversing)) + ("android" "arm" "reversing")) ("Looking inside the box" "https://anvilventures.com/blog/looking-inside-the-box.html" - (python - reversing)) + ("python" "reversing")) ("Adventures in reverse engineering Broadcom NIC firmware" "https://www.devever.net/~hl/ortega" - (arm - hardware - reversing - x86)) + ("arm" "hardware" "reversing" "x86")) ("A Great Old-Timey Game-Programming Hack" "http://blog.moertel.com/posts/2013-12-14-great-old-timey-game-programming-hack.html" - (6502 - game-development - programming - retro-tech - video-games)) + ("6502" + "game-development" + "programming" + "retro-tech" + "video-games")) ("CGA in 1024 Colors - a New Mode: the Illustrated Guide" "https://int10h.org/blog/2015/04/cga-in-1024-colors-new-mode-illustrated/" - (dos - hardware - graphics - retro-tech)) + ("dos" "hardware" "graphics" "retro-tech")) ("Ubershaders: A Ridiculous Solution to an Impossible Problem" "https://dolphin-emu.org/blog/2017/07/30/ubershaders/" - (dolphin - graphics - hardware - opengl - programming - video-games)) + ("dolphin" + "graphics" + "hardware" + "opengl" + "programming" + "video-games")) ("GDCCs Memory Model" "http://ipfsgw.greyserv.net/ipns/davidph.greyserv.net/blog/GDCC_Memory_Model.html" - (c - doom - programming - video-games)) + ("c" "doom" "programming" "video-games")) ("What the Hero Sees: Field-of-View for Roguelikes " "http://journal.stuffwithstuff.com/2015/09/07/what-the-hero-sees/" - (programming - algorithms - dart - game-development - interactive - video-games)) + ("programming" + "algorithms" + "dart" + "game-development" + "interactive" + "video-games")) ("A Constructive Look At TempleOS" "http://www.codersnotes.com/notes/a-constructive-look-at-templeos/" - (operating-systems - programming)) + ("operating-systems" "programming")) ("Guix: A most advanced operating system" "https://ambrevar.xyz/guix-advance/index.html" - (functional-programming - guile - guix - linux - lisp - programming - scheme)) + ("functional-programming" + "guile" + "guix" + "linux" + "lisp" + "programming" + "scheme")) ("Lisp Hackers" "https://leanpub.com/lisphackers/read" - (culture - lisp - practices - programming)) + ("culture" "lisp" "practices" "programming")) ("Pascal Costanzas Highly Opinionated Guide to Lisp" "http://www.p-cos.net/lisp/guide.html" - (common-lisp - lisp - programming)) + ("common-lisp" "lisp" "programming")) ("The Nature of Lisp" "http://www.defmacro.org/ramblings/lisp.html" - (java - lisp - programming)) + ("java" "lisp" "programming")) ("A Road to Common Lisp" "http://stevelosh.com/blog/2018/08/a-road-to-common-lisp/" - (common-lisp - lisp - programming)) + ("common-lisp" "lisp" "programming")) ("Meta-Circular Adventures in Functional Abstraction" "https://web.archive.org/web/20160609222905/https://chriskohlhepp.wordpress.com/metacircular-adventures-in-functional-abstraction-challenging-clojure-in-common-lisp/" - (common-lisp - functional-programming - lisp - programming)) + ("common-lisp" + "functional-programming" + "lisp" + "programming")) ("fibs, lies, and benchmarks" "https://wingolog.org/archives/2019/06/26/fibs-lies-and-benchmarks" - (functional-programming - lisp - optimization - programming - programming-languages - scheme)) + ("functional-programming" + "lisp" + "optimization" + "programming" + "programming-languages" + "scheme")) + ("Notes on a smaller Rust" + "https://boats.gitlab.io/blog/post/notes-on-a-smaller-rust/" + ("programming" "rust")) ("Chaining Functions Without Returning Self" "https://randompoison.github.io/posts/returning-self/" - (programming - rust)) + ("programming" "rust")) ("Implementing a NES Emulator in Rust" "http://www.michaelburge.us/2019/03/18/nes-design.html" - (6502 - hardware - programming - rust - video-games)) + ("6502" + "hardware" + "programming" + "rust" + "video-games")) ("Building a Homebrew Video Game Console" "https://internalregister.github.io/2019/03/14/Homebrew-Console.html" - (c - hardware - programming - z80)) + ("c" "hardware" "programming" "z80")) ("In Noisy Digital Era, Elegant Internet Still Thrives" "https://www.npr.org/2012/04/17/150817325/in-noisy-digital-era-elegant-internet-still-thrives" - (culture)) + ("culture")) ("Codecademy vs. The BBC Micro" "https://twobithistory.org/2019/03/31/bbc-micro.html" - (culture - historical)) + ("culture" "historical")) ("Graying Out" "https://www.tbray.org/ongoing/When/201x/2019/03/11/Lights-Going-Out" - (culture - jabber)) + ("culture" "jabber")) ("Does Visual Studio Rot the Mind?" "http://www.charlespetzold.com/etc/DoesVisualStudioRotTheMind.html" - (practices - programming)) + ("practices" "programming")) ("Software disenchantment" "http://tonsky.me/blog/disenchantment/" - (culture - programming)) + ("culture" "programming")) ("Writing system software: code comments." "http://antirez.com/news/124" - (programming)) + ("programming")) ("Indirection Is Not Abstraction" "https://www.silasreinagel.com/blog/2018/10/30/indirection-is-not-abstraction/" - (programming)) + ("programming")) ("Augmenting Long-term Memory" "http://augmentingcognition.com/ltm.html" - (cogsci)) + ("cogsci")) ("The Process of Mastering a Skill" "https://azeria-labs.com/the-process-of-mastering-a-skill/" - (cogsci)) + ("cogsci")) ("Writing well" "http://www.defmacro.org/2016/12/22/writing-well.html" - (writing))) + ("writing"))) diff --git a/haunt/data/replies.scm b/haunt/data/replies.scm new file mode 100644 index 0000000..f151286 --- /dev/null +++ b/haunt/data/replies.scm @@ -0,0 +1,4 @@ +'(("https://aaronparecki.com/2018/06/30/11/your-first-webmention" + "@aaronpk" + "2019-07-19T20:17:50-4000" + (p "Alright, giving this another shot!"))) diff --git a/haunt/haunt.scm b/haunt/haunt.scm index 2454cd9..dcf41b0 100644 --- a/haunt/haunt.scm +++ b/haunt/haunt.scm @@ -21,6 +21,7 @@ (jakob builder blog) (jakob builder blogroll) (jakob builder htaccess) + (jakob builder outbox) (jakob builder static-pages) (jakob reader html-prime) (srfi srfi-19) @@ -47,5 +48,6 @@ (blog) (blogroll) (htaccess #:handler-404 "pages/404.html") + (outbox) (static-pages) (static-directory "static"))) diff --git a/haunt/jakob/builder/blog.scm b/haunt/jakob/builder/blog.scm index f8a8d6e..7457010 100644 --- a/haunt/jakob/builder/blog.scm +++ b/haunt/jakob/builder/blog.scm @@ -23,6 +23,7 @@ #:use-module (ice-9 match) #:use-module (jakob theme) #:use-module (jakob utils) + #:use-module (jakob utils pagination) #:use-module (jakob utils sxml) #:use-module (jakob utils tags) #:use-module (srfi srfi-1) @@ -56,7 +57,21 @@ (post-ref post 'tags)) ", ")) (article - ,(post-sxml post)))) + ,(post-sxml post)) + (section + (@ (id "webmention")) + (h2 ,(hyperlink "https://indieweb.org/Webmention" "Webmentions") + " for this Page") + (ul (@ (id "webmention-container"))) + (form + (@ (action "https://webmention.io/jakob.space/webmention") + (method "post")) + (label "Have you written a " + ,(hyperlink "https://indieweb.org/responses" "response") + " to this? Let me know the URL:") + (input (@ (name "source") (type "url"))) + (input (@ (value "Send Webmention") (type "submit")))) + ,(script "webmention.js")))) (define (render-preview post) "Return the SHTML for a preview of POST." @@ -77,22 +92,9 @@ (p ,(first-paragraph post)) ,(hyperlink (or crosspost-uri local-uri) "read more 🢩")))) -(define (render-listing posts title previous-page next-page) - "Return SHTML presenting previews for POSTS, with the header TITLE and links -to PREVIOUS-PAGE and NEXT-PAGE." - `((h1 ,title) - ,@(map render-preview posts) - (nav - (@ (id "pagination")) - ,@(maybe-list - (when previous-page - (hyperlink previous-page "🢨 Previous Page")) - (when next-page - (hyperlink next-page "Next Page 🢩")))))) - ;;; -;;; Creation of permalink pages for individual posts. +;;; Creation of permalink pages for individual lposts. ;;; ;; Subdirectory for permalink pages. @@ -115,54 +117,6 @@ to PREVIOUS-PAGE and NEXT-PAGE." #:content (render-article post)) sxml->html)) - -;;; -;;; Implementation of pagination. -;;; - -(define %posts-per-page 10) - -(define* (paginate posts #:optional (posts-per-page %posts-per-page)) - "Partition POSTS into list of no more than POSTS-PER-PAGE posts, of the -form (index, posts)." - (let loop ((index 1) - (lst posts) - (result '())) - (if (null? lst) - result - (let ((how-many (min %posts-per-page (length lst)))) - (loop (1+ index) - (drop lst how-many) - (cons (list index (take lst how-many)) - result)))))) - -(define (post-list->pages base-title base-file-name posts) - "Return a list of Haunt pages for POSTS, with headers containing BASE-TITLE -and output file names beginning with BASE-FILE-NAME." - (define (index->file-name index) - (if (= index 1) - (format #f "~a.html" base-file-name) - (format #f "~a-~a.html" base-file-name index))) - (map (match-lambda - ((index subset) - (let ((title (if (= index 1) - base-title - (format #f "~a — Page ~a" base-title index))) - (previous-page (if (>= (1- index) 1) - (index->file-name (1- index)) - #f)) - (next-page (if (<= (1+ index) (ceiling/ (length posts) - %posts-per-page)) - (index->file-name (1+ index)) - #f))) - (make-page (index->file-name index) - (theme #:title title - #:content - (render-listing subset title - previous-page next-page)) - sxml->html)))) - (paginate posts))) - ;;; ;;; Navigation based on post tags. @@ -176,9 +130,9 @@ and output file names beginning with BASE-FILE-NAME." only the posts tagged with that tag." (flat-map (match-lambda ((tag . posts) - (post-list->pages (format #f "Posts tagged as \"~a\"" tag) - (tag-uri %tag-prefix tag "") - posts))) + (items->pages render-preview posts + (format #f "Posts tagged as \"~a\"" tag) + (tag-uri %tag-prefix tag "")))) (group-by-tag posts (cut post-ref <> 'tags)))) (define (all-tags posts) @@ -210,9 +164,8 @@ of the 'post' objects associated with the site." (map post->page posts) ;; Main post navigation. - (post-list->pages - "Recent Posts" "index" - (posts/reverse-chronological posts)) + (items->pages render-preview (posts/reverse-chronological posts) + "Recent Posts" "index") ;; Tag-based navigation. (list (all-tags posts)) diff --git a/haunt/jakob/builder/outbox.scm b/haunt/jakob/builder/outbox.scm index 851ed88..8e3a050 100644 --- a/haunt/jakob/builder/outbox.scm +++ b/haunt/jakob/builder/outbox.scm @@ -15,37 +15,135 @@ ;;; . (define-module (jakob builder outbox) + #:use-module (haunt html) #:use-module (haunt page) + #:use-module (ice-9 format) + #:use-module (ice-9 match) + #:use-module (jakob theme) + #:use-module (jakob utils pagination) + #:use-module (jakob utils sxml) + #:use-module (srfi srfi-9) + #:use-module (srfi srfi-19) #:export (outbox)) ;;; Commentary: ;;; -;;; Implementation of a multi-page Webmention outbox. See -;;; for details. +;;; [TODO] ;;; ;;; Code: -;; `((doctype "html") -;; (meta (@ (charset "utf-8"))) -;; (title ,title) -;; (div (@ (class "h-entry")) -;; (img (@ (src ,profile-picture) (class "u-photo") (width "40"))) -;; (a (@ (href ,profile-url) (class "u-url p-name")) ,profile-name)) -;; (p "in reply to:" (a (@ (href ,target-url) (class "u-in-reply-to")) -;; ,target-handle)) -;; (p (@ (class "e-content")) ,content) -;; (p (a (@ (href "self") (class "u-url")) -;; (time (@ (datetime ,datetime) (class "dt-published")) -;; ,datetime-pretty)))) - -;; (define* (htaccess #:key profile-url -;; profile-name -;; profile-picture -;; (comment-dir "webmentions")) -;; "Create a multi-page Webmention outbox, reading comments from COMMENT-DIR." -;; (define contents -;; `(,(if handler-404 -;; (format #f "ErrorDocument 404 ~a" handler-404)))) - -;; (lambda (site posts) -;; (make-page ".htaccess" contents htaccess-writer))) +;; Prefix for all pages representing Webmention interactions. +(define %outbox-prefix "/outbox") + + +;;; +;;; Profile. +;;; + +(define %h-card + `(div (@ (class "u-author h-card")) + (img (@ (class "u-photo") + (src "/static/image/profile-picture.jpg") + (width "40"))) + (a (@ (class "u-url p-name") + (href "http://jakob.space")) + "Jakob L. Kreuze"))) + + +;;; +;;; Common rendering code. +;;; + +(define (datetime uri date) + `(p (a (@ (class "u-url") (href uri)) + (time (@ (class "dt-published") + (datetime ,(date->string date "~4"))) + ,(date->string date "~B ~e, ~Y"))))) + + +;;; +;;; Record type for replies -- by far, my most frequently-used type of +;;; Webmention response. +;;; + +(define-record-type + (make-reply content date target-uri target-handle) + reply? + (content reply-content) + (date reply-date) + (target-uri reply-target-uri) + (target-handle reply-target-handle)) + +(define (reply-uri reply) + (let* ((date (date->string (reply-date reply) "~Y-~m-~d-~H:~M:~S")) + (target (reply-target-handle reply)) + (slug (format #f "reply-~a-~a" target date))) + (string-append %outbox-prefix "/" slug ".html"))) + +(define reply + (match-lambda + ((target-uri target-handle date-string content) + (let ((date (string->date date-string "~Y-~m-~dT~H:~M:~S~z"))) + (make-reply content date target-uri target-handle))))) + + +;;; +;;; Reply rendering. +;;; + +(define (render-reply reply) + (let ((content (cons* (car (reply-content reply)) + `(@ (class "e-content")) + (cdr (reply-content reply))))) + `(div (@ (class "h-entry")) + ,%h-card + (p "In reply to: " + (a (@ (class "u-in-reply-to") + (href ,(reply-target-uri reply))) + ,(reply-target-handle reply))) + ,content + ,(datetime (reply-uri reply) (reply-date reply))))) + +(define (render-preview reply) + (let* ((simple-text? (eqv? 'p (car (reply-content reply)))) + (truncated? (and simple-text? + (> (length (cdr (reply-content reply))) 80))) + (preview (if simple-text? + (if truncated? + (format #f "~a..." + (substring (cdr (reply-content reply)) + 0 80)) + (cdr (reply-content reply))) + "[No preview available...]"))) + `(section + (h2 ,(hyperlink + (reply-uri reply) + (format #f "Reply directed towards ~a on ~a" + (reply-target-handle reply) + (date->string (reply-date reply) "~B ~e, ~Y")))) + (p ,preview)))) + +(define (reply->page reply) + (let ((title (format #f "Reply to ~a" (reply-target-handle reply)))) + (make-page (reply-uri reply) + (theme #:title title + ;; #:description (first-paragraph post) + ;; #:keywords (post-ref post 'tags) + #:content (render-reply reply)) + sxml->html))) + + +;;; +;;; Builder. +;;; + +(define (outbox) + (let ((replies (map reply (primitive-load "data/replies.scm")))) + (lambda (site posts) + (append + ;; Permalinks. + (map reply->page replies) + + ;; Outbox listing. + (items->pages render-preview replies + "Webmentions" (string-append %outbox-prefix "/" "index")))))) diff --git a/haunt/jakob/builder/static-pages.scm b/haunt/jakob/builder/static-pages.scm index 9089789..e869b94 100644 --- a/haunt/jakob/builder/static-pages.scm +++ b/haunt/jakob/builder/static-pages.scm @@ -34,9 +34,7 @@ file-name)) (name (first (string-split (basename dest) #\.))) (sxml (primitive-load file-name)) - ;; (contents (with-layout theme site name sxml)) - (contents sxml) - ) + (contents sxml)) (cons (make-page dest contents sxml->html) memo))) (define (noop file-name stat result) diff --git a/haunt/jakob/theme.scm b/haunt/jakob/theme.scm index 23d3929..3bd60db 100644 --- a/haunt/jakob/theme.scm +++ b/haunt/jakob/theme.scm @@ -32,7 +32,7 @@ ("pingback" "https://webmention.io/jakob.space/xmlrpc") ("pgpkey authn" "/gpg.txt"))) (define %nav-bar-tabs '(("About" "/pages/about.html") - ("Projects" "/pages/projects.html") + ;; ("Projects" "/pages/projects.html") ("Tags" "/tag.html") ("Atom" "/feed.xml"))) @@ -63,7 +63,9 @@ International") ,(hyperlink "http://haunt.dthompson.us/" "Haunt") ", a static site generator written in " ,(hyperlink "https://gnu.org/software/guile" "Guile Scheme") - "."))) + ".") + (p (a (@ (href "/pages/weblabels.html") (rel "jslicense")) + "JavaScript license information")))) (define* (theme #:key (title '()) diff --git a/haunt/jakob/utils/pagination.scm b/haunt/jakob/utils/pagination.scm new file mode 100644 index 0000000..5560685 --- /dev/null +++ b/haunt/jakob/utils/pagination.scm @@ -0,0 +1,103 @@ +;;; Copyright © 2019 Jakob L. Kreuze +;;; +;;; This program is free software; you can redistribute it and/or +;;; modify it under the terms of the GNU General Public License as +;;; published by the Free Software Foundation; either version 3 of the +;;; License, or (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with this program. If not, see +;;; . + +;;; Commentary: +;;; +;;; Common procedures for splitting up large numbers of items across pages. +;;; +;;; Code: + +(define-module (jakob utils pagination) + #:use-module (haunt html) + #:use-module (haunt page) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (jakob theme) + #:use-module (jakob utils) + #:use-module (jakob utils sxml) + #:export (paginate + + render-listing + items->pages)) + +(define %items-per-page 10) + + +;;; +;;; Partitioning. +;;; + +(define* (paginate items #:key (items-per-page %items-per-page)) + "Partition ITEMS into list of no more than ITEMS-PER-PAGE items, returning +lists of the form (index, items)." + (let loop ((index 1) + (lst items) + (result '())) + (if (null? lst) + result + (let ((how-many (min %items-per-page (length lst)))) + (loop (1+ index) + (drop lst how-many) + (cons (list index (take lst how-many)) + result)))))) + + +;;; +;;; Rendering. +;;; + +(define (render-listing content title previous-page next-page) + "Return an SHTML document showing CONTENT, with the header TITLE and links to +PREVIOUS-PAGE and NEXT-PAGE." + `((h1 ,title) + ,@content + (nav + (@ (id "pagination")) + ,@(maybe-list + (when previous-page + (hyperlink previous-page "🢨 Previous Page")) + (when next-page + (hyperlink next-page "Next Page 🢩")))))) + +(define* (items->pages render-item items base-title base-file-name + #:key (items-par-page %items-per-page)) + "Return a list of Haunt pages for ITEMS with no more than ITEMS-PER-PAGE items +to a page, with headers containing BASE-TITLE and output file names beginning +with BASE-FILE-NAME. RENDER-ITEM is a procedure returning a SXML rendering of +the item from ITEMS passed as a parameter." + (define (index->file-name index) + (if (= index 1) + (format #f "~a.html" base-file-name) + (format #f "~a-~a.html" base-file-name index))) + (map (match-lambda + ((index subset) + (let ((title (if (= index 1) + base-title + (format #f "~a — Page ~a" base-title index))) + (previous-page (if (>= (1- index) 1) + (index->file-name (1- index)) + #f)) + (next-page (if (<= (1+ index) (ceiling/ (length items) + %items-per-page)) + (index->file-name (1+ index)) + #f))) + (make-page (index->file-name index) + (theme #:title title + #:content + (render-listing (map render-item subset) title + previous-page next-page)) + sxml->html)))) + (paginate items))) diff --git a/haunt/jakob/utils/sxml.scm b/haunt/jakob/utils/sxml.scm index c4ce33d..0bde0fe 100644 --- a/haunt/jakob/utils/sxml.scm +++ b/haunt/jakob/utils/sxml.scm @@ -23,16 +23,21 @@ (define-module (jakob utils sxml) #:export (hyperlink image - stylesheet)) + stylesheet + script)) (define (hyperlink target text) `(a (@ (href ,target)) ,text)) -(define* (image filename #:optional description) - (let ((src (string-append "/static/image/" filename))) +(define* (image file-name #:optional description) + (let ((src (string-append "/static/image/" file-name))) (if description `(img (@ (src ,src) (alt ,description) (title ,description))) `(img (@ (src ,src)))))) (define (stylesheet file-name) `(link (@ (rel "stylesheet") (href ,(format #f "/static/css/~a" file-name))))) + +(define (script file-name) + (let ((src (string-append "/static/js/" file-name))) + `(script (@ (src ,src))))) diff --git a/haunt/pages/about.sxml b/haunt/pages/about.sxml index 8bce651..603d3e8 100644 --- a/haunt/pages/about.sxml +++ b/haunt/pages/about.sxml @@ -16,13 +16,17 @@ ;;; along with this program. If not, see ;;; . -(use-modules (jakob utils sxml)) +(use-modules (jakob theme) + (jakob utils sxml)) -`((h2 "Hey.") - (p "I'm still in the process of putting things together, so this page is a bit empty.") - (p "For those interested in contacting me, here's my info.") - (ul - (li "Email: zerodaysfordays at ‌​‌‌‌​‌‌‍‌​‌‌​​​​‍‌​‌‌​​​‌‍‌‌​‌‌​​​‍‌​‌​‌​‌‌‍‌‌​‌‌‌‌‌‍‌​‌‌‌​​‌‍‌​‌​‌​‌​‍‌​‌‌‌‌​​‍‌​‌‌​‌​​‍‌​‌‌​‌‌​‍‌​‌‌​​​‌‍‌​‌‌‌​​​‍‌‌​‌‌‌‌‌‍‌​‌​‌‌​​‍‌​‌​‌‌‌‌‍‌​‌‌‌‌‌​‍‌​‌‌​​‌​‍‌‌​‌‌‌‌‌‍‌​‌‌​​‌​‍‌​‌‌‌​‌​sdf.lonestar.org") - (li "GPG: " ,(hyperlink "5A7B 8C4C 70D5 FC3F 5E35 4625 3FE7 8039 D0E5 C118" "/gpg.txt")) - (li "XMPP: jakob at ‌​‌‌‌​‌‌‍‌​‌‌​​​​‍‌​‌‌​​​‌‍‌‌​‌‌​​​‍‌​‌​‌​‌‌‍‌‌​‌‌‌‌‌‍‌​‌‌‌​​‌‍‌​‌​‌​‌​‍‌​‌‌‌‌​​‍‌​‌‌​‌​​‍‌​‌‌​‌‌​‍‌​‌‌​​​‌‍‌​‌‌‌​​​‍‌‌​‌‌‌‌‌‍‌​‌​‌‌​​‍‌​‌​‌‌‌‌‍‌​‌‌‌‌‌​‍‌​‌‌​​‌​‍‌‌​‌‌‌‌‌‍‌​‌‌​​‌​‍‌​‌‌‌​‌​xmpp.is") - (li "IRC: tsarfox on freenode.net, and jakob everywhere else. I frequent #lobsters and the #tildetown on the tilde.town internal IRC."))) +(theme + #:title "About" + #:content + `((h2 "Hey.") + (p "I'm still in the process of putting things together, so this page is a bit empty.") + (p "For those interested in contacting me, here's my info.") + (ul + (li "Email: zerodaysfordays at ‌​‌‌‌​‌‌‍‌​‌‌​​​​‍‌​‌‌​​​‌‍‌‌​‌‌​​​‍‌​‌​‌​‌‌‍‌‌​‌‌‌‌‌‍‌​‌‌‌​​‌‍‌​‌​‌​‌​‍‌​‌‌‌‌​​‍‌​‌‌​‌​​‍‌​‌‌​‌‌​‍‌​‌‌​​​‌‍‌​‌‌‌​​​‍‌‌​‌‌‌‌‌‍‌​‌​‌‌​​‍‌​‌​‌‌‌‌‍‌​‌‌‌‌‌​‍‌​‌‌​​‌​‍‌‌​‌‌‌‌‌‍‌​‌‌​​‌​‍‌​‌‌‌​‌​sdf.lonestar.org") + (li "GPG: " ,(hyperlink "5A7B 8C4C 70D5 FC3F 5E35 4625 3FE7 8039 D0E5 C118" "/gpg.txt")) + (li "XMPP: jakob at ‌​‌‌‌​‌‌‍‌​‌‌​​​​‍‌​‌‌​​​‌‍‌‌​‌‌​​​‍‌​‌​‌​‌‌‍‌‌​‌‌‌‌‌‍‌​‌‌‌​​‌‍‌​‌​‌​‌​‍‌​‌‌‌‌​​‍‌​‌‌​‌​​‍‌​‌‌​‌‌​‍‌​‌‌​​​‌‍‌​‌‌‌​​​‍‌‌​‌‌‌‌‌‍‌​‌​‌‌​​‍‌​‌​‌‌‌‌‍‌​‌‌‌‌‌​‍‌​‌‌​​‌​‍‌‌​‌‌‌‌‌‍‌​‌‌​​‌​‍‌​‌‌‌​‌​xmpp.is") + (li "IRC: tsarfox on freenode.net, and jakob everywhere else. I frequent #lobsters and the #tildetown on the tilde.town internal IRC.")))) diff --git a/haunt/pages/weblabels.sxml b/haunt/pages/weblabels.sxml new file mode 100644 index 0000000..bafff6d --- /dev/null +++ b/haunt/pages/weblabels.sxml @@ -0,0 +1,30 @@ +;;; Copyright © 2019 Jakob L. Kreuze +;;; +;;; This program is free software; you can redistribute it and/or +;;; modify it under the terms of the GNU General Public License as +;;; published by the Free Software Foundation; either version 3 of the +;;; License, or (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with this program. If not, see +;;; . + +(use-modules (jakob theme) + (jakob utils sxml)) + +(theme + #:title "JavaScript Web Labels" + #:content + `((h2 "JavaScript Web Labels") + (table (@ (id "jslicense-labels1")) + (tr (td ,(hyperlink "/static/js/webmention.js" + `(p "/static/js/webmention.js"))) + (td ,(hyperlink "http://www.gnu.org/licenses/gpl-3.0.html" + `(p "GNU General Public License 3.0 or later"))) + (td ,(hyperlink "/static/js/webmention.js" + `(p "/static/js/webmention.js"))))))) diff --git a/haunt/reload.py b/haunt/reload.py new file mode 100644 index 0000000..b4cc3c0 --- /dev/null +++ b/haunt/reload.py @@ -0,0 +1,14 @@ +#!/home/jakob/.guix-profile/bin/python + +from livereload import Server, shell +import os + +site_output = "site" + +server = Server() + +for path in os.listdir("./"): + if path != site_output: + server.watch(path, "haunt build") + +server.serve(root=site_output) diff --git a/haunt/static/css/style.css b/haunt/static/css/style.css index ef354f9..02001ec 100644 --- a/haunt/static/css/style.css +++ b/haunt/static/css/style.css @@ -101,7 +101,7 @@ body > header > nav > ul { /* Links. */ -a:link, a:visited { color:#0000EE; } +a:link, a:visited { color: #00E; text-decoration: none; } /* Figures */ @@ -138,6 +138,47 @@ figure > figcaption { display: inline; } +/* Webmention. */ + +#webmention { + border-top: 2px solid #d2d6dd; +} + +ul#webmention-container { + list-style-type: none; +} + +div.h-entry, ul#webmention-container li { + border: 2px solid #d2d6dd; + padding: 1rem; +} + +img.u-photo { + width: 4rem; + padding: 0 1rem 1rem 0; + float: left; +} + +div.p-author * { + padding-right: 1rem; +} + +/* Webmention form. */ + +form { + border-top: 2px solid #d2d6dd; + padding-top: 1rem; +} + +form input { + margin-top: 1rem; +} + +form input[type=url] { + display: block; + width: 100%; +} + /* Source code. */ pre { diff --git a/haunt/static/image/profile-picture.jpg b/haunt/static/image/profile-picture.jpg new file mode 100644 index 0000000..cd2e07e Binary files /dev/null and b/haunt/static/image/profile-picture.jpg differ diff --git a/haunt/static/js/webmention.js b/haunt/static/js/webmention.js new file mode 100644 index 0000000..d1bb8e8 --- /dev/null +++ b/haunt/static/js/webmention.js @@ -0,0 +1,140 @@ +/* + * webmention.js -- Fetch and display mentions from webmention.io. + * Copyright © 2019 Jakob L. Kreuze + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * . + */ + +function buildApiUri() { + const snip = /https?:\/\/.*?\//.exec(window.location.href); + const page = window.location.href.substring(snip[0].length); + + // TODO: Build up from aliases, etc. + const aliases = [page]; + + return Array.concat( + ["https://webmention.io/api/mentions.jf2?"], + aliases.flatMap((alias) => { + const ref = "jakob.space"; + return [ + `target[]=http://${ref}/${alias}`, + `target[]=https://${ref}/${alias}` + ]; + }).join("&") + ).join(""); +} + +function getData(url, callback) { + if (fetch) { + fetch(url).then(function(response) { + if (response.status >= 200 && response.status < 300) { + return Promise.resolve(response); + } else { + return Promise.reject(new Error(`Request failed: ${response.statusText}`)); + } + }).then(function(response) { + return response.json(); + }).then(callback); + } else { + let xhr = new XMLHttpRequest(); + xhr.onload = function(data) { + callback(JSON.parse(data)); + } + xhr.onerror = function(error) { + throw new Error(`Request failed: ${error}`); + } + } +} + +function makeComment(comment) { + const strip = (uri) => { + const sep = "://"; + return uri.substring(uri.indexOf(sep) + sep.length); + }; + + const element = (type, attributes) => { + let res = document.createElement(type); + for (const attribute in attributes) { + res.setAttribute(attribute, attributes[attribute]); + } + return res; + }; + + // Create the h-card section. + let avatar = element("img", { + "class": "u-photo", + "src": comment.author.photo + }); + + let authorName = element("a", { + "class": "p-name u-url", + "href": comment.author.url + }); + authorName.textContent = comment.author.name; + + let authorURI = element("a", { + "class": "author_url", + "href": comment.author.url + }); + authorURI.textContent = strip(comment.author.url); + + let hCardContainer = element("div", { + "class": "p-author h-card author" + }); + hCardContainer.appendChild(avatar); + hCardContainer.appendChild(authorName); + hCardContainer.appendChild(authorURI); + + // Create the content section. + let contentContainer = element("div", { + "class": "e-content p-name comment-content", + }); + contentContainer.textContent = comment.content.text; + + // Create the metaline section. + let time = element("time", { + "class": "dt-published", + "datetime": comment.published + }); + time.textContent = (new Date(comment.published)).toString(); + + let linkBack = element("a", { + "class": "u-url", + "href": comment.url + }); + linkBack.appendChild(time); + + let metalineContainer = element("div", { + "class": "metaline" + }); + metalineContainer.appendChild(linkBack); + + // Put it all together. + let wrapper = element("li", { + "class": "p-comment h-cite comment", + }); + wrapper.appendChild(hCardContainer); + wrapper.appendChild(contentContainer); + wrapper.appendChild(metalineContainer); + + return wrapper; +} + +getData(buildApiUri(), (json) => { + json.children + .map(makeComment) + .forEach((elem) => { + document.getElementById("webmention-container").appendChild(elem); + })}); -- cgit v1.3