How to hack on activitypub.rocks

Setting up the dev environment

Cloning from git

First clone and change directory to a checkout of the git repository:

git clone https://gitlab.com/dustyweb/activitypub.rocks.git
cd activitypub.rocks

Setting up dependencies the easy way: use Guix

Next you’re going to get the environment up and running. The “easy” way to do this is to use Guix (which can be run as its own operating system distribution or as a userspace package manager under any GNU/Linux distribution):

guix environment -l guix.scm

This will set up a shell with all dependencies pre-configured.

Setting up the dependencies the manual way

You’ll need to install Guile, and then Haunt, guile-reader, guile-sjson, and guile-commonmark and making sure all of those are set up on the guile library path. Good luck; you’re on your own here.

Running the server

Now that you have a dev environment up, it’s easy!

haunt build && haunt serve -w

Writing a new blogpost

Add a new Markdown file to the posts/ directory and save it with a .md extension; you’ll need to add a header like so:

title: My first ap.rocks blogpost
date: 2019-03-08 14:45:00
tags: activitypub, hello world
---
Content goes here!

(You can also use Skribe though I suspect only the lispiest of people will like doing this.)

Editing the site structure

css/fonts/images can be found in the static/ subdirectory.

The rest of the website’s design can be found in haunt.scm. Really this file ought to be split up. The templates all use sxml which may be unfamiliar to you but is a real delight once you learn to use it.

Basically activitypub.rocks is secretly a scheme program; the website’s rendering it its output. That’s the haunt philosophy. This is used to its full potential to generate the implementation reports page.

You’ll have the most fun hacking this if you use either Emacs or, if you’re a vim keybindings enthusiast, Spacemacs. Geiser is of great help.

Basically, if you aren’t a Scheme hacker, editing the activitypub.rocks website is a great way to learn to become one! :wink:

3 Likes

Thank you so much.

To everybody celebrating today:
Merry Christmas, Happy Hanukkah, Funny 36c3 Setting, Shubbo Boro Din, whatever …

So, at this point you have installed Guile. Let’s update the package repository and install the dependencies:

guix pull
guix install guile-reader guile-sjson guile-commonmark

You can resume to Running the server.


As this is using Git, you’re welcome to work on a branch, push that branch, and propose a merge request against master.

I sent a Merge Request for a new blog post made using these instructions – and using Guile to format the post, simply following the examples set by existing articles.

I’m eager to follow up on @rigelk’s proposal to update the look & feel of the site.

2 Likes

That looks great! I’m going to merge and test, and as long as it looks good, I’ll push up to the server! Thank you!

It’s live!

1 Like

a number of links are broken in the blogpost. The link to the discourse thread is “https://socialhub.activitypub.rock/c/software/discourse?u=how” missing the ‘s’ in the .rocks tld. and they all have how’s username in the links

Good call. I submitted an MR to fix the link.

The ?u=how are used to account for link info in Discourse. If you post an article, you should do the same with your username.

1 Like