Skip to content

Commit

Permalink
add docsearch for v2 (parcel-bundler#608)
Browse files Browse the repository at this point in the history
* add docsearch for v2

* add note about docsearch in repo
  • Loading branch information
DeMoorJasper authored Jun 19, 2020
1 parent f0485a6 commit eb13976
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ yarn serve
```

The website is automatically deployed using [Vercel](https://vercel.com).

Search is powered by [Algolia DocSearch](https://docsearch.algolia.com/).
15 changes: 15 additions & 0 deletions src/_includes/layout.njk
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
{% include "darkmode.js" %}
</script>
<link href="/doc-styles.css" rel="stylesheet" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
</head>
<body>
<header class="parcel-docs-header">
Expand Down Expand Up @@ -110,6 +111,20 @@
updateMode(isDarkMode);
});
</script>

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
<script type="text/javascript">
docsearch({
apiKey: '8b6be780425a72d1a1683abea2636778',
indexName: 'parceljs',
inputSelector: '#search-input',
algoliaOptions: {
'facetFilters': [
"lang:v2"
]
}
});
</script>
</body>
<script>
{% include "doc-nav-toggle.js" %}
Expand Down

0 comments on commit eb13976

Please sign in to comment.