Update deployment site/preview gh pages#126
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Makefile to include specialized CI build targets (build-production and build-preview) and improves the setup target to use npm ci when lockfiles are present. Feedback was provided to remove draft and future content flags from the production build to ensure only published content is deployed, and to include the --cleanDestinationDir flag in both CI targets to prevent stale files from persisting between builds.
|
|
||
| ## CI: Build production site output | ||
| build-production: | ||
| HUGO_ENVIRONMENT=production HUGO_ENV=production hugo build -D --gc --buildFuture --minify $(if $(BASE_URL),--baseURL $(BASE_URL),) |
There was a problem hiding this comment.
The build-production target includes the -D (--buildDrafts) and --buildFuture flags. These flags are typically used for development or preview environments to include content that is still being worked on or scheduled for the future. For a production build, these should generally be omitted to ensure only published and current content is deployed. Additionally, this target is inconsistent with the build:production script in package.json, which does not include these flags. It is also recommended to include --cleanDestinationDir to ensure stale files from previous builds are removed.
HUGO_ENVIRONMENT=production HUGO_ENV=production hugo build --cleanDestinationDir --gc --minify $(if $(BASE_URL),--baseURL $(BASE_URL),)
There was a problem hiding this comment.
I used to render the draft examples. Another option could be to remove the draft:true from the content formatting examples, but I think they should render in the deployment.
Signed-off-by: Raunak Madan <madanraunak24@gmail.com>
ece3164 to
5297409
Compare
Notes for Reviewers
Signed commits