Threads for Deluvi

  1. 1

    Never heard of it before, but looks promising. I will give it a try!

    Is it possible to have webmentions as a comment seciton on a static website?

    1. 1

      You can, but like anything dynamic, you’d either need to implement the comments section in client-side JavaScript or else have some way of triggering your site to rebuild and redeploy whenever a new Webmention is posted.

      1. 1

        I’m doing that. My site is SSG that is built on my desktop and uploaded via good old rsync.

        I use this webmentions SaaS to collect my mentions and a client-side JS to fetch and display them. My design skills are limited, so you can have it looking much better than I did. This post has a lot of mentions at the end. The JS used is not minified and is at the end of the post, near line 152 if you want to check.

        Another cool service is bridgy which will send and collect mentions from silos and forward to your web site. I have it configured with my twitter and mastodon account. This way, I can have it send automatic tweets or toots when I post and also deliver replies and comments back to the original post.

        1. 1

          Yes, it’s possible with a dynamic webmention endpoint that somehow saves webmentions. I have such a dynamic endpoint that creates a file in a git repo, commits and pushes it. That triggers a pipeline to rebuild my blog with Hugo and then a link is displayed below the page which received the webmention.

          1. 1

            I have done it on my static website using webmention.io. I just pull on my personal computer regularly the updates from webmention.io and then I generates the comment section using some Hugo features. Shameless plug to my blog post explaining this

            1. 1

              There’s https://webmention.io/ or you can have a self-hosted service somewhere.

              1. 1

                I believe so. I know a couple of people who are running Hugo and have this. However, I would assume that that the comments are updated only when the site is regenerates, rather than on-the-fly like WP.

                1. 1

                  I use https://github.com/PlaidWeb/webmention.js to render my webmentions client-side so they’re always up to date, instead of needing to rebuild the site - I’ve written a bit more about it at https://www.jvt.me/posts/2019/06/30/client-side-webmentions/

              1. 3

                as always, feel free to submit feedback, criticism or issues!

                1. 3

                  Just some nitpicking on dependencies:

                  • When depending on a Git repository (as you do with your colored dependency), it is a good practice to point to a particular commit or tag using the rev or tag parameter instead of the branch, as the branch’s HEAD can change but a commit or tag can only point to only one specific state of the repository.
                  • When publishing a binary (executable) crate, it is a good practice to publish along the crate the Cargo.lock. You can find the reasoning on why you should publish this file in Cargo’s FAQ

                  I will try it later though! I always complained that some prompt frameworks are using scripting languages like Python or Ruby that have slow spin-up rate, so this project seems interesting and a cool way to customize my ugly and boring prompt.

                  1. 1

                    You kind of cover this but the Cargo.lock would capture the commit that the git dependency was at when the lock file was generated. So if the Cargo.lock was checked in everyone would build against the same commit.

                  2. 2

                    I already implemented a similar tool some months ago rusty-prompt, maybe you can get some inspiration out of it.

                    1. 1

                      sure! thanks for sharing!

                    2. 1

                      My bashes (both the one that comes with Mac OS and the latest 5.0.7 from brew) seem to cache PS1 somehow, making pista break quite a lot.

                      ➜  ~ /usr/local/bin/bash
                      bash-5.0$ PS1=$(pista)
                      ~
                      $ cd git
                      ~
                      $ PS1=$(pista)
                      ~/git
                      $ cd nomad
                      ~/git
                      $ PS1=$(pista)
                      ~/g/nomad master ·
                      $
                      
                      1. 2

                        Try PS1='$(pista)'. What’s happening is that pista is getting called once, when you set PS1, and then never again. The single quotes force PS1 to literally contain the expansion, which then gets expanded (and thereby call pista) each time the prompt is printed

                        1. 2

                          Ohhh, no :( Of course. I feel like I should step far away from the computer now.

                          1. 3

                            looks like the installation instructions were faulty!

                            1. 1

                              Oh, whew, thanks for that. Now I feel slightly less stupid :)

                        2. 1

                          cant seem to replicate this, but it looks like a PROMPT_COMMAND thing.

                        3. 1

                          @hostname is nice to have if $SSH_CONNECTION is set.

                          1. 4

                            i have plans to extend pista into a library, so you could build your own prompts with pista’s functions. maybe ill add a hostname function :^)