This works for block themes, but unfortunately this folder gets deleted when GeneratePress updates. I could use another solution for this (like Child Theme), but I like this solution better in itself. Is there a solution so that the folder is not deleted during a theme update?
whenever a Theme is updated, WordPress overwrites the entire folder, it’s not something we can change.
You would need to use a child theme or a plugin.