{"id":14990183,"url":"https://github.com/dpecos/mastodon-comments","last_synced_at":"2025-04-07T11:04:42.236Z","repository":{"id":183181733,"uuid":"669737159","full_name":"dpecos/mastodon-comments","owner":"dpecos","description":"Webcomponent that embeds a Mastodon's toot conversation in a HTML page","archived":false,"fork":false,"pushed_at":"2025-02-18T15:43:21.000Z","size":187,"stargazers_count":86,"open_issues_count":1,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-31T10:08:54.386Z","etag":null,"topics":["comments","mastodon","webcomponent"],"latest_commit_sha":null,"homepage":"https://danielpecos.com/2022/12/25/mastodon-as-comment-system-for-your-static-blog/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dpecos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2023-07-23T09:07:51.000Z","updated_at":"2025-03-26T01:08:09.000Z","dependencies_parsed_at":"2025-01-03T01:14:26.548Z","dependency_job_id":"fe0f936a-c103-476e-bff1-0de7753b8198","html_url":"https://github.com/dpecos/mastodon-comments","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":0.09090909090909094,"last_synced_commit":"5dc1dd3043f2e9ebef88aeeb03dd8bacfb0d25a2"},"previous_names":["dpecos/mastodon-comments"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpecos%2Fmastodon-comments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpecos%2Fmastodon-comments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpecos%2Fmastodon-comments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpecos%2Fmastodon-comments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dpecos","download_url":"https://codeload.github.com/dpecos/mastodon-comments/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640461,"owners_count":20971557,"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","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":["comments","mastodon","webcomponent"],"created_at":"2024-09-24T14:19:40.244Z","updated_at":"2025-04-07T11:04:42.197Z","avatar_url":"https://github.com/dpecos.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# mastodon-comments\n\n`mastodon-comments` is a [webcomponent](https://developer.mozilla.org/en-US/docs/Web/API/Web_Components) that will embed a Mastodon's toot conversation in a website.\n\nThis webcomponent is explained in detail in the [following blog post](https://danielpecos.com/2022/12/25/mastodon-as-comment-system-for-your-static-blog/), where you can see a live example as well.\n\n## Characteristics\n\n- Implemented as a standard web component, easy to integrate\n- Lazy-loads the toot conversation, only when the component is part of the viewport\n\n## Styling the component\n\nThese are the default values that the component exposes as CSS vars (no need to specify them if you are happy with the current values):\n\n```css\nmastodon-comments {\n  --font-color: #5d686f;\n  --font-size: 1.0rem;\n\n  --block-border-width: 1px;\n  --block-border-radius: 3px;\n  --block-border-color: #ededf0;\n  --block-background-color: #f7f8f8;\n\n  --comment-indent: 40px;\n  --comment-padding: 20px;\n}\n```\n\n## Example\n\nInclude the following lines in the head of your HTML:\n\n```html\n\u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/dompurify/2.4.1/purify.min.js\" integrity=\"sha512-uHOKtSfJWScGmyyFr2O2+efpDx2nhwHU2v7MVeptzZoiC7bdF6Ny/CmZhN2AwIK1oCFiVQQ5DA/L9FSzyPNu6Q==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"\u003e\u003c/script\u003e\n\u003clink rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css\"\u003e\n```\n\nthen just use `mastodon-comments` tag to point to the appropiate mastodon toot as shown below:\n\n```html\n\u003cmastodon-comments host=\"fosstodon.org\" user=\"dpecos\" tootId=\"109574160582937075\" style=\"width : 1024px\"\u003e\u003c/mastodon-comments\u003e\n```\n\nYou can see a full example here: [Example embedding a toot into a HTML](./example/index.html)\n\n![mastodon-comments](./docs/mastodon-comments.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpecos%2Fmastodon-comments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdpecos%2Fmastodon-comments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpecos%2Fmastodon-comments/lists"}