Disable vuepress homepage and redirect to guide

1.2k Views Asked by At

I've just started looking at vuepress to use as a documentation generator to one of my open-source tools (https://github.com/redskap/swagger-brake) and the tools seems to be the right fit for the job.

However, I'm kind of struggling with setting up the proper configuration. I've followed the official docs, and the base project is alright. The only thing I want to change is to get rid of the "homepage" when loading the root URL and have users being redirected to the "guide".

Hope you have some ideas. Thanks!

2

There are 2 best solutions below

0
On BEST ANSWER

Reviewing the github link it needs to be updated with the following.

index.md should have the intended homepage you'd like to select from the sidebar.

e.g.

# Introduction
...

// remove frontmatter.yaml

In your config.js

    nav: [
      {
        text: 'Introduction',
        link: '/',
      }
    ],
    sidebar: [
      '/',
   ]       // otherLinks

Examples

0
On

You can use the plugin vuepress-plugin-redirect to redirect page.

e.g.

import { redirectPlugin } from 'vuepress-plugin-redirect';

export default defineUserConfig({
  plugins: [
    redirectPlugin({
      config: {
        '/index.html': '/guide/',
      },
    }),
  ],
})