diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..f4cb3e0240 --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +serve: + hugo server \ + --disableFastRender \ + --buildDrafts \ + --buildFuture \ + --ignoreCache + --printI18nWarnings \ + --printMemoryUsage \ + --printPathWarnings \ + --printUnusedTemplates \ + --templateMetrics \ + --templateMetricsHints \ + --gc + +production-build: + git submodule update --init --recursive + hugo \ + --minify + npx -y pagefind --site public + +preview-build: + git submodule update --init --recursive + hugo \ + --baseURL $(DEPLOY_PRIME_URL) \ + --buildDrafts \ + --buildFuture \ + --minify + npx -y pagefind --site public \ No newline at end of file diff --git a/netlify.toml b/netlify.toml index 88ed32f16c..82a9c7912f 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,3 +1,7 @@ +[build] +publish = "public" +command = "make production-build" + [build.environment] NODE_VERSION = "18.16.1" HUGO_VERSION = "0.115.2" @@ -6,4 +10,10 @@ HUGO_VERSION = "0.115.2" HUGO_ENV = "production" [context.deploy-preview.environment] -HUGO_ENV = "preview" \ No newline at end of file +HUGO_ENV = "preview" + +[context.deploy-preview] +command = "make preview-build" + +[context.branch-deploy] +command = "make preview-build" \ No newline at end of file