Skip to content

Commit

Permalink
netlify with context
Browse files Browse the repository at this point in the history
  • Loading branch information
goodroot committed Dec 12, 2024
1 parent 211e2ea commit 831a233
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ 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()

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",
Expand Down Expand Up @@ -139,6 +140,7 @@ const config = {
[
"@docusaurus/preset-classic",
{

blog: false,
docs: {
include: ["**/*!(.partial).{md,mdx}"],
Expand Down
7 changes: 7 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}

0 comments on commit 831a233

Please sign in to comment.