From dc6d9c2fac8f49d5e459f05d6007a44dae99e0d7 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Wed, 1 Jul 2020 14:05:11 +0200 Subject: [PATCH] Auto-infer nightly state from branch --- website/gatsby-config.js | 4 ++++ website/meta/site.json | 1 - website/package.json | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/website/gatsby-config.js b/website/gatsby-config.js index aacc25545..837634e5a 100644 --- a/website/gatsby-config.js +++ b/website/gatsby-config.js @@ -14,6 +14,9 @@ const models = require('./meta/languages.json') const universe = require('./meta/universe.json') const DEFAULT_TEMPLATE = path.resolve('./src/templates/index.js') +const NIGHTLY_BRANCHES = ['spacy.io-develop'] + +const isNightly = !!+process.env.SPACY_NIGHTLY || NIGHTLY_BRANCHES.includes(process.env.BRANCH) module.exports = { siteMetadata: { @@ -22,6 +25,7 @@ module.exports = { sidebars, ...models, universe, + nightly: isNightly, }, plugins: [ diff --git a/website/meta/site.json b/website/meta/site.json index 24de8e603..8b8424f82 100644 --- a/website/meta/site.json +++ b/website/meta/site.json @@ -8,7 +8,6 @@ "companyUrl": "https://explosion.ai", "repo": "explosion/spaCy", "modelsRepo": "explosion/spacy-models", - "nightly": true, "social": { "twitter": "spacy_io", "github": "explosion" diff --git a/website/package.json b/website/package.json index afa0ff239..353cffe00 100644 --- a/website/package.json +++ b/website/package.json @@ -52,6 +52,7 @@ "scripts": { "build": "gatsby build", "dev": "gatsby develop", + "dev:nightly": "BRANCH=spacy.io-develop npm run dev", "lint": "eslint **", "clear": "rm -rf .cache", "test": "echo \"Write tests! -> https://gatsby.app/unit-testing\""