Marinate the trout with lemon juice and zest. Refrigerate until using.
Julienne the onion and put in an oven dish. Add the blueberries and half of the butter. Season with salt and pepper and bake for 15 minutes.
Take the dish out of the oven and put the marinated trout in it. Add the remaining butter and bake for 10 minutes. Take out, flip the trout, and bake for 10 more minutes.