mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 18:26:30 +03:00
Convert file to .mjs
to be used by Node process
This commit is contained in:
parent
1ed59fd680
commit
9b17299bd6
|
@ -1,11 +0,0 @@
|
||||||
const site = require('./site.json')
|
|
||||||
|
|
||||||
const domain = process.env.BRANCH || site.domain
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
domain,
|
|
||||||
siteUrl: `https://${domain}`,
|
|
||||||
nightly: site.nightlyBranches.includes(domain),
|
|
||||||
legacy: site.legacy || !!+process.env.SPACY_LEGACY,
|
|
||||||
binderBranch: domain,
|
|
||||||
}
|
|
14
website/meta/dynamicMeta.mjs
Normal file
14
website/meta/dynamicMeta.mjs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import site from './site.json' assert { type: 'json' }
|
||||||
|
|
||||||
|
export const domain = process.env.BRANCH || site.domain
|
||||||
|
export const siteUrl = `https://${domain}`
|
||||||
|
export const nightly = site.nightlyBranches.includes(domain)
|
||||||
|
export const legacy = site.legacy || !!+process.env.SPACY_LEGACY
|
||||||
|
export const binderBranch = domain
|
||||||
|
export const branch = nightly ? 'develop' : 'master'
|
||||||
|
export const replacements = {
|
||||||
|
GITHUB_SPACY: `https://github.com/explosion/spaCy/tree/${branch}`,
|
||||||
|
GITHUB_PROJECTS: `https://github.com/${site.projectsRepo}`,
|
||||||
|
SPACY_PKG_NAME: nightly ? 'spacy-nightly' : 'spacy',
|
||||||
|
SPACY_PKG_FLAGS: nightly ? ' --pre' : '',
|
||||||
|
}
|
|
@ -26,7 +26,7 @@ import courseImage from '../public/images/course.jpg'
|
||||||
import prodigyImage from '../public/images/prodigy_overview.jpg'
|
import prodigyImage from '../public/images/prodigy_overview.jpg'
|
||||||
import projectsImage from '../public/images/projects.png'
|
import projectsImage from '../public/images/projects.png'
|
||||||
import tailoredPipelinesImage from '../public/images/spacy-tailored-pipelines_wide.png'
|
import tailoredPipelinesImage from '../public/images/spacy-tailored-pipelines_wide.png'
|
||||||
import { nightly, legacy } from '../meta/dynamicMeta'
|
import { nightly, legacy } from '../meta/dynamicMeta.mjs'
|
||||||
|
|
||||||
import Benchmarks from '../docs/usage/_benchmarks-models.mdx'
|
import Benchmarks from '../docs/usage/_benchmarks-models.mdx'
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ import Link, { OptionalLink } from './link'
|
||||||
import GitHubCode from './github'
|
import GitHubCode from './github'
|
||||||
import classes from '../styles/code.module.sass'
|
import classes from '../styles/code.module.sass'
|
||||||
import siteMetadata from '../../meta/site.json'
|
import siteMetadata from '../../meta/site.json'
|
||||||
import { binderBranch } from '../../meta/dynamicMeta'
|
import { binderBranch } from '../../meta/dynamicMeta.mjs'
|
||||||
|
|
||||||
const WRAP_THRESHOLD = 30
|
const WRAP_THRESHOLD = 30
|
||||||
const CLI_GROUPS = ['init', 'debug', 'project', 'ray', 'huggingface-hub']
|
const CLI_GROUPS = ['init', 'debug', 'project', 'ray', 'huggingface-hub']
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { Fragment, useEffect, useState } from 'react'
|
import React, { Fragment, useEffect, useState } from 'react'
|
||||||
import { Parser as HtmlToReactParser } from 'html-to-react'
|
import { Parser as HtmlToReactParser } from 'html-to-react'
|
||||||
import siteMetadata from '../../meta/site.json'
|
import siteMetadata from '../../meta/site.json'
|
||||||
import { domain } from '../../meta/dynamicMeta'
|
import { domain } from '../../meta/dynamicMeta.mjs'
|
||||||
import remarkPlugins from '../../plugins/index.mjs'
|
import remarkPlugins from '../../plugins/index.mjs'
|
||||||
import { serialize } from 'next-mdx-remote/serialize'
|
import { serialize } from 'next-mdx-remote/serialize'
|
||||||
import { MDXRemote } from 'next-mdx-remote'
|
import { MDXRemote } from 'next-mdx-remote'
|
||||||
|
|
|
@ -15,7 +15,7 @@ import { getCurrentSource, github } from '../components/util'
|
||||||
import siteMetadata from '../../meta/site.json'
|
import siteMetadata from '../../meta/site.json'
|
||||||
import sidebars from '../../meta/sidebars.json'
|
import sidebars from '../../meta/sidebars.json'
|
||||||
import models from '../../meta/languages.json'
|
import models from '../../meta/languages.json'
|
||||||
import { nightly, legacy } from '../../meta/dynamicMeta'
|
import { nightly, legacy } from '../../meta/dynamicMeta.mjs'
|
||||||
|
|
||||||
const Docs = ({ pageContext, children }) => {
|
const Docs = ({ pageContext, children }) => {
|
||||||
const {
|
const {
|
||||||
|
|
|
@ -18,7 +18,7 @@ import Alert from '../components/alert'
|
||||||
import Search from '../components/search'
|
import Search from '../components/search'
|
||||||
|
|
||||||
import siteMetadata from '../../meta/site.json'
|
import siteMetadata from '../../meta/site.json'
|
||||||
import { nightly, legacy } from '../../meta/dynamicMeta'
|
import { nightly, legacy } from '../../meta/dynamicMeta.mjs'
|
||||||
import { remarkComponents } from '../remark'
|
import { remarkComponents } from '../remark'
|
||||||
|
|
||||||
const AlertSpace = ({ nightly, legacy }) => {
|
const AlertSpace = ({ nightly, legacy }) => {
|
||||||
|
|
|
@ -18,7 +18,7 @@ import { H3, H5, Label, InlineList } from '../components/typography'
|
||||||
import { YouTube, SoundCloud, Iframe } from '../components/embed'
|
import { YouTube, SoundCloud, Iframe } from '../components/embed'
|
||||||
import { github, MarkdownToReact } from '../components/util'
|
import { github, MarkdownToReact } from '../components/util'
|
||||||
|
|
||||||
import { nightly, legacy } from '../../meta/dynamicMeta'
|
import { nightly, legacy } from '../../meta/dynamicMeta.mjs'
|
||||||
import universe from '../../meta/universe.json'
|
import universe from '../../meta/universe.json'
|
||||||
|
|
||||||
function filterResources(resources, data) {
|
function filterResources(resources, data) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user