{"id":18024005,"url":"https://github.com/lete114/cardlink","last_synced_at":"2025-08-25T07:16:38.867Z","repository":{"id":44332465,"uuid":"500122299","full_name":"lete114/CardLink","owner":"lete114","description":"为页面上的超链接生成卡片式链接 | Generate card-based links for hyperlinks on the page","archived":false,"fork":false,"pushed_at":"2024-04-11T16:28:44.000Z","size":172,"stargazers_count":36,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-09T02:53:36.541Z","etag":null,"topics":["card","cardlink","javascript","link"],"latest_commit_sha":null,"homepage":"https://Lete114.github.io/CardLink/","language":"JavaScript","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/lete114.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":"2022-06-05T14:36:11.000Z","updated_at":"2025-06-11T09:46:53.000Z","dependencies_parsed_at":"2024-10-30T07:46:46.007Z","dependency_job_id":null,"html_url":"https://github.com/lete114/CardLink","commit_stats":{"total_commits":30,"total_committers":1,"mean_commits":30.0,"dds":0.0,"last_synced_commit":"9b15631bada583b20215745d1c640b86827c2d11"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lete114/CardLink","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lete114%2FCardLink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lete114%2FCardLink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lete114%2FCardLink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lete114%2FCardLink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lete114","download_url":"https://codeload.github.com/lete114/CardLink/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lete114%2FCardLink/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272022262,"owners_count":24860149,"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-08-25T02:00:12.092Z","response_time":1107,"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":["card","cardlink","javascript","link"],"created_at":"2024-10-30T07:11:38.610Z","updated_at":"2025-08-25T07:16:38.837Z","avatar_url":"https://github.com/lete114.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"right\"\u003e\n  Language:\n  English\n  \u003ca title=\"中文\" href=\"/README_CN.md\"\u003e中文\u003c/a\u003e\n\u003c/div\u003e\n\n\u003ch1 align=\"center\"\u003e\u003ca href=\"https://github.com/Lete114/CardLink\" target=\"_blank\"\u003eCardLink\u003c/a\u003e\u003c/h1\u003e\n\u003cp align=\"center\"\u003eGenerate card-based links for hyperlinks on the page\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/Lete114/CardLink/releases/\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/cardlink?logo=npm\" alt=\"Version\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/Lete114/visitor-badge\"\u003e\u003cimg src=\"https://visitor-badge.imlete.cn/?pageID=github.Lete114.CardLink\" alt=\"visitor_badge\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/Lete114/CardLink/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/cardlink?color=FF5531\" alt=\"MIT License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Installation\n\nUsing npm:\n\n```bash\nnpm install cardlink --save\n```\n\nUsing CDN:\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/cardlink\"\u003e\u003c/script\u003e\n\n\u003c!-- Only use parseer --\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/cardlink/dist/parse.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  /**\n   * Get info\n   * @param {String} html String type html\n   * @param {String} link Website address\n   * @returns {{ title: string; link: string; icon: string }} Website info\n   */\n  cardLinkParse(html, link)\n\u003cscript\u003e\n```\n\n## Usage\n\nModules\n\n```js\nimport cardLink from 'cardlink' // or const cardLink = require('cardlink')\n\n// Only use parseer\nimport cardLinkParse from 'cardlink/parse' // or const cardLinkParse = require('cardlink/parse')\n```\n\nBrowser\n\n1. Usage\n\n```html\n\u003cscript\u003e\n  cardLink(document.querySelectorAll('article a[target=_blank]'))\n\u003c/script\u003e\n```\n\n2. Usage\n\n```html\n\u003cscript\u003e\n  // Set the cardlink property for the specified a tag, and finally call cardLink()\n  document.querySelectorAll('article a[target=_blank]').forEach((el) =\u003e {\n    el.setAttribute('cardlink', '')\n  })\n\n  // OR\n  document.querySelector('a#example').setAttribute('cardlink', '')\n\n  // By default, card links are generated for all `a[cardlink]` on the page\n  cardLink()\n\u003c/script\u003e\n```\n\n## Problems\n\nSince this is a front-end request for HTML, some sites may have cross-domain (CORS) issues, so `cardLink` allows you to use a proxy server to request HTML from the target site\n\n```html\n\u003cscript\u003e\n  // Note: cardLink sends requests to the proxy server only when cross-domain requests occur (thus reducing the pressure on the proxy server)\n  // Preset the proxy server before executing cardLink\n  cardLink.server = 'https://api.allorigins.win/raw?url='\n\n  cardLink(document.querySelectorAll('article a[target=_blank]'))\n\u003c/script\u003e\n```\n\n## Options API\n\n### cardLink(nodes)\n\nType: `NodeList`\n\ndefault: `document.querySelectorAll('a[cardlink]')`\n\nBy default, card links are generated for all `a[cardlink]` on the page\n\n## Design Sketch\n\n![card-link](https://user-images.githubusercontent.com/48512251/176334068-9eaaefeb-baa1-4a45-8dd8-7d0cbe6c6f29.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flete114%2Fcardlink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flete114%2Fcardlink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flete114%2Fcardlink/lists"}