From 08284f3a11eb6ee603977bd840ee0100452e497e Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Mon, 18 Mar 2019 16:07:26 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AB=20v2.1.0=20launch=20updates=20(onl?= =?UTF-8?q?y=20merge=20on=20launch!)=20(#3414)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update README.md * Use production docsearch [ci skip] * Add option to exclude pages from search --- README.md | 22 ++++++++++++---------- website/docs/styleguide.md | 1 + website/gatsby-node.js | 2 ++ website/meta/site.json | 5 ----- website/src/components/search.js | 3 +-- website/src/templates/index.js | 7 ++++--- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index c348f3198..513cf4890 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ currently supports tokenization for **45+ languages**. It features the and easy **deep learning** integration. It's commercial open-source software, released under the MIT license. -💫 **Version 2.0 out now!** [Check out the release notes here.](https://github.com/explosion/spaCy/releases) +💫 **Version 2.1 out now!** [Check out the release notes here.](https://github.com/explosion/spaCy/releases) [![Azure Pipelines](https://img.shields.io/azure-devops/build/explosion-ai/public/8/master.svg?logo=azure-devops&style=flat-square)](https://dev.azure.com/explosion-ai/public/_build?definitionId=8) [![Travis Build Status](https://img.shields.io/travis/explosion/spaCy/master.svg?style=flat-square&logo=travis)](https://travis-ci.org/explosion/spaCy) @@ -25,17 +25,19 @@ released under the MIT license. ## 📖 Documentation -| Documentation | | -| --------------- | ----------------------------------------------------- | -| [spaCy 101] | New to spaCy? Here's everything you need to know! | -| [Usage Guides] | How to use spaCy and its features. | -| [API Reference] | The detailed reference for spaCy's API. | -| [Models] | Download statistical language models for spaCy. | -| [Universe] | Libraries, extensions, demos, books and courses. | -| [Changelog] | Changes and version history. | -| [Contribute] | How to contribute to the spaCy project and code base. | +| Documentation | | +| --------------- | -------------------------------------------------------------- | +| [spaCy 101] | New to spaCy? Here's everything you need to know! | +| [Usage Guides] | How to use spaCy and its features. | +| [New in v2.1] | New features, backwards incompatibilities and migration guide. | +| [API Reference] | The detailed reference for spaCy's API. | +| [Models] | Download statistical language models for spaCy. | +| [Universe] | Libraries, extensions, demos, books and courses. | +| [Changelog] | Changes and version history. | +| [Contribute] | How to contribute to the spaCy project and code base. | [spacy 101]: https://spacy.io/usage/spacy-101 +[new in v2.1]: https://spacy.io/usage/v2-1 [usage guides]: https://spacy.io/usage/ [api reference]: https://spacy.io/api/ [models]: https://spacy.io/models diff --git a/website/docs/styleguide.md b/website/docs/styleguide.md index 009e937ca..4d8aa8748 100644 --- a/website/docs/styleguide.md +++ b/website/docs/styleguide.md @@ -1,6 +1,7 @@ --- title: Styleguide section: styleguide +search_exclude: true menu: - ['Logo', 'logo'] - ['Colors', 'colors'] diff --git a/website/gatsby-node.js b/website/gatsby-node.js index 716444382..1c0ede1f1 100644 --- a/website/gatsby-node.js +++ b/website/gatsby-node.js @@ -71,6 +71,7 @@ exports.createPages = ({ graphql, actions }) => { tag new next + search_exclude menu sidebar { label @@ -133,6 +134,7 @@ exports.createPages = ({ graphql, actions }) => { tag: frontmatter.tag, version: frontmatter.new, theme: sectionMeta.theme, + searchExclude: frontmatter.search_exclude, relativePath: page.node.relativePath, next: next ? { diff --git a/website/meta/site.json b/website/meta/site.json index 2c58699b6..4defdf913 100644 --- a/website/meta/site.json +++ b/website/meta/site.json @@ -23,11 +23,6 @@ "list": "89ad33e698" }, "docSearch": { - "apiKey": "f7dbcd148fae73db20b6ad33d03cc9e8", - "indexName": "dev_spacy_netlify", - "appId": "Y7BGGRAPHC" - }, - "_docSearch": { "apiKey": "371e26ed49d29a27bd36273dfdaf89af", "indexName": "spacy" }, diff --git a/website/src/components/search.js b/website/src/components/search.js index 0d803a541..9d63c06b5 100644 --- a/website/src/components/search.js +++ b/website/src/components/search.js @@ -6,13 +6,12 @@ import Icon from './icon' import classes from '../styles/search.module.sass' const Search = ({ id, placeholder, settings }) => { - const { apiKey, indexName, appId } = settings + const { apiKey, indexName } = settings const [initialized, setInitialized] = useState(false) useEffect(() => { if (!initialized) { setInitialized(true) window.docsearch({ - appId, apiKey, indexName, inputSelector: `#${id}`, diff --git a/website/src/templates/index.js b/website/src/templates/index.js index 794ea5ac9..cc10b33f7 100644 --- a/website/src/templates/index.js +++ b/website/src/templates/index.js @@ -4,6 +4,7 @@ import { graphql } from 'gatsby' import { MDXProvider } from '@mdx-js/tag' import { withMDXScope } from 'gatsby-mdx/context' import useOnlineStatus from '@rehooks/online-status' +import classNames from 'classnames' import MDXRenderer from './mdx-renderer' @@ -108,6 +109,7 @@ class Layout extends React.Component { source: PropTypes.string, isIndex: PropTypes.bool.isRequired, theme: PropTypes.string, + searchExclude: PropTypes.bool, next: PropTypes.shape({ title: PropTypes.string.isRequired, slug: PropTypes.string.isRequired, @@ -128,8 +130,8 @@ class Layout extends React.Component { const { data, pageContext, location, children } = this.props const { file, site = {} } = data || {} const mdx = file ? file.childMdx : null - const { title, section, sectionTitle, teaser, theme = 'blue' } = pageContext - const bodyClass = `theme-${theme}` + const { title, section, sectionTitle, teaser, theme = 'blue', searchExclude } = pageContext + const bodyClass = classNames(`theme-${theme}`, { 'search-exclude': !!searchExclude }) const meta = site.siteMetadata || {} const isDocs = ['usage', 'models', 'api', 'styleguide'].includes(section) const content = !mdx ? null : ( @@ -191,7 +193,6 @@ export const pageQuery = graphql` docSearch { apiKey indexName - appId } } }