An Rspress plugin to seamlessly load remote markdown file (e.g. README.md) onto your website.
npm install rspress-plugin-remote-page -D
// rspress.config.ts
import { remotePage } from 'rspress-plugin-remote-page';
import { defineConfig } from 'rspress/config';
export default defineConfig({
plugins: [remotePage({
pages: [
{
// This input will load README.md of https://github.com/ulivz/rspress-plugin-remote-page
remotePath: 'ulivz/rspress-plugin-remote-page',
routePath: '/readme',
}
]
})],
});
// rspress.config.ts
import { remotePage } from 'rspress-plugin-remote-page';
import { defineConfig } from 'rspress/config';
export default defineConfig({
plugins: [remotePage({
pages: [
{
remotePath: 'https://github.com/ulivz/rspress-plugin-remote-page/blob/main/README.md',
routePath: '/readme',
}
]
})],
});
// rspress.config.ts
import { remotePage } from 'rspress-plugin-remote-page';
import { defineConfig } from 'rspress/config';
export default defineConfig({
plugins: [remotePage({
pages: [
{
remotePath: 'https://path/to/your-markdown.md',
routePath: '/readme',
}
]
})],
});
- Type:
string
- Required:
true
Specify the remote path, it could be:
- Github repository shortcut, e.g.
web-infra-dev/deep-dive-into-tla
; - Github repository repo path, e.g.
https://github.com/web-infra-dev/deep-dive-into-tla
; - Github path, e.g.
https://github.com/web-infra-dev/deep-dive-into-tla/blob/master/README-zh-CN.md
; - Any remote path, e.g.
https://path/to/your-markdown.md
;
- Type:
string
- Default:
master
Specify the generated route.
- Support remote
*.mdx
. - Enhance logging output.
- Enhance error handling when fetching pages.
MIT © ULIVZ