From 831a233f9981564789c53510d85a1b77b70f415b Mon Sep 17 00:00:00 2001 From: goodroot <9484709+goodroot@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:23:15 -0800 Subject: [PATCH] netlify with context --- docusaurus.config.js | 4 +++- netlify.toml | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index afda4745..2ced3fc3 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -5,6 +5,7 @@ import dotenv from "dotenv" const ssrTemplate = require("./src/internals/ssr.template") const customFields = require("./src/config/customFields") const path = require("path") +const isPreviews = process.env.NETLIFY && process.env.CONTEXT === 'deploy-preview' dotenv.config() @@ -12,7 +13,7 @@ const config = { title: "QuestDB", tagline: "QuestDB is the fastest open source time series database", url: `https://${customFields.domain}`, - baseUrl: '/docs/', + baseUrl: isPreviews ? '/' : '/docs/', baseUrlIssueBanner: false, favicon: "/images/favicon.webp", organizationName: "QuestDB", @@ -139,6 +140,7 @@ const config = { [ "@docusaurus/preset-classic", { + blog: false, docs: { include: ["**/*!(.partial).{md,mdx}"], diff --git a/netlify.toml b/netlify.toml index 219105c6..a4d42b8c 100644 --- a/netlify.toml +++ b/netlify.toml @@ -658,3 +658,10 @@ Cache-Control = "public, max-age=31536000, immutable" for = "*.css" [headers.values] Cache-Control = "public, max-age=31536000, immutable" + +[[redirects]] +from = "/docs/*" +to = "/:splat" +status = 200 +force = true +conditions = {Context = "deploy-preview"}