{"id":26495475,"url":"https://github.com/alfredosalzillo/remark-react-liquid-tag","last_synced_at":"2026-04-07T07:46:06.590Z","repository":{"id":282684573,"uuid":"949334427","full_name":"alfredosalzillo/remark-react-liquid-tag","owner":"alfredosalzillo","description":"A remark plugin that allows the usage of liquid tags.","archived":false,"fork":false,"pushed_at":"2026-03-07T13:50:51.000Z","size":250,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-07T19:28:16.992Z","etag":null,"topics":["devto","liquid-tags","markdown","react","remark","remark-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/alfredosalzillo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["alfredosalzillo"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2025-03-16T08:02:38.000Z","updated_at":"2026-03-07T13:50:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"a0dfd483-a5ee-4325-828c-9ae7752ef90c","html_url":"https://github.com/alfredosalzillo/remark-react-liquid-tag","commit_stats":null,"previous_names":["alfredosalzillo/remark-react-liquid-tag"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alfredosalzillo/remark-react-liquid-tag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfredosalzillo%2Fremark-react-liquid-tag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfredosalzillo%2Fremark-react-liquid-tag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfredosalzillo%2Fremark-react-liquid-tag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfredosalzillo%2Fremark-react-liquid-tag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alfredosalzillo","download_url":"https://codeload.github.com/alfredosalzillo/remark-react-liquid-tag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfredosalzillo%2Fremark-react-liquid-tag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31504897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["devto","liquid-tags","markdown","react","remark","remark-plugin"],"created_at":"2025-03-20T10:52:00.282Z","updated_at":"2026-04-07T07:46:06.583Z","avatar_url":"https://github.com/alfredosalzillo.png","language":"TypeScript","funding_links":["https://github.com/sponsors/alfredosalzillo"],"categories":[],"sub_categories":[],"readme":"# remark-react-liquid-tag\n\nThis is a [remark](https://github.com/remarkjs/remark) plugin that allows the usage of liquid tags.\n\nThis idea came from the usage of liquid tags in [dev.to (DEV COMMUNITY)](https://dev.to/) platform for embedding services in markdowns. [This documented page](https://docs.dev.to/frontend/liquid-tags/) shows their idea behind liquid tags and the tags available.\n\n## Liquid tags\n\nLiquid tags are special elements to use in markdown. They are custom embeds that are added via a `{% %}` syntax. [Liquid](https://shopify.github.io/liquid/) is a templating language developed by Shopify.\n\n## Installation\n\n```bash\nnpm install remark-react-liquid-tag\n```\n\n## Usage\n\nThe plugin follows the [unified](https://github.com/unifiedjs/unified) ecosystem.\n\n### Example with react-markdown\n\nHere is an example using [react-markdown](https://github.com/remarkjs/react-markdown) to render markdown in React.\n\n```tsx\nimport React from 'react';\nimport Markdown from 'react-markdown';\nimport remarkReactLiquidTag, { RemarkReactLiquidTagProps } from 'remark-react-liquid-tag';\n\nconst LiquidTag: React.FC\u003cRemarkReactLiquidTagProps\u003e = (props) =\u003e {\n  switch (props.type) {\n    case 'youtube':\n      return (\n        \u003ciframe\n          width=\"560\"\n          height=\"315\"\n          src={`https://www.youtube.com/embed/${props.url}`}\n          title=\"YouTube video player\"\n          frameBorder=\"0\"\n          allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n          allowFullScreen\n        /\u003e\n      );\n    default:\n      return null;\n  }\n};\n\nconst markdown = `\n# Hello World\nThis is an example youtube video:\n{% youtube dQw4w9WgXcQ %}\n`;\n\nexport function App() {\n  return (\n    \u003cMarkdown\n      remarkPlugins={[\n        [remarkReactLiquidTag, { component: LiquidTag }],\n      ]}\n    \u003e\n      {markdown}\n    \u003c/Markdown\u003e\n  );\n}\n```\n\n### Example with unified + rehype-react\n\nHere is an example using [rehype-react](https://github.com/rehypejs/rehype-react) to render the markdown in React.\n\n\n```tsx\nimport * as prod from 'react/jsx-runtime';\nimport { renderToString } from 'react-dom/server';\nimport rehypeReact from 'rehype-react';\nimport remarkParse from 'remark-parse';\nimport remarkToRehype from 'remark-rehype';\nimport { unified } from 'unified';\nimport remarkReactLiquidTag, { RemarkReactLiquidTagProps } from 'remark-react-liquid-tag';\n\nconst LiquidTag: React.FC\u003cRemarkReactLiquidTagProps\u003e = (props) =\u003e {\n  switch (props.type) {\n    case 'youtube':\n      return (\n        \u003ciframe\n          width=\"560\"\n          height=\"315\"\n          src={`https://www.youtube.com/embed/${props.url}`}\n          title=\"YouTube video player\"\n          frameBorder=\"0\"\n          allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n          allowFullScreen\n        /\u003e\n      );\n    default:\n      return null;\n  }\n}\n\nconst markdown = `\n# Hello World\nThis is an example youtube video:\n{% youtube dQw4w9WgXcQ %}\n\nThis is a unsupported tag:\n{% unsupported_tag %}\n`;\n\nconst { result } = unified()\n  .use(remarkParse)\n  .use(remarkReactLiquidTag, {\n    component: LiquidTag,\n  })\n  .use(remarkToRehype)\n  .use(rehypeReact, prod)\n  .processSync(markdown);\n\n// ...\n```\n\n## Options\n\n- `component`: React component to render the liquid tag. It receives the following props:\n  - `type`: The type of the liquid tag (e.g., `youtube`).\n  - `url`: The main value/url of the liquid tag.\n  - `options`: Key-value pairs of additional options passed in the tag (e.g., `{% type url key=value %}`).\n  - `config`: Configuration specific to this tag type, passed via the `config` option.\n- `config`: An object where keys are tag types and values are configuration objects passed to the component.\n\n### Example with config and options\n\n```tsx\nconst { result } = unified()\n  .use(remarkParse)\n  .use(remarkReactLiquidTag, {\n    component: MyComponent,\n    config: {\n      youtube: {\n        autoplay: true\n      }\n    }\n  })\n  .use(remarkToRehype)\n  .use(rehypeReact, prod)\n  .processSync('{% youtube dQw4w9WgXcQ theme=dark %}');\n```\n\nIn this case, `MyComponent` will receive:\n- `type`: `'youtube'`\n- `url`: `'dQw4w9WgXcQ'`\n- `options`: `{ theme: 'dark' }`\n- `config`: `{ autoplay: true }`\n\n## TypeScript\n\nThe plugin is written in TypeScript and exports types for your components.\n\n```tsx\nimport { RemarkReactLiquidTagProps } from 'remark-react-liquid-tag';\n\ntype MyYoutubeConfig = {\n  autoplay: boolean;\n};\n\ntype MyYoutubeOptions = {\n  theme: string;\n};\n\nconst MyComponent: React.FC\u003cRemarkReactLiquidTagProps\u003cMyYoutubeOptions, MyYoutubeConfig\u003e\u003e = (props) =\u003e {\n  // ...\n};\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfredosalzillo%2Fremark-react-liquid-tag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falfredosalzillo%2Fremark-react-liquid-tag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfredosalzillo%2Fremark-react-liquid-tag/lists"}