French
Melt the butter in a large heavy pot over medium heat. Add the thinly sliced onions with a pinch of salt and cook for 10 minutes, stirring, until soft.
Add the sugar, lower the heat and cook for 45 minutes, stirring often, until the onions are deep golden brown.
Stir in the chopped garlic and the flour for 1 minute, then pour in the wine and simmer until it has reduced by half.
Add the broth, thyme and bay leaf and simmer for 30 minutes. Remove the herbs and season with salt and pepper.
Heat the oven to 230C. Toast the baguette slices until dry and golden.
Ladle the soup into ovenproof bowls, top each with a slice of toasted baguette and the grated Gruyere, and bake for 8 to 10 minutes, until the cheese is melted and browned.