Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: ActivityPub support #2665

Open
1 task
lkdm opened this issue Oct 7, 2024 · 6 comments
Open
1 task

Feature request: ActivityPub support #2665

lkdm opened this issue Oct 7, 2024 · 6 comments

Comments

@lkdm
Copy link

lkdm commented Oct 7, 2024

Read-only ActivityPub feeds for Zola

I created this issue to discuss the feasibility of adding a feature to Zola that serialises posts to ActivityStream 2.0 format for ingestion by other federated instances.

What is ActivityPub?

ActivityPub is a standard that allows different web applications to interact so information can be pooled across different instances.

It supports social networking, such as Mastodon or Lemmy, but can also be used for blogging in the case of Plume, Write Freely, and Wordpress through a plugin.

Why

Why not use Plume or Write Freely? Because to my knowledge they are not statically rendered, and thus cost a lot more than running Zola locally and hosting the HTML on a free/cheap host.

Why ActivityPub? Because the new Federated internet runs on ActivityPub. Adding read-only ActivityStream 2.0 support to Zola would allow social networks, or even other applications to subscribe to Zola blogs.

One of the big issues with self-hosting a blog is discoverability. A self-hosted blog from Zola is an island, unlike a blog post on Medium or Substack. Integrating with the Fediverse would help with this.

How ActivityPub works

ActivityPub works by establishing an INBOX and OUTBOX for an actor.

Because Zola renders a static website, it is probably not feasible to implement an ActivityPub "Inbox" and therefore, comments.

However, an outbox activity stream could be published alongside the static HTML– so that federated instances may subscribe to Zola blogs.

Format Examples

Here are some examples of Activity Stream 2.0 objects that I found in the W3 specification that could be suitable:

Post Detail endpoint

{
      "@context": "https://www.w3.org/ns/activitystreams",
      "summary": "Martin added an article to his blog",
      "type": "Add",
      "published": "2015-02-10T15:04:55Z",
      "actor": {
       "type": "Person",
       "id": "http://www.test.example/martin",
       "name": "Martin Smith",
       "url": "http://example.org/martin",
       "image": {
         "type": "Link",
         "href": "http://example.org/martin/image.jpg",
         "mediaType": "image/jpeg"
       }
      },
      "object" : {
       "id": "http://www.test.example/blog/abc123/xyz",
       "type": "Article",
       "url": "http://example.org/blog/2011/02/entry",
       "name": "Why I love Activity Streams"
      },
      "target" : {
       "id": "http://example.org/blog/",
       "type": "OrderedCollection",
       "name": "Martin's Blog"
      }
    }

Post List endpoint

{
      "@context": "https://www.w3.org/ns/activitystreams",
      "summary": "Sally's posts",
      "type": "OrderedCollection",
      "totalItems": 2,
      "orderedItems": [
        {
          "type": "Post",
          "name": "Meeting 2016-11-17"
        },
        {
          "type": "Post",
          "name": "Reminder for Going-Away Party"
        }
      ]
    }

Comment

I am somewhat familiar with Rust, so am happy to at some point commit some time to working on this (not until at least next year)– but I wanted to raise it first to check if it's feasible, desired, and worthwhile.

Action items

Links

@Keats
Copy link
Collaborator

Keats commented Oct 10, 2024

If I remember correctly someone wanted to do that before but it was not super practical. Maybe it's in the issues or the forum?

@lkdm
Copy link
Author

lkdm commented Oct 11, 2024

@Keats I did have a quick search through the issues before posting and couldn’t find anything

@Keats
Copy link
Collaborator

Keats commented Oct 14, 2024

Argh I swear it was talked about somewhere but I can't remember

@kanru
Copy link

kanru commented Oct 29, 2024

Someone did some investigation this year https://web.archive.org/web/20240317071325/https://maho.dev/2024/02/a-guide-to-implement-activitypub-in-a-static-site-or-any-website/

@kanru
Copy link

kanru commented Oct 29, 2024

Another guide https://paul.kinlan.me/adding-activity-pub-to-your-static-site/

@lkdm
Copy link
Author

lkdm commented Nov 6, 2024

That's a fantastic start, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@kanru @Keats @lkdm and others