I have a working Hugo site. It has hundreds of pages. However there are times I just want to regenerate a single page.
I know that hugo is super fast, often rendering hundreds or thousands of pages per second. However in this case I’m trying to optimize a particular situation and the fastest I can regenerate this one particular page the better.
If the one page you wish to render has no references to, or dependencies on, other pages then you could do something like…
│ ├── post-1.md <-- we only want to render this page
│ ├── post-2.md
│ └── post-3.md
│ └── config.toml
disableKinds = ['home','section','taxonomy','term','404','RSS','sitemap']
source = 'content'
target = 'content'
includeFiles = ['/posts/post-1.md']
Then build the site with:
hugo -e one-page
But if this one page would normally contain references to other pages (related content, menu items that are attached to page references, etc.) the rendered page will be incomplete.