Change content github refs to sourcehut

This commit is contained in:
David Eisinger
2024-10-09 11:53:23 -04:00
parent a3bf348202
commit f3c2effb71
3 changed files with 16 additions and 16 deletions

View File

@@ -83,7 +83,7 @@ I made a few updates to the website this month:
[13]: /elsewhere
[14]: https://nokogiri.org/
[15]: /elsewhere/pandoc-a-tool-i-use-and-like/
[16]: https://github.com/dce/davideisinger.com/blob/e1d0590025fd8636c378748491fe11a0ba00b1ff/bin/renumber
[16]: https://git.sr.ht/~dce/davideisinger.com/tree/cc3cebb27c7d0340747a9ba0a406da2ad475a634/bin/renumber
I'm really happy with Hugo -- it's simple but flexible enough to handle every challenge I've thrown at it. Building and maintaining this site has brought me a lot of joy this year.

View File

@@ -42,7 +42,7 @@ Most of what I post on this site are these monthly [dispatches][6] that start wi
[6]: /tags/dispatch/
[7]: https://elliotjaystocks.com/blog/2023-in-review
[8]: https://github.com/dce/davideisinger.com
[8]: https://git.sr.ht/~dce/davideisinger.com
I tried treating the full-size images with ImageMagick on the command line and then letting Hugo resize the result, but I wasn't happy with the output -- there's still way too much data in a dithered full-sized image, so when you scale it down, it just looks like a crappy black-and-white photo. Furthermore, the encoding wasn't properly optimizing for two-color images and so the files were larger than I wanted.
@@ -95,13 +95,13 @@ end
I made a [standalone image server][13] using [Sinatra][14] and [MiniMagick][15] that takes a path to an encrypted image and an optional geometry string and returns a dithered image. I won't paste the entire file here but it's really pretty short and simple.
[13]: https://github.com/dce/davideisinger.com/blob/bf5238dd56b6dfe9ee2f1d629d017b2075750663/bin/dither/dither.rb
[13]: https://git.sr.ht/~dce/davideisinger.com/tree/bf5238dd56b6dfe9ee2f1d629d017b2075750663/bin/dither/dither.rb
[14]: https://sinatrarb.com/
[15]: https://github.com/minimagick/minimagick
If you want to run it yourself, copy down everything in the [`bin/dither`][16] folder and then run the following:
[16]: https://github.com/dce/davideisinger.com/tree/bf5238dd56b6dfe9ee2f1d629d017b2075750663/bin/dither
[16]: https://git.sr.ht/~dce/davideisinger.com/tree/bf5238dd56b6dfe9ee2f1d629d017b2075750663/bin/dither
```sh
@@ -157,7 +157,7 @@ Adjust for your needs, but the gist is:
2. Use `resources.GetRemote` to fetch the image
3. Display as appropriate
[17]: https://github.com/dce/davideisinger.com/blob/2cda4b8f4e98bb9df84747da283d13075aac4d41/themes/v2/layouts/shortcodes/dither.html
[17]: https://git.sr.ht/~dce/davideisinger.com/tree/2cda4b8f4e98bb9df84747da283d13075aac4d41/themes/v2/layouts/shortcodes/dither.html
Use it like this:
@@ -191,21 +191,21 @@ The blacks will still show as black, but the whites will now be the background c
### 6. Update the deploy workflow
This site uses GitHub Actions to deploy on pushes to the `main` branch, and we need to make a few updates to our workflow to generate the static site with dithered images:
This site uses [sourcehut][19] builds to deploy on pushes to the `main` branch, and we need to make a few updates to our workflow to generate the static site with dithered images:
* Add the secret key as an Actions Secret
* Add the decryption key as a secret
* Add workflow steps to
* Install Ruby and the required Gem dependencies
* Write the secret key to a file
* Start the dither server as a background task (i.e. with `&`)
* Start the dither server as a background task (using `rackup` with the `-D` option)
* Add the `DITHER_SERVER` environment variable to the build step so that Hugo knows where to find it
[Here's the deploy workflow for this site][19] for reference.
[Here's the deploy workflow for this site][20] for reference.
[19]: https://github.com/dce/davideisinger.com/blob/901c8baad1f60a65910b387b20c8bcd0ea402c0b/.github/workflows/deploy.yml
[19]: https://sourcehut.org/
[20]: https://git.sr.ht/~dce/davideisinger.com/tree/main/.build.yml
***
This was super fun to build, and I'm really happy with [the result][20]. It makes the local authoring and deploy processes a bit more complicated since we have to run the separate image server, but I think the result is worth it. Hope you found this interesting, and please [reach out](mailto:hello@davideisinger.com) if you have any thoughts or questions.
This was super fun to build, and I'm really happy with [the result][21]. It makes the local authoring and deploy processes a bit more complicated since we have to run the separate image server, but I think the result is worth it. Hope you found this interesting, and please [reach out](mailto:hello@davideisinger.com) if you have any thoughts or questions.
[20]: /journal/dispatch-12-february-2024/
[21]: /journal/dispatch-12-february-2024/

View File

@@ -12,8 +12,8 @@ references:
I write all these posts in Markdown, and I tend to include a lot of links. I use numbered [reference-style links][1] and I like the numbers to be in sequential order. ([Here's the source of this post][2] to see what I mean.) I wrote a [Ruby script][3] to automate the process of renumbering links when I add a new one, and as mentioned in [last month's dispatch][4], I spent some time iterating on it to work with some new posts containing code blocks that I'd imported into my [Elsewhere][5] section.
[1]: https://www.markdownguide.org/basic-syntax/#reference-style-links
[2]: https://github.com/dce/davideisinger.com/blob/main/content/journal/keep-markdown-links-in-order-with-mdrenum/index.md?plain=1
[3]: https://github.com/dce/davideisinger.com/blob/e1d0590025fd8636c378748491fe11a0ba00b1ff/bin/renumber
[2]: https://git.sr.ht/~dce/davideisinger.com/tree/main/content/journal/keep-markdown-links-in-order-with-mdrenum/index.md?view-source
[3]: https://git.sr.ht/~dce/davideisinger.com/tree/cc3cebb27c7d0340747a9ba0a406da2ad475a634/bin/renumber
[4]: /journal/dispatch-9-november-2023/
[5]: /elsewhere
@@ -81,7 +81,7 @@ auto-format = true
formatter = { command = "mdrenum" , args = ["--stdin"] }
```
[22]: https://git.sr.ht/~dce/mdrenum/tree/42c28c1e4b964ebc348a2fef54daa3be51824a90/item/src/cli.ts#L6-15
[22]: https://git.sr.ht/~dce/mdrenum/tree/42c28c1e4b964ebc348a2fef54daa3be51824a90/src/cli.ts#L6-15
This totally works, and I'll say that it's uniquely satisfying to save a document and see the link numbers get instantly reordered properly. I've done it probably 100 times in the course of writing this post.