Skip to content

About additional pages #69

Answered by yzx9
zRains asked this question in Q&A
Mar 4, 2021 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Upd: https://vuepress2.netlify.app/advanced/cookbook/adding-extra-pages.html#adding-extra-pages

I ran into the same problem. Currently, I think there is not a particular API for creating additional page. So, I use onInitialized hook to achieve it. However, I can't create a homepage that has a special path: { path: '/' }. It works well in dev mode, but take a bug in buiding mode.

import { createPage, PageOptions } from "@vuepress/core"

export const theme: Theme = (themeOptions, app) => {
  return {
    onInitialized : async (app: App) => {
      const option: PageOptions = {
        path: "/about.html",
        frontmatter: {
          layout: "About",
        },
      }
      const page = 

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@zRains
Comment options

@meteorlxy
Comment options

Answer selected by meteorlxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants