Routing in VuePress
Since VuePress is powered by Vue.js, all of Vue’s libraries work as well. In fact, Vue Router is included and running out-of-the-box so there is no need to add that yourself. Let’s create another page and use Vue Router to link the two together.
First, go ahead and copy the root README.md
file. Once copied, create a new folder inside of the root directory. Remember, the directory name will be the name of the route. So for an example, a folder called, about-me
will render the localhost:8080/about-me/
route. For this, let’s create a directory called, page-2
. However, you can name this anything you like. This chapter, however, will refer to this page as page-2
.
Inside of page-2
, paste the README.md
file. All index files must be named README.md
. You are welcome to change as much as you’d like to this to differentiate it from the other page.
You now have two pages. If you visit the route in your browser window (localhost:8080/page-2) you should...