💫 v2.1.0 launch updates (only merge on launch!) (#3414)

* Update README.md

* Use production docsearch [ci skip]

* Add option to exclude pages from search
This commit is contained in:
Ines Montani 2019-03-18 16:07:26 +01:00 committed by GitHub
parent f0c1efcb00
commit 08284f3a11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 20 deletions

View File

@ -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

View File

@ -1,6 +1,7 @@
---
title: Styleguide
section: styleguide
search_exclude: true
menu:
- ['Logo', 'logo']
- ['Colors', 'colors']

View File

@ -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
? {

View File

@ -23,11 +23,6 @@
"list": "89ad33e698"
},
"docSearch": {
"apiKey": "f7dbcd148fae73db20b6ad33d03cc9e8",
"indexName": "dev_spacy_netlify",
"appId": "Y7BGGRAPHC"
},
"_docSearch": {
"apiKey": "371e26ed49d29a27bd36273dfdaf89af",
"indexName": "spacy"
},

View File

@ -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}`,

View File

@ -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
}
}
}