From f2e1027f40f55627bdaf86e8c95ab34296beb7b2 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Sun, 5 Nov 2023 19:35:14 -0600 Subject: [PATCH] create config for preview builds --- config/preview/hugo.toml | 1 + netlify.toml | 33 +++++++++++++++++++++++++++------ 2 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 config/preview/hugo.toml diff --git a/config/preview/hugo.toml b/config/preview/hugo.toml new file mode 100644 index 0000000..7dc856f --- /dev/null +++ b/config/preview/hugo.toml @@ -0,0 +1 @@ +baseURL = "https://preview--runtimeterrordev.netlify.app" \ No newline at end of file diff --git a/netlify.toml b/netlify.toml index 2f11133..b673131 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,16 +1,37 @@ [build] - command = """ - hugo --minify - npm i @torchlight-api/torchlight-cli - npx torchlight - """ publish = "public" [build.environment] HUGO_VERSION = "0.111.3" [context.production] - command = "hugo" + command = """ + hugo --minify + npm i @torchlight-api/torchlight-cli + npx torchlight + """ + +[context.preview] + command = """ + hugo --minify --environment preview + npm i @torchlight-api/torchlight-cli + npx torchlight + """ + [[headers]] + for = "/*" + [headers.values] + X-Robots-Tag = "noindex" + +[context.drafts] + command = """ + hugo --minify --environment drafts -D + npm i @torchlight-api/torchlight-cli + npx torchlight + """ + [[headers]] + for = "/*" + [headers.values] + X-Robots-Tag = "noindex" [[redirects]] from = "/*"