{"id":13614272,"url":"https://github.com/pengx17/logseq-plugin-link-preview","last_synced_at":"2025-03-16T19:32:46.257Z","repository":{"id":37114718,"uuid":"397549654","full_name":"pengx17/logseq-plugin-link-preview","owner":"pengx17","description":"Preview links in logseq","archived":false,"fork":false,"pushed_at":"2024-03-25T02:02:18.000Z","size":9850,"stargazers_count":119,"open_issues_count":26,"forks_count":17,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-12T19:13:45.315Z","etag":null,"topics":["logseq","plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/pengx17.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","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":"2021-08-18T09:47:20.000Z","updated_at":"2024-09-26T13:29:41.000Z","dependencies_parsed_at":"2024-01-07T00:07:13.398Z","dependency_job_id":null,"html_url":"https://github.com/pengx17/logseq-plugin-link-preview","commit_stats":null,"previous_names":[],"tags_count":42,"template":false,"template_full_name":"pengx17/logseq-plugin-template-react","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengx17%2Flogseq-plugin-link-preview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengx17%2Flogseq-plugin-link-preview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengx17%2Flogseq-plugin-link-preview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengx17%2Flogseq-plugin-link-preview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pengx17","download_url":"https://codeload.github.com/pengx17/logseq-plugin-link-preview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221667532,"owners_count":16860621,"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":["logseq","plugin"],"created_at":"2024-08-01T20:00:59.164Z","updated_at":"2024-10-27T11:11:05.971Z","avatar_url":"https://github.com/pengx17.png","language":"TypeScript","readme":"# Logseq Plugin Link Preview\n\nA simple plugin to show basic link information (based on [OpenGraph Protocol](https://ogp.me/)) for external links in Logseq.\n\nBy default when it is enabled, when you hovering any external link in Logseq, it will show the link preview.\nAlso this plugin will register a `Convert to Link Card` command for you to convert the link to a link card.\n\n![](hover-demo.png)\n\n## Features\n\n- Show link preview when hovering any external link in Logseq\n- Convert the link to a link card when you use the `Convert to Link Card` command\n- Cache the results locally\n- Light \u0026 dark theme\n\n## Demo\n\n![](./demo.gif)\n\n## How does this plugin work?\n\nThere are two modes of this plugin:\n- Hovering mode\n- Macro mode\n\nThe two modes are working very differently, but they codes are mostly shared.\n\n### Hovering Mode\n\nIt will register `mouseenter` and `mouseleave` events on all external links in the main document of Logseq. Note, in this step this plugin uses a unsafe `top` context of the main document, which might not work in the future.\n\nIn the listener, the plugin will extract the `href` attribute of the link and send a request to an API server to get the link information (the OpenGraph metadata).\n\nOnce the api returns with the link metadata (e.g., title, description, image), the plugin will\n\n- render them in the plugin iframe\n- resize the iframe and move its position to the hovering link\n\n### Macro Mode\n\nTypically, user will use slash command to create a custom renderer Marco `:linkpreview` with the URL as the argument\n\n```html\n{{renderer :linkpreview,https://google.com}}\n```\n\nWhen it is rendered, the `logseq.App.onMacroRendererSlotted` hook will fetch the link information from the API server and render it with `ReactDomServer.renderToString` method into the slot. The plugin will register the styles into the global context.\n","funding_links":[],"categories":["TypeScript","🔌 Plugins"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpengx17%2Flogseq-plugin-link-preview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpengx17%2Flogseq-plugin-link-preview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpengx17%2Flogseq-plugin-link-preview/lists"}