I believe your book is "Old Witch and the Polka-Dot Ribbon," by Wende
and Harry Devlin. I used to read this book aloud to my young
goddaughter in the 1970s. The ribbon mentioned in the book's title is
a special polka-dot prize ribbon that the town's fund-raising carnival
gives to the witch for "Most Original Cake." The recipe for the
witch's "magic nut cake" is included on the back of the book, and it
is a very tasty cake indeed (naturally, I had to bake it for the
little girl to whom I read the book).
This book is a sequel to the equally delightful "Old Black Witch," in
which we learn how Nicky and his mother first meet the 300-year-old
witch, who resides in the attic of the old house that they move into.
The witch is a good cook: the first book has a blueberry pancake
recipe on the back!
"When the kitchen is finally empty, Old Witch makes her own magic nut
cake to enter in the carnival's cake baking contest."
Amazon: Old Witch and the Polka-Dot Ribbon
If you'd like to purchase a used copy of "Old Witch and the Polka-Dot
Ribbon," here are some options:
ABEbooks Search Results
AddALL Rare, Used, and Out of Print Book Search
There's also a current eBay offering:
eBay: Old Witch and the Polka Dot Ribbon
I hope this is the right book! If it is not, or if anything is unclear
or incomplete, please request clarification; I'll be glad to offer
further assistance before you rate my answer.