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

Make front-matter plugin not polluting vm.config #548

Closed
petrjoachim opened this issue Jun 20, 2018 · 1 comment
Closed

Make front-matter plugin not polluting vm.config #548

petrjoachim opened this issue Jun 20, 2018 · 1 comment

Comments

@petrjoachim
Copy link
Contributor

I'm trying to use front-matter plugin (with cooperation with my own plugin) and it seem that line mentioned below does this:

  • on first page with front-matter it creates some content to the vm.config with Docsify.util.merge
  • on second page without front-matter (or with different front-matter dict content) it does another Docsify.util.merge but
  • as a result of this operation vm.config is polluted with all the state from first page, so when something is missing in the second page front-matter it still appears as if the value is set

Docsify.util.merge(vm.config, attributes.config)

@petrjoachim
Copy link
Contributor Author

I'd like to implement the update but I'm not sure of the way of doing it. There are 2 things coming to my mind:

  • remember previous state of vm.config and then make new one (in the second run) from the previous pinned version merged with new attributes.config
  • move front-matter somewhere else like:
    • vm.config.front-matter
    • vm.front-matter
    • or similar

Which one is preferable here? ?I'd go for the second one since this plugin is not mentioned in docs so there is chance no one is actually depending on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant