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

SiteContents are not reset when md parsing and loader type are in library. #108

Open
Freymaurer opened this issue Jun 21, 2022 · 0 comments

Comments

@Freymaurer
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Hello I am writing a class library for my markdig extensions, markdown parsing and core generator components. Everything is in this project and i noticed some strange behavior I don't really understand.

The hot reload triggers and markdown parsing happens and everything gets added to SiteContents on the loader level, but when i check the number of values of that specific type i see, that everytime i trigger the hot reload it just adds the new version to the existing values. And because i use Seq.find to find the correct html for my generator it returns the first fitting value, which is the old and not updated one.

So my question is: How does this happen? Can i somehow avoid this behavior?

Describe the solution you'd like
It works exactly the same way it works without using a library.

Describe alternatives you've considered
I started using Seq.findBack to always return the newest addition, but this will lead to problems if i hot reload to often as the values will not get dumped this way.
I could also initiate a new SiteContext in my loader, some very superficial testing showed that this could work, but there might be issues i am not aware of.

Additional context

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