{"id":22160204,"url":"https://github.com/daviddarnes/bluesky-post","last_synced_at":"2025-10-05T06:50:46.119Z","repository":{"id":265541748,"uuid":"880240518","full_name":"daviddarnes/bluesky-post","owner":"daviddarnes","description":"A Web Component to display Bluesky posts and their metadata","archived":false,"fork":false,"pushed_at":"2024-12-07T08:28:51.000Z","size":14,"stargazers_count":25,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-21T05:13:39.570Z","etag":null,"topics":["components","customelement","customelements","webcomponent","webcomponents"],"latest_commit_sha":null,"homepage":"https://daviddarnes.github.io/bluesky-post/demo.html","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daviddarnes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"buy_me_a_coffee":"daviddarnes"}},"created_at":"2024-10-29T11:28:06.000Z","updated_at":"2025-05-31T06:44:01.000Z","dependencies_parsed_at":"2024-11-29T21:29:36.588Z","dependency_job_id":null,"html_url":"https://github.com/daviddarnes/bluesky-post","commit_stats":null,"previous_names":["daviddarnes/bluesky-post"],"tags_count":1,"template":false,"template_full_name":"daviddarnes/component-template","purl":"pkg:github/daviddarnes/bluesky-post","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviddarnes%2Fbluesky-post","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviddarnes%2Fbluesky-post/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviddarnes%2Fbluesky-post/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviddarnes%2Fbluesky-post/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daviddarnes","download_url":"https://codeload.github.com/daviddarnes/bluesky-post/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviddarnes%2Fbluesky-post/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267145507,"owners_count":24042650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["components","customelement","customelements","webcomponent","webcomponents"],"created_at":"2024-12-02T04:06:44.385Z","updated_at":"2025-10-05T06:50:41.071Z","avatar_url":"https://github.com/daviddarnes.png","language":"HTML","funding_links":["https://buymeacoffee.com/daviddarnes"],"categories":[],"sub_categories":[],"readme":"# `bluesky-post`\n\nA Web Component to display Bluesky posts and their metadata.\n\n**[Demo](https://daviddarnes.github.io/bluesky-post/demo.html)** | **[Custom template demo](https://daviddarnes.github.io/bluesky-post/demo-custom-template.html)** | **[Further reading](https://darn.es/bluesky-post-web-component/)**\n\n## Examples\n\nGeneral usage example:\n\n```html\n\u003cscript type=\"module\" src=\"bluesky-post.js\"\u003e\u003c/script\u003e\n\n\u003cbluesky-post\u003e\n  \u003ca href=\"https://bsky.app/profile/darn.es/post/3l7m6ivb6ha2q\"\u003e\n    Discuss on Bluesky\n  \u003c/a\u003e\n\u003c/bluesky-post\u003e\n```\n\nExample using a custom template:\n\n```html\n\u003cscript type=\"module\" src=\"bluesky-post.js\"\u003e\u003c/script\u003e\n\n\u003ctemplate id=\"bluesky-post-template\"\u003e\n  \u003cblockquote data-key=\"content\"\u003e\u003c/blockquote\u003e\n\u003c/template\u003e\n\n\u003cbluesky-post\u003e\n  \u003ca href=\"https://bsky.app/profile/darn.es/post/3l7m6ivb6ha2q\"\u003e\n    Discuss on Bluesky\n  \u003c/a\u003e\n\u003c/bluesky-post\u003e\n```\n\nExample using a more complex custom template:\n\n```html\n\u003cscript type=\"module\" src=\"bluesky-post.js\"\u003e\u003c/script\u003e\n\n\u003ctemplate id=\"bluesky-post-template\"\u003e\n  \u003cdl\u003e\n    \u003cdt\u003eReposts\u003c/dt\u003e\n    \u003cdd data-key=\"repostCount\"\u003e\u003c/dd\u003e\n    \u003cdt\u003eReplies\u003c/dt\u003e\n    \u003cdd data-key=\"replyCount\"\u003e\u003c/dd\u003e\n    \u003cdt\u003eLikes\u003c/dt\u003e\n    \u003cdd data-key=\"likeCount\"\u003e\u003c/dd\u003e\n  \u003c/dl\u003e\n  \u003ca data-key=\"url\"\u003e\n    View original post from \u003cstrong data-key=\"username\"\u003e\u003c/strong\u003e on \u003cstrong data-key=\"hostname\"\u003e\u003c/strong\u003e\n  \u003c/a\u003e\n\u003c/template\u003e\n\n\u003cbluesky-post\u003e\n  \u003ca href=\"https://bsky.app/profile/darn.es/post/3l7m6ivb6ha2q\"\u003e\n    Discuss on Bluesky\n  \u003c/a\u003e\n\u003c/bluesky-post\u003e\n```\n\n## Features\n\nThis Web Component allows you to:\n\n- Turn a regular Bluesky post link into a quoted Bluesky post\n- Surface the post metadata alongside the post, e.g. reply count, repost count, like count\n- Use a custom template for all instances of the component on the page using a `data-key=\"name\"` data attributes\n- Use a custom template for specific instances using the `template` attribute\n- Retrieve nested data using the `data-key` attribute and typical JavaScript key referencing, e.g. `data-key=\"record.text\"`\n\n## Installation\n\nYou have a few options (choose one of these):\n\n1. Install via [npm](https://www.npmjs.com/package/@daviddarnes/bluesky-post): `npm install @daviddarnes/bluesky-post`\n1. [Download the source manually from GitHub](https://github.com/daviddarnes/bluesky-post/releases) into your project.\n1. Skip this step and use the script directly via a 3rd party CDN (not recommended for production use)\n\n### Usage\n\nMake sure you include the `\u003cscript\u003e` in your project (choose one of these):\n\n```html\n\u003c!-- Host yourself --\u003e\n\u003cscript type=\"module\" src=\"bluesky-post.js\"\u003e\u003c/script\u003e\n```\n\n```html\n\u003c!-- 3rd party CDN, not recommended for production use --\u003e\n\u003cscript\n  type=\"module\"\n  src=\"https://www.unpkg.com/@daviddarnes/bluesky-post@1.0.0/bluesky-post.js\"\n\u003e\u003c/script\u003e\n```\n\n```html\n\u003c!-- 3rd party CDN, not recommended for production use --\u003e\n\u003cscript\n  type=\"module\"\n  src=\"https://esm.sh/@daviddarnes/bluesky-post@1.0.0\"\n\u003e\u003c/script\u003e\n```\n\n### Using a custom template\n\nThe default template for the component looks like this:\n\n```html\n\u003cfigure\u003e\n  \u003cblockquote data-key=\"record.text\"\u003e\u003c/blockquote\u003e\n  \u003cfigcaption\u003e\n    \u003ccite\u003e\n      \u003ca data-key=\"url\"\u003e@\u003cspan data-key=\"username\"\u003e\u003c/span\u003e\u003c/a\u003e\n    \u003c/cite\u003e\n    \u003cdl\u003e\n      \u003cdt\u003eReposts\u003c/dt\u003e\n      \u003cdd data-key=\"repostCount\"\u003e\u003c/dd\u003e\n      \u003cdt\u003eReplies\u003c/dt\u003e\n      \u003cdd data-key=\"replyCount\"\u003e\u003c/dd\u003e\n      \u003cdt\u003eLikes\u003c/dt\u003e\n      \u003cdd data-key=\"likeCount\"\u003e\u003c/dd\u003e\n    \u003c/dl\u003e\n  \u003c/figcaption\u003e\n\u003c/figure\u003e\n```\n\nHowever you can customise the template by using a `\u003ctemplate\u003e` element with an `id` of `bluesky-post-template`, which will be used for every instance of the component on the page. Here's an example which just exposes the vanity metrics of the Bluesky post as a `\u003cdl\u003e`:\n\n```html\n\u003ctemplate id=\"bluesky-post-template\"\u003e\n  \u003cdl\u003e\n    \u003cdt\u003eReposts\u003c/dt\u003e\n    \u003cdd data-key=\"repostCount\"\u003e\u003c/dd\u003e\n    \u003cdt\u003eReplies\u003c/dt\u003e\n    \u003cdd data-key=\"replyCount\"\u003e\u003c/dd\u003e\n    \u003cdt\u003eLikes\u003c/dt\u003e\n    \u003cdd data-key=\"likeCount\"\u003e\u003c/dd\u003e\n  \u003c/dl\u003e\n\u003c/template\u003e\n```\n\nYou can also use different templates on the same page by using the `template` attribute to target `\u003ctemplate\u003e` elements with a specific `id`:\n\n```html\n\u003ctemplate id=\"custom-template\"\u003e\n  \u003ca data-key=\"record.text, url\"\u003e\u003c/a\u003e\n\u003c/template\u003e\n\n\u003cbluesky-post template=\"custom-template\"\u003e\n  \u003ca href=\"https://bsky.app/profile/darn.es/post/3l7m6ivb6ha2q\"\u003e\n    Discuss on Bluesky\n  \u003c/a\u003e\n\u003c/bluesky-post\u003e\n```\n\nData is applied using a `data-key` data attribute. The value of this attribute should correspond to a data point within a [Bluesky public post API response](https://docs.bsky.app/docs/api/app-bsky-feed-get-posts). The official Bluesky documentation has [an example of a status response here](https://docs.bsky.app/docs/api/app-bsky-feed-get-posts#responses).\n\n_Note that for `\u003ca\u003e` and `\u003cimg\u003e` elements the value won't be applied to it's content if the string being returned starts with `http` and instead will be applied to the `href` and `src` attributes respectively._\n\nCheck out the [custom template demo](https://daviddarnes.github.io/bluesky-post/demo-custom-template.html) as well as [the source code](https://github.com/daviddarnes/bluesky-post/blob/main/demo-custom-template.html) for reference.\n\n## Credit\n\nWith thanks to the following people:\n\n- [Zach Leatherman](https://zachleat.com) for inspiring this [Web Component repo template](https://github.com/daviddarnes/component-template)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaviddarnes%2Fbluesky-post","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaviddarnes%2Fbluesky-post","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaviddarnes%2Fbluesky-post/lists"}