5 ms·
I generate the Bookmarks [1] section of my static site from the public bookmarks in my Pinboard account. Since I host with Netlify, I've written a lightweight
by ftio 2y ago
I generate the Bookmarks [1] section of my static site from the public bookmarks in my Pinboard account.
Since I host with Netlify, I've written a lightweight Netlify function that looks at my Pinboard account for changes. If there are changes, it simply re-runs the static site build. During the build, Lektor, the static site generator, runs a custom plugin I've written that generates the link blog page from the Pinboard API.
Definitely more work than it was "worth", but as a person who doesn't get to write lots of code every day, it was a blast putting it all together.
1. https://www.ft.io/bookmarks/ https://www.ft.io/bookmarks/
- rednafi 2y agoThis pattern of: 1. polling for external changes somewhere 2. updating some pages on a static site (by incorporating the changes from step 1) and rebuilding it is incredibly powerful. It allows us to make a static site behave almost like a read-only dynamic one. There needs to be a name for this—it’s hard to discuss it without one.
- rmnclmnt 2y agoThis pattern is used all over the place, and for good reason (especially when people get their minds on combining CI/CD and static deployments). Simon Willison groked the name « Baked Data »: even though it was in the context of Datasette (which requires a backend to run but the SQLite db is embedded and read-only), it is pretty safe the term can be applied for static websites also!
- Macha 2y agoHasn't it already had a name for years? A headless CMS
- ggpsv 2y agoA bit like PESOS (Publish elsewhere, syndicate own site). I do this when archiving my Mastodon posts in my own static site [0]. [0]: https://garrido.io/notes/archiving-and-syndicating-mastodon-posts/ https://garrido.io/notes/archiving-and-syndicating-mastodon-...
- rednafi 2y agoPESOS is pretty good. I was aware of POSSE but not PESOS.
- dgl 2y agoOne name for it is PESOS[1] ("Publish Elsewhere, Syndicate (to your) Own Site"), although that doesn't necessitate it be static, but requiring it be static is mixing the implementation with the user experience anyway. [1]: https://indieweb.org/PESOS https://indieweb.org/PESOS
- syndicatedjelly 2y agoFetch?
- gwern 2y agoWhy is that not just 'transclusion' https://en.wikipedia.org/wiki/Transclusion https://en.wikipedia.org/wiki/Transclusion ? Except a special-case of transclusion: high latency and compile-time only. As opposed to doing it with JS dynamically; if Pinboard had an API, or even simply doesn't block frames with HTTP headers, you could simply dynamically call from the static site page to the other site, load the relevant HTML, and present it transcluded into the static site page. (This is how Gwern.net does a lot of stuff: everything from the Wikipedia/Github popups to transcluding other pages.)