randy.pub

Personal homepage
Author Randy Boyes
Updated
Nav Home Publications Resume Posts

Adding a comments section from BlueSky

This post shows how you can add Bluesky posts as blog comments in general, and the code was added to an npm package here. We can steal that code to add it to a Franklin.jl site easily. Download the bsky-comments.js file here (or grab my slightly modified one from this website's github repo under posts/bsky-comments.js) and add the following function to your utils.jl file:

function hfun_add_bsky_comments(post_url::Vector{String})
    post = post_url[1]
    html = "
        <script src=\"../bsky-comments.js\"></script>
        <bsky-comments post=\"$(post)\"></bsky-comments>
    "
    return html
end

Now add the following to the end of your post markdown (data-bluesky-uri can be seen if you click "embed post" on any post, amoung other places):

{{ add_bsky_comments data-bluesky-uri_of_your_post_in_quotes }}

Which should give you:


MIT License Randy Boyes. Website built with Franklin.jl and the Julia programming language. Design inspired by The Monospace Web. Code for this website is available on Github.