{"id":16176683,"url":"https://github.com/baranwang/rspress-plugin-changelog","last_synced_at":"2025-05-15T03:15:50.647Z","repository":{"id":257819787,"uuid":"869943258","full_name":"baranwang/rspress-plugin-changelog","owner":"baranwang","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-21T03:17:41.000Z","size":73,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-21T06:24:07.856Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/baranwang.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":"2024-10-09T07:07:23.000Z","updated_at":"2024-10-21T03:17:45.000Z","dependencies_parsed_at":"2024-10-10T05:42:35.444Z","dependency_job_id":null,"html_url":"https://github.com/baranwang/rspress-plugin-changelog","commit_stats":null,"previous_names":["baranwang/rspress-plugin-changelog"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baranwang%2Frspress-plugin-changelog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baranwang%2Frspress-plugin-changelog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baranwang%2Frspress-plugin-changelog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baranwang%2Frspress-plugin-changelog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baranwang","download_url":"https://codeload.github.com/baranwang/rspress-plugin-changelog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237937879,"owners_count":19390546,"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":[],"created_at":"2024-10-10T05:01:24.515Z","updated_at":"2025-02-09T10:31:10.634Z","avatar_url":"https://github.com/baranwang.png","language":"TypeScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Rspress Plugins"],"readme":"# rspress-plugin-changelog\n\nThis plugin generates changelog pages for your Rspress documentation site, fetching release information from GitHub and GitLab repositories.\n\n## Installation\n\n```bash\nnpm install rspress-plugin-changelog\n```\n\n## Usage\n\nAdd the plugin to your Rspress configuration file:\n\n```javascript\nimport { defineConfig } from 'rspress/config';\nimport { pluginChangelog } from 'rspress-plugin-changelog';\n\nexport default defineConfig({\n  plugins: [\n    pluginChangelog({\n      fetchOnDev: true,\n      items: [\n        {\n          type: 'github-releases',\n          routePath: '/github-changelog',\n          repo: 'owner/repo',\n          title: 'GitHub Changelog',\n        },\n        {\n          type: 'gitlab-releases',\n          routePath: '/gitlab-changelog',\n          repo: 'owner/repo',\n          title: 'GitLab Changelog',\n        },\n      ],\n      routePrefix: 'changelog',\n      addSidebar: 'auto',\n    }),\n  ],\n});\n```\n\n## Features\n\n- Fetches release information from GitHub and GitLab repositories.\n- Generates changelog pages with customizable routes.\n- Supports [custom templates](#custom-templates) for rendering changelogs.\n- Automatically adds changelog links to the sidebar (configurable).\n- Allows fetching data in both production and development environments.\n\n## Configuration Options\n\nThe `pluginChangelog` function accepts an options object with the following properties:\n\n- `fetchOnDev` (boolean, default: `true`): Whether to fetch changelog data in development environment.\n- `items` (array): An array of changelog items to fetch and display.\n- `routePrefix` (string, default: `'changelog'`): The prefix for changelog routes.\n- `addSidebar` (boolean | 'auto', default: `'auto'`): Whether to add changelog links to the sidebar.\n\n### Changelog Item Options\n\nEach item in the `items` array can have the following properties:\n\n#### GitHub Releases\n\n- `type`: 'github-releases'\n- `routePath` (string): The route path for this changelog.\n- `repo` (string): The GitHub repository in the format `'owner/repo'`.\n- `title` (string, optional): The title for the changelog page.\n- `templatePath` (string, optional): Custom template path for rendering the changelog.\n\n#### GitLab Releases\n\n- `type`: 'gitlab-releases'\n- `routePath` (string): The route path for this changelog.\n- `repo` (string): The GitLab repository in the format `'owner/repo'`.\n- `baseUrl` (string, optional): The GitLab domain. Defaults to 'https://gitlab.com'.\n- `headers` (object, optional): Additional headers for GitLab API requests.\n- `title` (string, optional): The title for the changelog page.\n- `templatePath` (string, optional): Custom template path for rendering the changelog.\n\n## Custom Templates\n\nThis plugin supports custom templates for rendering changelogs. Templates use Handlebars syntax and have access to two main variables:\n\n- `title`: The title of the changelog (either specified in the configuration or defaulting to the repository name).\n- `releases`: An array of release objects from GitHub or GitLab.\n\nTo use a custom template, specify the `templatePath` in your changelog item configuration.\n\n### Template Variables\n\n#### GitHub Releases\n\n[Release Object](https://docs.github.com/en/rest/releases/releases)\n\n#### GitLab Releases\n\n[Release Object](https://docs.gitlab.com/ee/api/releases)\n\n## Showcase\n\n- [iRingo](https://nsringo.github.io/)\n- [DualSubs](https://dualsubs.github.io/)\n- [BiliUniverse](https://biliuniverse.io/)\n\n## Demo\n\n- https://github.com/baranwang/rspress-plugin-changelog/blob/main/rspress.config.ts#L13-L41\n- https://baranwang.github.io/rspress-plugin-changelog/demo/rspack\n\n## License\n\n[MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaranwang%2Frspress-plugin-changelog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaranwang%2Frspress-plugin-changelog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaranwang%2Frspress-plugin-changelog/lists"}