Skip to content

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

Open
@Freymaurer

Description

@Freymaurer

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions