coatless-quarto / bluesky-comments

A Quarto Shortcode Extension to Embed Comments from Bluesky
https://quarto.thecoatlessprofessor.com/bluesky-comments/
2 stars 1 forks source link
bluesky discussion quarto quarto-extension

Bluesky Comments Extension for Quarto Logo: A butterfly in the blue sky with comments

Enable Bluesky social discussions in your Quarto documents

Bluesky Comments is a Quarto shortcode extension that seamlessly integrates Bluesky post comments into your documents. This extension dynamically fetches and displays threaded conversations from Bluesky, creating an interactive bridge between your content and social discussions.

Installation

You can install this extension using Quarto's extension management system:

quarto add coatless-quarto/bluesky-comments

This will install the extension under the _extensions directory of your Quarto project.

Requirements

Usage

To embed comments from a Bluesky post, use the bluesky-comments shortcode in your Quarto document:

{{{< bluesky-comments uri="at://did.plc/rkey" >}}}

Converting Bluesky URLs to AT Protocol URIs

To get the correct URI format, use the Bluesky/AT Protocol URL ↔ Identifier Converter.

For example:

  1. Original URL:

    https://bsky.app/profile/coatless.bsky.social/post/3lbtwdydxrk26
  2. Converted AT-URI:

    at://did:plc:fgeozid7uyx2lfz3yo7zvm3b/app.bsky.feed.post/3lbtwdydxrk26
  3. Final shortcode:

    {{< bluesky-comments uri="at://did:plc:fgeozid7uyx2lfz3yo7zvm3b/app.bsky.feed.post/3lbtwdydxrk26" >}}

Configuration

The extension can be configured through your document's YAML frontmatter or the _quarto.yml configuration file. Add configuration options under the bluesky-comments key:

---
title: "My Document"
bluesky-comments:
  mute-patterns: 
    - "📌"
    - "🔥"
    - "/\\bspam\\b/i"  # regex pattern
  mute-users:
    - "did:plc:1234abcd"
  filter-empty-replies: true
  visible-comments: 3
  visible-subcomments: 3
---

Available Options

Users can click "Show more" buttons to reveal additional comments and replies beyond these initial limits. Filtered comments are counted and displayed at the top of the comments section to maintain transparency about moderation.

Styling

Modify the extension's appearance by overriding CSS classes in:

_extensions/bluesky-comments/styles.css

Limitations

Acknowledgements

This extension builds upon the innovative work of: