Home

Awesome

rspress-plugin-changelog

This plugin generates changelog pages for your Rspress documentation site, fetching release information from GitHub and GitLab repositories.

Installation

npm install rspress-plugin-changelog

Usage

Add the plugin to your Rspress configuration file:

import { defineConfig } from 'rspress/config';
import { pluginChangelog } from 'rspress-plugin-changelog';

export default defineConfig({
  plugins: [
    pluginChangelog({
      fetchOnDev: true,
      items: [
        {
          type: 'github-releases',
          routePath: '/github-changelog',
          repo: 'owner/repo',
          title: 'GitHub Changelog',
        },
        {
          type: 'gitlab-releases',
          routePath: '/gitlab-changelog',
          repo: 'owner/repo',
          title: 'GitLab Changelog',
        },
      ],
      routePrefix: 'changelog',
      addSidebar: 'auto',
    }),
  ],
});

Features

Configuration Options

The pluginChangelog function accepts an options object with the following properties:

Changelog Item Options

Each item in the items array can have the following properties:

GitHub Releases

GitLab Releases

Custom Templates

This plugin supports custom templates for rendering changelogs. Templates use Handlebars syntax and have access to two main variables:

To use a custom template, specify the templatePath in your changelog item configuration.

Template Variables

GitHub Releases

Release Object

GitLab Releases

Release Object

Showcase

Demo

License

MIT License