To get the result from a Dataview query to be shown when publish, requires it to be persisted. I currently know of two plugins do this: Dataview Serializer and Dataview Publisher. I’ve not used either, since I don’t publish stuff related to my vaults, but I do believe the Dataview Publisher looks the best and most promising.