{"id":16775013,"url":"https://github.com/sinanbekar/next-github-source","last_synced_at":"2026-05-09T02:07:29.111Z","repository":{"id":61923655,"uuid":"555987524","full_name":"sinanbekar/next-github-source","owner":"sinanbekar","description":"[WIP] Use GitHub repo as CMS in Next.js (similar Hashnode's Github as source)","archived":false,"fork":false,"pushed_at":"2022-10-23T15:28:28.000Z","size":52,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-05T05:24:04.491Z","etag":null,"topics":["cms","markdown","nextjs","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/next-github-source","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/sinanbekar.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}},"created_at":"2022-10-22T20:07:33.000Z","updated_at":"2022-10-23T15:20:46.000Z","dependencies_parsed_at":"2022-10-23T16:00:52.065Z","dependency_job_id":null,"html_url":"https://github.com/sinanbekar/next-github-source","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sinanbekar/next-github-source","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanbekar%2Fnext-github-source","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanbekar%2Fnext-github-source/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanbekar%2Fnext-github-source/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanbekar%2Fnext-github-source/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sinanbekar","download_url":"https://codeload.github.com/sinanbekar/next-github-source/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanbekar%2Fnext-github-source/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005645,"owners_count":26083940,"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-10-10T02:00:06.843Z","response_time":62,"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":["cms","markdown","nextjs","typescript"],"created_at":"2024-10-13T06:50:44.555Z","updated_at":"2025-10-11T00:11:05.600Z","avatar_url":"https://github.com/sinanbekar.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# next-github-source\n\nUse GitHub repo as CMS in Next.js (similar Hashnode's Github as source)\n\n\u003e **Warning** This package is early in development. Do NOT use in production environment.\n\n## 🚀 Quick Start\n\n```bash\nnpm install next-github-source\n```\n\n`lib/githubSourceClient.js`\n\n```js\nimport { createClient } from \"next-github-source\";\n\nexport const client = createClient({\n  repo: {\n    remote: `https://github.com/Hashnode/Hashnode-source-from-github-template`,\n  },\n  pattern: [`**`, \"!README.md\"], // list all except README.md\n});\n```\n\n`pages/index.js`\n\n```js\nimport Link from \"next/link\";\nimport { client } from \"../../lib/githubSourceClient\";\n\nexport const getStaticProps = async () =\u003e {\n  const posts = await client.getAllEntries();\n\n  return {\n    props: { posts },\n  };\n};\n\nexport default function Posts({ posts }) {\n  return (\n    \u003cdiv\u003e\n      {posts.map((post, idx) =\u003e (\n        \u003cLink key={idx} href={`/posts/${post.slug}`}\u003e\n          \u003ca\u003e\n            [{post.source}]({post.slug})\n          \u003c/a\u003e\n        \u003c/Link\u003e\n      ))}\n    \u003c/div\u003e\n  );\n}\n```\n\n`pages/posts/[slug].js`\n\n```js\nimport { client } from \"../../lib/githubSourceClient\";\n\nexport const getStaticPaths = async () =\u003e {\n  return {\n    paths: await client.getAllEntryPaths(),\n    fallback: false,\n  };\n};\n\nexport const getStaticProps = async ({ params }) =\u003e {\n  const post = await client.getEntry(params.slug);\n\n  return {\n    props: { post },\n  };\n};\n\nexport default function Post({ post }) {\n  return \u003cdiv\u003e{JSON.stringify(post)}\u003c/div\u003e;\n}\n```\n\n## TODO\n\n- [ ] Examples with `next-mdx-remote`\n- [ ] On-demand revalidation support with examples\n- [ ] Matter support with types \u0026 validation\n- [ ] High test coverage\n- [ ] Docs\n\n## License\n\n[MIT](./LICENSE) License © 2022 [Sinan Bekar](https://github.com/sinanbekar)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinanbekar%2Fnext-github-source","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinanbekar%2Fnext-github-source","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinanbekar%2Fnext-github-source/lists"}