Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

content property of additionalPages is not working #1050

Closed
1 task done
mya-ake opened this issue Nov 27, 2018 · 2 comments
Closed
1 task done

content property of additionalPages is not working #1050

mya-ake opened this issue Nov 27, 2018 · 2 comments
Labels
type: bug Something isn't working

Comments

@mya-ake
Copy link

mya-ake commented Nov 27, 2018

  • I confirm that this is a issue rather than a question.

Bug report

Version

1.0.0-alpha.24

Steps to reproduce

I tried plugin api while looking at the document of additionalpages(https://vuepress.vuejs.org/plugin/option-api.html#additionalpages).

It works with the filePath property, but it does not work with the content property.

The repository is https://github.com/mya-ake/vuepress-plugin-additionalPages-sample

What is expected?

I want this to work.

additionalPages: [
  {
    path: '/test/',
    content: '# Test Page',
  },
]

What is actually happening?

Route exists but a blank page is displayed.

Other relevant information

  • Your OS: macOS Mojave 10.14.1
  • Node.js version: 10.12.0
  • Browser version: Google Chrome(70.0.3538.102)
  • Is this a global or local install? local
  • Which package manager did you use for the install? yarn
@mya-ake
Copy link
Author

mya-ake commented Nov 28, 2018

This is because the content is not added to temporarily created page-components.js.
https://github.com/vuejs/vuepress/blob/master/packages/%40vuepress/core/lib/internal-plugins/pageComponents.js

This is a suggestion.

  1. Page._filePath is undefined
  2. Save Page._content in .temp directory (e.g. /.temp/internal/pages/<key>.md)
  3. Add the generated path to page-components.js

What do you think of this?

If there is no problem implement it and issue a pull request.

@ulivz ulivz added type: enhancement Request to enhance an existing feature type: bug Something isn't working and removed type: enhancement Request to enhance an existing feature labels Nov 29, 2018
@ulivz ulivz closed this as completed in 4f505a8 Nov 29, 2018
@ulivz
Copy link
Member

ulivz commented Nov 29, 2018

Thanks for the report, fixed at 4f505a8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants