Skip to content

Commit

Permalink
feat: add search page
Browse files Browse the repository at this point in the history
  • Loading branch information
Chakravarthy7102 committed Dec 1, 2023
1 parent 17d89b9 commit 42416ef
Show file tree
Hide file tree
Showing 6 changed files with 594 additions and 0 deletions.
5 changes: 5 additions & 0 deletions v2/buildDocsForProduction
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ rm ./build/blog.html
rm ./build/404.html
rm ./build/.nojekyll

# replaces all the occurances of supertokens.com/ with supertokens.com/docs when it's not starting with supertokens.com/img.
sed -i '' '/supertokens\.com\/img/!s/supertokens\.com/supertokens.com\/docs/g' ./build/opensearch.xml

mv ./build/opensearch.xml ./build/docs

# copy build folder to proper location
# Check if folder exists
if [ ! -d ../../supertokens-backend-website/app/docs/v2 ]; then
Expand Down
12 changes: 12 additions & 0 deletions v2/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,18 @@ module.exports = {
id: "copy-docs-and-code-type-checking",
}
],
[
'@docusaurus/plugin-content-docs',
{
id: 'search',
path: 'search',
routeBasePath: 'docs/search',
sidebarPath: false,
remarkPlugins: remarkPlugins,
rehypePlugins: rehypePlugins,
beforeDefaultRemarkPlugins,
},
],
[
'@docusaurus/plugin-content-docs',
{
Expand Down
10 changes: 10 additions & 0 deletions v2/search/search.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
id: search
title: Search the documentation.
hide_title: true
slug: /
---

import SearchPage from "/src/theme/SearchPage"

<SearchPage />
2 changes: 2 additions & 0 deletions v2/src/plugins/transformOpenSearchLink.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// use Rehype js to alter the opensearch.xml path link in the header.
// use basic string manipulation stuff in the bash to replace urls in opensearch.xml while copying to docs folder.
Loading

0 comments on commit 42416ef

Please sign in to comment.