Peel, then thinly and evenly slice the potatoes and onions. I use a mandoline to make it quick and easy.
Set aside 1 handful of the gruyere for the final topping of the boulangere.
Place a thin layer of potatoes into an ovenproof baking dish, then add a layer of onions and gruyere. Sprinkle in a little of the sage and black pepper.
Repeat the layers of potatoes, onions, cheese, sage, pepper.
Keep the reserved handful of cheese for after baking.
Pour the stock into the baking dish.
Place the dish into the oven and bake for 1 hour.
Add the reserved gruyere to the top of the boulangere potatoes, then return the dish to the oven, and bake for a further 20 minutes.