Allows you to use Mastodon and Bluesky comments on your Lustre blog hexdocs.pm/chilp/
blog gleam lustre indieweb mastodon bluesky comments
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

:3


Signed-off-by: MLC Bloeiman <mar@strawmelonjuice.com>

+22 -8
+5 -6
README.md
··· 8 8 ``` 9 9 ## Usage 10 10 11 - You can use chilp as any Lustre component, the main module has an easy builder which allows you to input typed `Anchors` (links to posts from which we fetch comments) instead of using attributes. If you prefer, you could also use `widget.element()` or create a Chilp widget yourself using element.element. As long as `widget.register()` is ran Chilp should be able to pick it up. 11 + Make sure to call `chilp.register()` in your `main()` function, and after that you can use `chilp.widget()` anywhere you want to place the comment widget! It'll take two labeled options, `bluesky:` and `mastodon:`, which take 'anchors' to the posts you want to load your comments from. 12 12 13 - Also see [Styling Chilp](https://hexdocs.pm/chilp/styling.html)! 13 + Do your Chilp widgets look a little bleak? See [Styling Chilp](https://hexdocs.pm/chilp/styling.html)! 14 + 15 + Further documentation can be found at <https://hexdocs.pm/chilp>. 14 16 15 17 ### Examples 16 18 ··· 23 25 - `hide`: Commenting `-chilp hide` on a comment hides that particular comment and all it's children. 24 26 - `silence`: Commenting `-chilp silence` on a comment shows that particular comment but hides all it's children. 25 27 26 - Further documentation can be found at <https://hexdocs.pm/chilp>. 27 - 28 28 ## Development 29 29 30 30 ```sh 31 31 cd examples/lustre_chilp_app 32 32 bun install 33 - tailwindcss -i ./src/input.css -o ./assets/styled.css 34 - gleam run -m lustre/dev start 33 + just run-example 35 34 ```
+2 -1
docs/changelog.md
··· 5 5 Change in one line: 6 6 > Chilp v1 was wrapping itself in a Lustre component, Chilp v2 _is_ a Lustre component. 7 7 8 - - Add Bluesky as a anchor option, equal to Mastodon. 8 + - Add Bluesky as a anchor option, equal to Mastodon. Chilp is now able to fetch from Misskey and Sharkey instances as well. 9 9 - Change styling to use DaisyUI by default, allowing it to adapt to your site's theme, or for you to just match on classes if you want to use your own css. 10 10 - Remove DOMPurify dependency, instead Chilp now parses and rebuilds Mastodon post content by itself, to keep dangerous code from sneaking in. 11 11 - Introduced commands, allowing to hide certain comments from view even if they abide community guidelines for the backing platform. 12 + - Chilp now only comes in a singular, documented module. This keeps the chaos out!
+15 -1
docs/styling.md
··· 1 1 # Styling the Chilp widget 2 2 3 + - [With DaisyUI](#daisyui) 4 + - [With Oat](#oat) 5 + - [With vanilla CSS](#vanilla) 6 + 7 + 8 + 3 9 ## With DaisyUI 4 10 11 + <a id="daisyui"></a> 12 + 5 13 Chilp v2 or newer does not inline it's own CSS, but instead comes with [DaisyUI](https://daisyui.com/)-compatible classes, this means you can optimally have Chilp adapted to your own site's theme. 6 14 7 15 Do note, Tailwind may need to be pointed to the classes Chilp uses, so make sure to either source it on the `./dist` folder AFTER build, or ··· 13 21 14 22 Try something like the above. You could of course also point to the `build/dev/javascript`, especially if you work with a path dependency (in which case the `widget.gleam` file won't be in `./build/`). 15 23 16 - ## Styling with OatUI 24 + 25 + 26 + ## Styling with Oat 27 + 28 + <a id="oat"></a> 17 29 18 30 [Oat](https://oat.ink/) is an ultra-lightweight HTML + CSS, semantic UI component library with no framework, build, or other dependencies. OatUI can style most of Chilp out of the box without even including it's javascript. Chilp applies mostly semantic HTML and has some extra attributes added for enhanced compatibility with Oat. 19 31 ··· 74 86 But with this, Oat can fully style Chilp widgets as well! 75 87 76 88 ## Styling with vanilla CSS 89 + 90 + <a id="vanilla"></a> 77 91 78 92 If you'd like to not use DaisyUI or OatUI, styling the widget yourself is very viable, all elements are queryable using css classes. 79 93