Reddit co-founder Alexis Ohanian turned 34 on Monday, the day that Williams also recaptured the women's top ranking.
Williams' social media post showed the 35-year-old sitting on a beach lounger in a black two-piece swimsuit that revealed her growing baby bump.
"My Dearest Baby, You gave me the strength I didn't know I had," Williams wrote on her Instagram account, as she hinted that she expects to be back playing next year.
Williams is due to give birth in September, the month she turns 36 years old.
More From This Section
In December, Williams announced her engagement to tech entrepreneur Ohanian and last week revealed she is expecting her first child and will not play again this year.
Kelly Bush Novak, Williams' publicist, had said this week that the US star "looks forward to returning in 2018" and that was echoed by her coach Patrick Mouratoglou.
Overtaking Australia's Margaret Court for the all-time record of 24 Grand Slam singles crowns -- Williams is on 23 -- is also "a determining factor" in her motivation to plough on, the Frenchman said.