Hugo: How to see posts dated in the future from localhost

Published: 2020-01-15 19:43:44 -0500 -0500

Reading time: 1 mins (102 words)

Tags: hugo

problem

I’m using Hugo to statically-generate my sites. During development (and while writing), I’d find it useful to be able to see my posts that are scheduled to release in the future (i.e. that have their date field set for some time in the future). How can I see those posts?

solution

To tell Hugo that you’d like to render pages even though their date hasn’t passed (which is the default behavior), you can add the -F flag to your command. So to run hugo on localhost while displaying posts dated in the future, you could run (via commandline): hugo serve -F

About the Ham

Hi I'm Hamilton and I wrote / built this! I like doing lots of things, but mostly I like to build (and then share those buildings). Some things I'm currently building: art, software, and prose. To stay up-to-date with my latest buildings, subscribe to my email list or follow one of my many other accounts. #buildit #shipit #justhamit

comments powered by Disqus