On Shabbat Chol Hamo'ed (the Sabbath which falls on an intermediate day of the Feast of Tabernacles or Passover - ed.) we read the story of what happened after Chet Ha'egel (the sin of the Golden Calf) and Moshe's (Moses') requests to understand Hashem's (G-d's) ways and then to see His glory. This is followed by the commandment to Moshe to write new Luchot (Tablets) to replace the ones he broke. Only at the end of this story do we find a few pesukim (verses) that just briefly mention the Three Regalim (holidays).

So why do we read this whole story on Shabbat Chol Hamo'ed? What's the connection between what happened after Chet Ha'egel to the Three Regalim?