{"id":21508067,"url":"https://github.com/anarion80/siyuan-oembed","last_synced_at":"2025-04-23T23:07:06.161Z","repository":{"id":260817151,"uuid":"877425649","full_name":"anarion80/siyuan-oembed","owner":"anarion80","description":"SiYuan plugin to embed links using Oembed format and save links as beautiful bookmark cards","archived":false,"fork":false,"pushed_at":"2024-12-02T09:26:46.000Z","size":889,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-23T23:07:00.767Z","etag":null,"topics":["bookmarks","links","oembed","siyuan","siyuan-note","siyuan-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anarion80.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"anarion"}},"created_at":"2024-10-23T16:18:07.000Z","updated_at":"2025-04-06T12:07:38.000Z","dependencies_parsed_at":"2024-11-02T19:27:07.828Z","dependency_job_id":"4b134312-7a79-4cee-b76b-f06e587366ae","html_url":"https://github.com/anarion80/siyuan-oembed","commit_stats":null,"previous_names":["anarion80/siyuan-oembed"],"tags_count":1,"template":false,"template_full_name":"siyuan-note/plugin-sample-vite-svelte","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anarion80%2Fsiyuan-oembed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anarion80%2Fsiyuan-oembed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anarion80%2Fsiyuan-oembed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anarion80%2Fsiyuan-oembed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anarion80","download_url":"https://codeload.github.com/anarion80/siyuan-oembed/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250528731,"owners_count":21445516,"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":["bookmarks","links","oembed","siyuan","siyuan-note","siyuan-plugin"],"created_at":"2024-11-23T20:45:30.658Z","updated_at":"2025-04-23T23:07:06.143Z","avatar_url":"https://github.com/anarion80.png","language":"TypeScript","funding_links":["https://buymeacoffee.com/anarion"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg alt=\"SiYuan\" src=\"https://raw.githubusercontent.com/anarion80/siyuan-oembed/refs/heads/main/icon.png\"\u003e\n\u003cbr\u003e\n\u003cem\u003eSiYuan Oembed and Ghost-style bookmark cards\u003c/em\u003e\n\u003cbr\u003e\u003cbr\u003e\n\u003ca title=\"Releases\" target=\"_blank\" href=\"https://github.com/anarion80/siyuan-oembed/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/anarion80/siyuan-oembed?style=flat-square\u0026color=9CF\"\u003e\u003c/a\u003e\n\u003ca title=\"Downloads\" target=\"_blank\" href=\"https://github.com/anarion80/siyuan-oembed/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/downloads/anarion80/siyuan-oembed/total.svg?style=flat-square\u0026color=blueviolet\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n\u003ca title=\"AGPLv3\" target=\"_blank\" href=\"https://www.gnu.org/licenses/agpl-3.0.txt\"\u003e\u003cimg src=\"https://img.shields.io/github/license/anarion80/siyuan-oembed\"\u003e\u003c/a\u003e\n\u003ca title=\"Code Size\" target=\"_blank\" href=\"https://github.com/anarion80/siyuan-oembed\"\u003e\u003cimg src=\"https://img.shields.io/github/languages/code-size/anarion80/siyuan-oembed.svg?style=flat-square\u0026color=yellow\"\u003e\u003c/a\u003e\n\u003ca title=\"GitHub Pull Requests\" target=\"_blank\" href=\"https://github.com/anarion80/siyuan-oembed/pulls\"\u003e\u003cimg src=\"https://img.shields.io/github/issues-pr-closed/anarion80/siyuan-oembed.svg?style=flat-square\u0026color=FF9966\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n\u003ca title=\"GitHub Commits\" target=\"_blank\" href=\"https://github.com/anarion80/siyuan-oembed/commits/main\"\u003e\u003cimg src=\"https://img.shields.io/github/commit-activity/m/anarion80/siyuan-oembed.svg?style=flat-square\"\u003e\u003c/a\u003e\n\u003ca title=\"Last Commit\" target=\"_blank\" href=\"https://github.com/anarion80/siyuan-oembed/commits/main\"\u003e\u003cimg src=\"https://img.shields.io/github/last-commit/anarion80/siyuan-oembed.svg?style=flat-square\u0026color=FF9900\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n\u003ca href=\"https://buymeacoffee.com/anarion\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/pachadotdev/buymeacoffee-badges/main/bmc-yellow.svg\" alt=\"Buy Me Coffee\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"README.md\"\u003eEnglish\u003c/a\u003e | \u003ca href=\"README_pl_PL.md\"\u003ePolish\u003c/a\u003e | \u003ca href=\"README_zh_CN.md\"\u003e简体中文\u003c/a\u003e\n\u003c/p\u003e\n\n## ✨ Plugin description\n\nThis is a plugin that has two main functionalities:\n\n1. It allows to convert links (URLs) to their embedded representation according to [Oembed](https://oembed.com/) format. When supported by a given site, a link can be converted directly to a photo or video, or any other format provided by the site.\n\n2. It allows to convert links (URLs) to a nice bookmark card representation based on [Ghost CMS](https://ghost.org/) [Bookmark cards](https://ghost.org/help/cards/#bookmark). I reused implementation from my [Astro Simply](https://github.com/anarion80/astro-simply) theme.\n\nBoth funcionalities are independent of each other, so you can covert to either oembed or bookmark card.\n\nIt works like this:\n\n![preview.png](preview.png)\n\n![example usage](asset/example_usage.gif)\n\n\u003e :exclamation:\n\u003e Unfortunately, X.com (formerly Twitter) embeds are script-based, and I haven't figured out yet why the script is not executed despite having script execution enabled in settings (see: [my post on Liuyun.io](https://liuyun.io/article/1729866570402)) :exclamation:\n\u003e\n\u003e Similarly, Facebook/Instagram requires an API_KEY to be able to embed their content\n\nDue to the above, oembed has perhaps limited usability and I might need to add an explicit Twitter conversion for tweets.\n\n## 🖱 Usage\n\nThe plugin provides three ways to convert the links:\n\n1. Slash commands with associated hot-keys:\n   - `/oembed`, `/Oembed`, `/oe`, `Ctrl`+`Shift`+`O` for Oembed conversion\n   - `/card`, `/bookmark`, `/bk`, `Ctrl`+`Shift`+`C` for bookmark card conversion\n  ![Slash Commands](asset/slashcommands.png)\n\n2. Block Icon Menu after selecting one or more blocks:\n  ![Block Icon Menu](asset/blockiconmenu.png)\n\n3. Separate toolbar icons:\n  ![Toolbar icons](asset/toolbar.png)\n\n\u003e :exclamation:\n\u003e Both conversions are supported as a toggle. Triggering action once converts the link to oembed or bookmark card. Triggering it the second time converts back to the ususal link.\n\n## ⚙ Settings\n\nThere are several configuration settings available for the plugin:\n\n| Setting | Explanation |\n| ---: | ----------- |\n|`Catch clipboard links`|Automatically transform links pasted from clipboard to either oembed or bookmark card (:exclamation: Not implemented yet!)|\n|`Select paste conversion`|Which conversion to automatically apply when pasting a link from clipboard (:exclamation: Not implemented yet!)|\n|`Enable debug`|Enable verbose debug to help with troubleshooting|\n|`Blocklist` for oembed|List of domains to skip conversion for (one per line) (:exclamation: Not implemented yet!)|\n|`Blocklist` for bookmark cards|List of domains to skip conversion for (one per line) (:exclamation: Not implemented yet!)|\n|`Custom CSS for bookmark cards`|Ability to enter custom CSS to style the bookmark cards. All `kg-card-*` and `kg-bookmark-*` classes can be styled.|\n\n## ⌛ Issues and limitations\n\nCurrently, the plugin uses [openGraphScraperLite](https://github.com/jshemas/openGraphScraperLite) for scraping Open Graph and Twitter metadata. It is the only one that I found that gets bundled with the plugin without issues. It is also causing big plugin size (over 3MB uncompressed). [Metascraper](https://github.com/microlinkhq/metascraper) is much better, but unfortunately doesn't work in client environment of the plugin.\n\nAnother option would be to use [Microlink API](https://api.microlink.io) to get link metadata, but that is limited to 50 requests/day in the free plan.\n\nAnother limitation is the already mentioned lack of Facebook/Instagram embeddings via oembed, and lack of script execution to provide proper CSS for X.com (Twitter).\n\n## 🙏 Acknowledgements\n\n- [SiYuan](https://github.com/siyuan-note/siyuan) for the usefull tool. I used some of their functions directly as they were not exposed via API.\n- [SiYuan plugin sample with vite and svelte](https://github.com/siyuan-note/plugin-sample-vite-svelte) - very useful base for plugin development.\n- [Zuoqiu-Yingyi and their siyuan-packages-monorepo](https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo).\n- [SiYuan Plugin development guide](https://docs.siyuan-note.club/en/guide/plugin/sy-plugin-dev-quick-start.html?utm_source=liuyun.io) - very useful intro to plugin development.\n- [Zuoez02 and their plugin-card-link](https://github.com/zuoez02/siyuan-plugin-card-link).\n- [Frostime and their siyuan-dailynote-today](https://github.com/frostime/siyuan-dailynote-today).\n- [Hqweay and their siyuan-hqweay-go](https://github.com/hqweay/siyuan-hqweay-go).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanarion80%2Fsiyuan-oembed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanarion80%2Fsiyuan-oembed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanarion80%2Fsiyuan-oembed/lists"}