diff --git a/website/.env b/website/.env index 1a40450b0d..68faae80fc 100644 --- a/website/.env +++ b/website/.env @@ -1,3 +1,3 @@ NEXT_PUBLIC_ALGOLIA_APP_ID=YY0FFNI7MF -NEXT_PUBLIC_ALGOLIA_INDEX=poc_VAULT +NEXT_PUBLIC_ALGOLIA_INDEX=product_VAULT NEXT_PUBLIC_ALGOLIA_SEARCH_ONLY_API_KEY=5037da4824714676226913c65e961ca0 diff --git a/website/components/search-bar/index.jsx b/website/components/search-bar/index.jsx new file mode 100644 index 0000000000..e23cf34d53 --- /dev/null +++ b/website/components/search-bar/index.jsx @@ -0,0 +1,28 @@ +import Search from '@hashicorp/react-search' + +export default function SearchBar() { + return ( + ( + <> + + + + + + + + )} + resolveHitLink={(hit) => ({ + href: { + pathname: `/${transformIdtoUrl(hit.objectID)}`, + }, + })} + placeholder="Search Vault documentation" + /> + ) +} + +function transformIdtoUrl(id) { + return id.replace(/\/index$/, '') +} diff --git a/website/components/search-bar/style.css b/website/components/search-bar/style.css new file mode 100644 index 0000000000..3004fb4986 --- /dev/null +++ b/website/components/search-bar/style.css @@ -0,0 +1,4 @@ +.g-search { + width: calc(100% - 2rem); + max-width: 600px; +} diff --git a/website/layouts/api.jsx b/website/layouts/api.jsx index d9d206f23e..bc8b2999d8 100644 --- a/website/layouts/api.jsx +++ b/website/layouts/api.jsx @@ -1,22 +1,25 @@ -import DocsPage from '@hashicorp/react-docs-page' -import order from 'data/api-navigation.js' -import { frontMatter as data } from '../pages/api-docs/**/*.mdx' -import { MDXProvider } from '@mdx-js/react' import Head from 'next/head' import Link from 'next/link' +import { MDXProvider } from '@mdx-js/react' +import DocsPage from '@hashicorp/react-docs-page' +import { SearchProvider } from '@hashicorp/react-search' import Tabs, { Tab } from 'components/tabs' import EnterpriseAlert from 'components/enterprise-alert' import Columns from 'components/columns' import Tag from 'components/inline-tag' +import SearchBar from 'components/search-bar' +import { frontMatter as data } from '../pages/api-docs/**/*.mdx' +import order from 'data/api-navigation.js' const DEFAULT_COMPONENTS = { Tabs, Tab, EnterpriseAlert, Columns, Tag } export default function ApiLayoutWrapper(pageMeta) { function ApiLayout(props) { + const { children, ...propsWithoutChildren } = props return ( + > + + + {children} + + ) } diff --git a/website/layouts/docs.jsx b/website/layouts/docs.jsx index 541444aec4..2f7ff21d19 100644 --- a/website/layouts/docs.jsx +++ b/website/layouts/docs.jsx @@ -1,22 +1,25 @@ -import DocsPage from '@hashicorp/react-docs-page' -import order from 'data/docs-navigation.js' -import { frontMatter as data } from '../pages/docs/**/*.mdx' -import { MDXProvider } from '@mdx-js/react' import Head from 'next/head' import Link from 'next/link' +import { MDXProvider } from '@mdx-js/react' +import DocsPage from '@hashicorp/react-docs-page' +import { SearchProvider } from '@hashicorp/react-search' import Columns from 'components/columns' import Tag from 'components/inline-tag' import Tabs, { Tab } from 'components/tabs' import EnterpriseAlert from 'components/enterprise-alert' +import SearchBar from 'components/search-bar' +import { frontMatter as data } from '../pages/docs/**/*.mdx' +import order from 'data/docs-navigation.js' const DEFAULT_COMPONENTS = { Tabs, Tab, EnterpriseAlert, Columns, Tag } export default function DocsLayoutWrapper(pageMeta) { function DocsLayout(props) { + const { children, ...propsWithoutChildren } = props return ( + > + + + {children} + + ) } diff --git a/website/layouts/intro.jsx b/website/layouts/intro.jsx index b0a6853252..47bf555940 100644 --- a/website/layouts/intro.jsx +++ b/website/layouts/intro.jsx @@ -1,20 +1,23 @@ -import DocsPage from '@hashicorp/react-docs-page' -import order from 'data/intro-navigation.js' -import { frontMatter as data } from '../pages/intro/**/*.mdx' -import { MDXProvider } from '@mdx-js/react' import Head from 'next/head' import Link from 'next/link' +import { MDXProvider } from '@mdx-js/react' +import DocsPage from '@hashicorp/react-docs-page' +import { SearchProvider } from '@hashicorp/react-search' import Tabs, { Tab } from 'components/tabs' import EnterpriseAlert from 'components/enterprise-alert' +import SearchBar from '../components/search-bar' +import { frontMatter as data } from '../pages/intro/**/*.mdx' +import order from 'data/intro-navigation.js' const DEFAULT_COMPONENTS = { Tabs, Tab, EnterpriseAlert } export default function IntroLayoutWrapper(pageMeta) { function IntroLayout(props) { + const { children, ...propsWithoutChildren } = props return ( + > + + + {children} + + ) } diff --git a/website/package-lock.json b/website/package-lock.json index 06a54fd1a3..c6dfb75fe8 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -5,118 +5,118 @@ "requires": true, "dependencies": { "@algolia/cache-browser-local-storage": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.3.0.tgz", - "integrity": "sha512-91Cf3IPUk84PF2wvR8ys8XO42FqaJEtIh/dyR0WvwMdv0x13GORkAvoBJgkFI2wofZqUY86jNimvHWfsWzPQ+g==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.4.0.tgz", + "integrity": "sha512-2AiKgN7DpFypkRCRkpqH7waXXyFdcnsPWzmN8sLHrB/FfXqgmsQb3pGft+9YHZIDQ0vAnfgMxSGgMhMGW+0Qnw==", "requires": { - "@algolia/cache-common": "4.3.0" + "@algolia/cache-common": "4.4.0" } }, "@algolia/cache-common": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.3.0.tgz", - "integrity": "sha512-AHTbOn9lk0f5IkjssXXmDgnaZfsUJVZ61sqOH1W3LyJdAscDzCj0KtwijELn8FHlLXQak7+K93/O3Oct0uHncQ==" + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.4.0.tgz", + "integrity": "sha512-PrIgoMnXaDWUfwOekahro543pgcJfgRu/nd/ZQS5ffem3+Ow725eZY6HDpPaQ1k3cvLii9JH6V2sNJConjqUKA==" }, "@algolia/cache-in-memory": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.3.0.tgz", - "integrity": "sha512-8BZS5IFEtiSFkA6vNQUXJXIWABDbSanQdkGX5LArlhbCjuykZqF68yaCjXWG10EZTySnkZLmKc+5ozYVOktJaQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.4.0.tgz", + "integrity": "sha512-9+XlUB0baDU/Dp9URRHPp6Q37YmTO0QmgPWt9+n+wqZrRL0jR3Jezr4jCT7RemqGMxBiR+YpnqaUv0orpb0ptw==", "requires": { - "@algolia/cache-common": "4.3.0" + "@algolia/cache-common": "4.4.0" } }, "@algolia/client-account": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.3.0.tgz", - "integrity": "sha512-8LJSvWooc+fe+XZXeu+h4dhpo9lsu3sb7rV9cpPhymYSHgEJAHaDkZEcPM1u/PBMvFe0mZXaW6nabeb3jeIRcw==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.4.0.tgz", + "integrity": "sha512-Kynu3cMEs0clTLf674rtrCF+FWR/JwlQxKlIWsPzvLBRmNXdvYej9YBcNaOr4OTQFCCZn9JVE8ib91Z7J4IL1Q==", "requires": { - "@algolia/client-common": "4.3.0", - "@algolia/client-search": "4.3.0", - "@algolia/transporter": "4.3.0" + "@algolia/client-common": "4.4.0", + "@algolia/client-search": "4.4.0", + "@algolia/transporter": "4.4.0" } }, "@algolia/client-analytics": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.3.0.tgz", - "integrity": "sha512-BFH4ddyrqI2pE3bUctn5KtJgYqgvO0Ap9vJEHBNj6mjSKqFbTnZeVEPG3yWrOuWRCqPHR3ewcWRisNwJHG3+Mw==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.4.0.tgz", + "integrity": "sha512-GQyjQimKAc9sZbafxln9Wk7j4pEYiORv28MZkZ+0Bjt7WNXIeO7OgOOECVpQHm9buyV6hCKpNtJcbb5/syRzdQ==", "requires": { - "@algolia/client-common": "4.3.0", - "@algolia/client-search": "4.3.0", - "@algolia/requester-common": "4.3.0", - "@algolia/transporter": "4.3.0" + "@algolia/client-common": "4.4.0", + "@algolia/client-search": "4.4.0", + "@algolia/requester-common": "4.4.0", + "@algolia/transporter": "4.4.0" } }, "@algolia/client-common": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.3.0.tgz", - "integrity": "sha512-8Ohj6zXZkpwDKc8ZWVTZo2wPO4+LT5D258suGg/C6nh4UxOrFOp6QaqeQo8JZ1eqMqtfb3zv5SHgW4fZ00NCLQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.4.0.tgz", + "integrity": "sha512-a3yr6UhzjWPHDG/8iGp9UvrDOm1aeHVWJIf0Nj/cIvqX5tNCEIo4IMe59ovApkDgLOIpt/cLsyhn9/FiPXRhJA==", "requires": { - "@algolia/requester-common": "4.3.0", - "@algolia/transporter": "4.3.0" + "@algolia/requester-common": "4.4.0", + "@algolia/transporter": "4.4.0" } }, "@algolia/client-recommendation": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@algolia/client-recommendation/-/client-recommendation-4.3.0.tgz", - "integrity": "sha512-jCMIAWPA2hsxc5CCtoTtQAcohaG+10CxXK122Tc47t4w1K8qzSJnCjC2cHvM4UNJO+k7NrmjOYW0EXp9RKc7SQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@algolia/client-recommendation/-/client-recommendation-4.4.0.tgz", + "integrity": "sha512-sBszbQH46rko6w2fdEG77ma8+fAg0SDkLZGxWhv4trgcnYGUBFl2dcpEPt/6koto9b4XYlf+eh+qi6iGvYqRPg==", "requires": { - "@algolia/client-common": "4.3.0", - "@algolia/requester-common": "4.3.0", - "@algolia/transporter": "4.3.0" + "@algolia/client-common": "4.4.0", + "@algolia/requester-common": "4.4.0", + "@algolia/transporter": "4.4.0" } }, "@algolia/client-search": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.3.0.tgz", - "integrity": "sha512-KCgcIsNMW1/0F5OILiFTddbTAKduJHRvXQS4NxY1H9gQWMTVeWJS7VZQ/ukKBiUMLatwUQHJz2qpYm9fmqOjkQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.4.0.tgz", + "integrity": "sha512-jqWcxCUyPPHnHreoMb2PnN9iHTP+V/nL62R84XuTRDE3VgTnhm4ZnqyuRdzZQqaz+gNy5znav64TmQ9FN9WW5g==", "requires": { - "@algolia/client-common": "4.3.0", - "@algolia/requester-common": "4.3.0", - "@algolia/transporter": "4.3.0" + "@algolia/client-common": "4.4.0", + "@algolia/requester-common": "4.4.0", + "@algolia/transporter": "4.4.0" } }, "@algolia/logger-common": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.3.0.tgz", - "integrity": "sha512-vQ+aukjZkRAyO9iyINBefT366UtF/B9QoA1Kw8PlY67T6fYmklFgYp3LNH/e7h/gz0py5LYY/HIwSsaTKk8/VQ==" + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.4.0.tgz", + "integrity": "sha512-2vjmSENLaKNuF+ytRDysfWxxgFG95WXCHwHbueThdPMCK3hskkwqJ0Y/pugKfzl+54mZxegb4BYfgcCeuaHVUw==" }, "@algolia/logger-console": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.3.0.tgz", - "integrity": "sha512-7pWtcv1cSSa7F48gRBOZLcEWN073+WbnKjbpRrIGej+abZppw/h+22jtVZZORC8EIjFffGqz2/2e6bZiX+Jg7A==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.4.0.tgz", + "integrity": "sha512-st/GUWyKvr6YM72OOfF+RmpdVGda3BPXbQ+chpntUq1WyVkyZXGjSmH1IcBVlua27GzxabwOUYON39cF3x10/g==", "requires": { - "@algolia/logger-common": "4.3.0" + "@algolia/logger-common": "4.4.0" } }, "@algolia/requester-browser-xhr": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.3.0.tgz", - "integrity": "sha512-CpUwgQhXZsnZmjEd5DTwQv1BKQNCt83bzyVdUqvljsFxZOsNQacS6lOYs0B1eD18tKHCwVMuwbYqTaLPGBXTKQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.4.0.tgz", + "integrity": "sha512-V3a4hXlNch355GnWaT1f5QfXhROpsjT6sd0Znq29gAhwLqfBExhLW6Khdkv5pENC0Qy7ClVhdXFrBL9QCQer1g==", "requires": { - "@algolia/requester-common": "4.3.0" + "@algolia/requester-common": "4.4.0" } }, "@algolia/requester-common": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.3.0.tgz", - "integrity": "sha512-1v73KyspJBiTzfyXupjHxikxTYjh5MoxI6mOIvAtQxRqc4ehUPAEdPCNHEvvLiCK96iKWzZaULmV0U7pj3yvTw==" + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.4.0.tgz", + "integrity": "sha512-jPinHlFJEFokxQ5b3JWyjQKKn+FMy0hH99PApzOgQAYOSiFRXiPEZp6LeIexDeLLu7Y3eRt/3nHvjPKa6PmRRw==" }, "@algolia/requester-node-http": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.3.0.tgz", - "integrity": "sha512-Hg9Y8sUeSGQgoO1FpoL5jbkDzCtXI/8HXHybU6bimsX93DAz3HZWaoQFKmIpQDNhQ8G9FLgAtzDAxS6eckDxzg==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.4.0.tgz", + "integrity": "sha512-b7HC9C/GHxiV4+0GpCRTtjscvwarPr3dGm4CAhb6AkNjgjRcFUNr1NfsF75w3WVmzmt79/7QZihddztDdVMGjw==", "requires": { - "@algolia/requester-common": "4.3.0" + "@algolia/requester-common": "4.4.0" } }, "@algolia/transporter": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.3.0.tgz", - "integrity": "sha512-BTKHAtdQdfOJ0xzZkiyEK/2QVQJTiVgBZlOBfXp2gBtztjV26OqfW4n6Xz0o7eBRzLEwY1ot3mHF5QIVUjAsMg==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.4.0.tgz", + "integrity": "sha512-Xxzq91DEEeKIzT3DU46n4LEyTGAKZNtSHc2H9wvIY5MYwhZwEribmXXZ6k8W1FvBvzggv3juu0SP+xwGoR7F0w==", "requires": { - "@algolia/cache-common": "4.3.0", - "@algolia/logger-common": "4.3.0", - "@algolia/requester-common": "4.3.0" + "@algolia/cache-common": "4.4.0", + "@algolia/logger-common": "4.4.0", + "@algolia/requester-common": "4.4.0" } }, "@ampproject/toolbox-core": { @@ -1843,6 +1843,30 @@ "@hashicorp/react-button": "^2.2.1" } }, + "@hashicorp/react-search": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@hashicorp/react-search/-/react-search-2.1.0.tgz", + "integrity": "sha512-vaTht+2G9ipsVyusK3b3TtUpuy9ccsxj3NMSWXJyGsoT39K1Oovb8aLiIlbUU5Ll72KEi5yq5OS3WAJDdSqW+g==", + "requires": { + "@hashicorp/react-inline-svg": "^1.0.2", + "@hashicorp/remark-plugins": "^3.0.0", + "algoliasearch": "^4.4.0", + "dotenv": "^8.2.0", + "glob": "^7.1.6", + "gray-matter": "^4.0.2", + "react-instantsearch-dom": "^6.7.0", + "remark": "^12.0.1", + "search-insights": "^1.6.0", + "unist-util-visit": "^2.0.3" + }, + "dependencies": { + "@hashicorp/react-inline-svg": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@hashicorp/react-inline-svg/-/react-inline-svg-1.0.2.tgz", + "integrity": "sha512-AAFnBslSTgnEr++dTbMn3sybAqvn7myIj88ijGigF6u11eSRiV64zqEcyYLQKWTV6dF4AvYoxiYC6GSOgiM0Yw==" + } + } + }, "@hashicorp/react-section-header": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@hashicorp/react-section-header/-/react-section-header-2.0.0.tgz", @@ -1947,6 +1971,119 @@ "unist-util-is": "^4.0.2", "unist-util-map": "^2.0.1", "unist-util-visit": "^2.0.2" + }, + "dependencies": { + "markdown-table": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-1.1.3.tgz", + "integrity": "sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q==" + }, + "mdast-util-compact": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mdast-util-compact/-/mdast-util-compact-1.0.4.tgz", + "integrity": "sha512-3YDMQHI5vRiS2uygEFYaqckibpJtKq5Sj2c8JioeOQBU6INpKbdWzfyLqFFnDwEcEnRFIdMsguzs5pC1Jp4Isg==", + "requires": { + "unist-util-visit": "^1.1.0" + }, + "dependencies": { + "unist-util-visit": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", + "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", + "requires": { + "unist-util-visit-parents": "^2.0.0" + } + } + } + }, + "remark": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/remark/-/remark-11.0.2.tgz", + "integrity": "sha512-bh+eJgn8wgmbHmIBOuwJFdTVRVpl3fcVP6HxmpPWO0ULGP9Qkh6INJh0N5Uy7GqlV7DQYGoqaKiEIpM5LLvJ8w==", + "requires": { + "remark-parse": "^7.0.0", + "remark-stringify": "^7.0.0", + "unified": "^8.2.0" + } + }, + "remark-parse": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-7.0.2.tgz", + "integrity": "sha512-9+my0lQS80IQkYXsMA8Sg6m9QfXYJBnXjWYN5U+kFc5/n69t+XZVXU/ZBYr3cYH8FheEGf1v87rkFDhJ8bVgMA==", + "requires": { + "collapse-white-space": "^1.0.2", + "is-alphabetical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-whitespace-character": "^1.0.0", + "is-word-character": "^1.0.0", + "markdown-escapes": "^1.0.0", + "parse-entities": "^1.1.0", + "repeat-string": "^1.5.4", + "state-toggle": "^1.0.0", + "trim": "0.0.1", + "trim-trailing-lines": "^1.0.0", + "unherit": "^1.0.4", + "unist-util-remove-position": "^1.0.0", + "vfile-location": "^2.0.0", + "xtend": "^4.0.1" + } + }, + "remark-stringify": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-7.0.4.tgz", + "integrity": "sha512-qck+8NeA1D0utk1ttKcWAoHRrJxERYQzkHDyn+pF5Z4whX1ug98uCNPPSeFgLSaNERRxnD6oxIug6DzZQth6Pg==", + "requires": { + "ccount": "^1.0.0", + "is-alphanumeric": "^1.0.0", + "is-decimal": "^1.0.0", + "is-whitespace-character": "^1.0.0", + "longest-streak": "^2.0.1", + "markdown-escapes": "^1.0.0", + "markdown-table": "^1.1.0", + "mdast-util-compact": "^1.0.0", + "parse-entities": "^1.0.2", + "repeat-string": "^1.5.4", + "state-toggle": "^1.0.0", + "stringify-entities": "^2.0.0", + "unherit": "^1.0.4", + "xtend": "^4.0.1" + } + }, + "stringify-entities": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-2.0.0.tgz", + "integrity": "sha512-fqqhZzXyAM6pGD9lky/GOPq6V4X0SeTAFBl0iXb/BzOegl40gpf/bV3QQP7zULNYvjr6+Dx8SCaDULjVoOru0A==", + "requires": { + "character-entities-html4": "^1.0.0", + "character-entities-legacy": "^1.0.0", + "is-alphanumerical": "^1.0.0", + "is-decimal": "^1.0.2", + "is-hexadecimal": "^1.0.0" + } + }, + "unist-util-remove-position": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.4.tgz", + "integrity": "sha512-tLqd653ArxJIPnKII6LMZwH+mb5q+n/GtXQZo6S6csPRs5zB0u79Yw8ouR3wTw8wxvdJFhpP6Y7jorWdCgLO0A==", + "requires": { + "unist-util-visit": "^1.1.0" + }, + "dependencies": { + "unist-util-visit": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", + "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", + "requires": { + "unist-util-visit-parents": "^2.0.0" + } + } + } + }, + "vfile-location": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-2.0.6.tgz", + "integrity": "sha512-sSFdyCP3G6Ka0CEmN83A2YCMKIieHx0EDaj5IDP4g1pa5ZJ4FJDvpO0WODLxo4LUX4oe52gmSCK7Jw4SBghqxA==" + } } }, "@mapbox/rehype-prism": { @@ -2062,6 +2199,25 @@ "unist-util-visit": "^2.0.0" } }, + "unist-util-visit": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.2.tgz", + "integrity": "sha512-HoHNhGnKj6y+Sq+7ASo2zpVdfdRifhTgX2KTU3B/sO/TTlZchp7E3S4vjRzDJ7L60KmrCPsQkVK3lEF3cz36XQ==", + "requires": { + "@types/unist": "^2.0.0", + "unist-util-is": "^4.0.0", + "unist-util-visit-parents": "^3.0.0" + } + }, + "unist-util-visit-parents": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.0.tgz", + "integrity": "sha512-0g4wbluTF93npyPrp/ymd3tCDTMnP0yo2akFD2FIBAYXq/Sga3lwaU1D8OYKbtpioaI6CkDcQ6fsMnmtzt7htw==", + "requires": { + "@types/unist": "^2.0.0", + "unist-util-is": "^4.0.0" + } + }, "vfile-location": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-3.0.1.tgz", @@ -2707,24 +2863,39 @@ "integrity": "sha512-eyoaac3btgU8eJlvh01En8OCKzRqlLe2G5jDsCr3RiE2uLGMEEB1aaGwVVpwR8M95956tGH6R+9edC++OvzaVw==" }, "algoliasearch": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.3.0.tgz", - "integrity": "sha512-H2woXyqmd1nFYDrQKLZXgghNkLBTcBXJ7Q/bxQ+F9WWS4H0Kb7IlQvNi7bDzHyldhDhIthImaUwcKqr5iiyMFQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.4.0.tgz", + "integrity": "sha512-Ag3wxe/nSodNl/1KbHibtkh7TNLptKE300/wnGVtszRjXivaWD6333nUpCumrYObHym/fHMHyLcmQYezXbAIWQ==", "requires": { - "@algolia/cache-browser-local-storage": "4.3.0", - "@algolia/cache-common": "4.3.0", - "@algolia/cache-in-memory": "4.3.0", - "@algolia/client-account": "4.3.0", - "@algolia/client-analytics": "4.3.0", - "@algolia/client-common": "4.3.0", - "@algolia/client-recommendation": "4.3.0", - "@algolia/client-search": "4.3.0", - "@algolia/logger-common": "4.3.0", - "@algolia/logger-console": "4.3.0", - "@algolia/requester-browser-xhr": "4.3.0", - "@algolia/requester-common": "4.3.0", - "@algolia/requester-node-http": "4.3.0", - "@algolia/transporter": "4.3.0" + "@algolia/cache-browser-local-storage": "4.4.0", + "@algolia/cache-common": "4.4.0", + "@algolia/cache-in-memory": "4.4.0", + "@algolia/client-account": "4.4.0", + "@algolia/client-analytics": "4.4.0", + "@algolia/client-common": "4.4.0", + "@algolia/client-recommendation": "4.4.0", + "@algolia/client-search": "4.4.0", + "@algolia/logger-common": "4.4.0", + "@algolia/logger-console": "4.4.0", + "@algolia/requester-browser-xhr": "4.4.0", + "@algolia/requester-common": "4.4.0", + "@algolia/requester-node-http": "4.4.0", + "@algolia/transporter": "4.4.0" + } + }, + "algoliasearch-helper": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-3.2.2.tgz", + "integrity": "sha512-/3XvE33R+gQKaiPdy3nmHYqhF8hqIu8xnlOicVxb1fD6uMFmxW8rGLzzrRfsPfxgAfm+c1NslLb3TzQVIB8aVA==", + "requires": { + "events": "^1.1.1" + }, + "dependencies": { + "events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=" + } } }, "ally.js": { @@ -9821,9 +9992,12 @@ "integrity": "sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg==" }, "markdown-table": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-1.1.3.tgz", - "integrity": "sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", + "integrity": "sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==", + "requires": { + "repeat-string": "^1.0.0" + } }, "marked": { "version": "0.7.0", @@ -9871,21 +10045,11 @@ } }, "mdast-util-compact": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mdast-util-compact/-/mdast-util-compact-1.0.4.tgz", - "integrity": "sha512-3YDMQHI5vRiS2uygEFYaqckibpJtKq5Sj2c8JioeOQBU6INpKbdWzfyLqFFnDwEcEnRFIdMsguzs5pC1Jp4Isg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-compact/-/mdast-util-compact-2.0.1.tgz", + "integrity": "sha512-7GlnT24gEwDrdAwEHrU4Vv5lLWrEer4KOkAiKT9nYstsTad7Oc1TwqT2zIMKRdZF7cTuaf+GA1E4Kv7jJh8mPA==", "requires": { - "unist-util-visit": "^1.1.0" - }, - "dependencies": { - "unist-util-visit": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", - "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", - "requires": { - "unist-util-visit-parents": "^2.0.0" - } - } + "unist-util-visit": "^2.0.0" } }, "mdast-util-definitions": { @@ -12939,6 +13103,36 @@ "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-2.0.4.tgz", "integrity": "sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==" }, + "react-instantsearch-core": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/react-instantsearch-core/-/react-instantsearch-core-6.7.0.tgz", + "integrity": "sha512-wIvSIwkWfqPbaQZcbKsfBK3Gpm1e7ahSwU8Bmx1N5RfUqA/NghqS0Ppv3sz4vCXjoEAdPV06R+Fpn9lT+cE9/Q==", + "requires": { + "@babel/runtime": "^7.1.2", + "algoliasearch-helper": "^3.1.0", + "prop-types": "^15.5.10", + "react-fast-compare": "^3.0.0" + }, + "dependencies": { + "react-fast-compare": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.0.tgz", + "integrity": "sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==" + } + } + }, + "react-instantsearch-dom": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/react-instantsearch-dom/-/react-instantsearch-dom-6.7.0.tgz", + "integrity": "sha512-J1C9xkHHLLa6rkKLKFDa7szA0TDo6yPFGmDzh2+JLaq4o694RIqivfUpROHus0Ki3BAQu9QmzLtodf6K1NOBWQ==", + "requires": { + "@babel/runtime": "^7.1.2", + "algoliasearch-helper": "^3.1.0", + "classnames": "^2.2.5", + "prop-types": "^15.5.10", + "react-instantsearch-core": "^6.7.0" + } + }, "react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", @@ -13175,13 +13369,28 @@ } }, "remark": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/remark/-/remark-11.0.2.tgz", - "integrity": "sha512-bh+eJgn8wgmbHmIBOuwJFdTVRVpl3fcVP6HxmpPWO0ULGP9Qkh6INJh0N5Uy7GqlV7DQYGoqaKiEIpM5LLvJ8w==", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/remark/-/remark-12.0.1.tgz", + "integrity": "sha512-gS7HDonkdIaHmmP/+shCPejCEEW+liMp/t/QwmF0Xt47Rpuhl32lLtDV1uKWvGoq+kxr5jSgg5oAIpGuyULjUw==", "requires": { - "remark-parse": "^7.0.0", - "remark-stringify": "^7.0.0", - "unified": "^8.2.0" + "remark-parse": "^8.0.0", + "remark-stringify": "^8.0.0", + "unified": "^9.0.0" + }, + "dependencies": { + "unified": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.0.tgz", + "integrity": "sha512-vx2Z0vY+a3YoTj8+pttM3tiJHCwY5UFbYdiWrwBEbHmK8pvsPj2rtAX2BFfgXen8T39CJWblWRDT4L5WGXtDdg==", + "requires": { + "bail": "^1.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^2.0.0", + "trough": "^1.0.0", + "vfile": "^4.0.0" + } + } } }, "remark-footnotes": { @@ -13279,25 +13488,41 @@ } }, "remark-parse": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-7.0.2.tgz", - "integrity": "sha512-9+my0lQS80IQkYXsMA8Sg6m9QfXYJBnXjWYN5U+kFc5/n69t+XZVXU/ZBYr3cYH8FheEGf1v87rkFDhJ8bVgMA==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-8.0.3.tgz", + "integrity": "sha512-E1K9+QLGgggHxCQtLt++uXltxEprmWzNfg+MxpfHsZlrddKzZ/hZyWHDbK3/Ap8HJQqYJRXP+jHczdL6q6i85Q==", "requires": { + "ccount": "^1.0.0", "collapse-white-space": "^1.0.2", "is-alphabetical": "^1.0.0", "is-decimal": "^1.0.0", "is-whitespace-character": "^1.0.0", "is-word-character": "^1.0.0", "markdown-escapes": "^1.0.0", - "parse-entities": "^1.1.0", + "parse-entities": "^2.0.0", "repeat-string": "^1.5.4", "state-toggle": "^1.0.0", "trim": "0.0.1", "trim-trailing-lines": "^1.0.0", "unherit": "^1.0.4", - "unist-util-remove-position": "^1.0.0", - "vfile-location": "^2.0.0", + "unist-util-remove-position": "^2.0.0", + "vfile-location": "^3.0.0", "xtend": "^4.0.1" + }, + "dependencies": { + "parse-entities": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", + "integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==", + "requires": { + "character-entities": "^1.0.0", + "character-entities-legacy": "^1.0.0", + "character-reference-invalid": "^1.0.0", + "is-alphanumerical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-hexadecimal": "^1.0.0" + } + } } }, "remark-squeeze-paragraphs": { @@ -13309,9 +13534,9 @@ } }, "remark-stringify": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-7.0.4.tgz", - "integrity": "sha512-qck+8NeA1D0utk1ttKcWAoHRrJxERYQzkHDyn+pF5Z4whX1ug98uCNPPSeFgLSaNERRxnD6oxIug6DzZQth6Pg==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-8.1.1.tgz", + "integrity": "sha512-q4EyPZT3PcA3Eq7vPpT6bIdokXzFGp9i85igjmhRyXWmPs0Y6/d2FYwUNotKAWyLch7g0ASZJn/KHHcHZQ163A==", "requires": { "ccount": "^1.0.0", "is-alphanumeric": "^1.0.0", @@ -13319,14 +13544,29 @@ "is-whitespace-character": "^1.0.0", "longest-streak": "^2.0.1", "markdown-escapes": "^1.0.0", - "markdown-table": "^1.1.0", - "mdast-util-compact": "^1.0.0", - "parse-entities": "^1.0.2", + "markdown-table": "^2.0.0", + "mdast-util-compact": "^2.0.0", + "parse-entities": "^2.0.0", "repeat-string": "^1.5.4", "state-toggle": "^1.0.0", - "stringify-entities": "^2.0.0", + "stringify-entities": "^3.0.0", "unherit": "^1.0.4", "xtend": "^4.0.1" + }, + "dependencies": { + "parse-entities": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", + "integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==", + "requires": { + "character-entities": "^1.0.0", + "character-entities-legacy": "^1.0.0", + "character-reference-invalid": "^1.0.0", + "is-alphanumerical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-hexadecimal": "^1.0.0" + } + } } }, "remove-trailing-separator": { @@ -13684,6 +13924,11 @@ "ajv-keywords": "^3.1.0" } }, + "search-insights": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-1.6.2.tgz", + "integrity": "sha512-mpy+57HZVMZH5HsMHYMCLvkf+tUvhy+ycP2tDy1j7wmj+mQsNZ3LC61IcMYomok02NozaMR3GiGyfH6uc+ibdA==" + }, "section-matter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", @@ -14518,9 +14763,9 @@ } }, "stringify-entities": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-2.0.0.tgz", - "integrity": "sha512-fqqhZzXyAM6pGD9lky/GOPq6V4X0SeTAFBl0iXb/BzOegl40gpf/bV3QQP7zULNYvjr6+Dx8SCaDULjVoOru0A==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-3.0.1.tgz", + "integrity": "sha512-Lsk3ISA2++eJYqBMPKcr/8eby1I6L0gP0NlxF8Zja6c05yr/yCYyb2c9PwXjd08Ib3If1vn1rbs1H5ZtVuOfvQ==", "requires": { "character-entities-html4": "^1.0.0", "character-entities-legacy": "^1.0.0", @@ -15832,21 +16077,11 @@ } }, "unist-util-remove-position": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.4.tgz", - "integrity": "sha512-tLqd653ArxJIPnKII6LMZwH+mb5q+n/GtXQZo6S6csPRs5zB0u79Yw8ouR3wTw8wxvdJFhpP6Y7jorWdCgLO0A==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-2.0.1.tgz", + "integrity": "sha512-fDZsLYIe2uT+oGFnuZmy73K6ZxOPG/Qcm+w7jbEjaFcJgbQ6cqjs/eSPzXhsmGpAsWPkqZM9pYjww5QTn3LHMA==", "requires": { - "unist-util-visit": "^1.1.0" - }, - "dependencies": { - "unist-util-visit": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", - "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", - "requires": { - "unist-util-visit-parents": "^2.0.0" - } - } + "unist-util-visit": "^2.0.0" } }, "unist-util-stringify-position": { @@ -15858,9 +16093,9 @@ } }, "unist-util-visit": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.2.tgz", - "integrity": "sha512-HoHNhGnKj6y+Sq+7ASo2zpVdfdRifhTgX2KTU3B/sO/TTlZchp7E3S4vjRzDJ7L60KmrCPsQkVK3lEF3cz36XQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", + "integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", "requires": { "@types/unist": "^2.0.0", "unist-util-is": "^4.0.0", @@ -15868,9 +16103,9 @@ }, "dependencies": { "unist-util-visit-parents": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.0.2.tgz", - "integrity": "sha512-yJEfuZtzFpQmg1OSCyS9M5NJRrln/9FbYosH3iW0MG402QbdbaB8ZESwUv9RO6nRfLAKvWcMxCwdLWOov36x/g==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.0.tgz", + "integrity": "sha512-0g4wbluTF93npyPrp/ymd3tCDTMnP0yo2akFD2FIBAYXq/Sga3lwaU1D8OYKbtpioaI6CkDcQ6fsMnmtzt7htw==", "requires": { "@types/unist": "^2.0.0", "unist-util-is": "^4.0.0" @@ -16126,9 +16361,9 @@ } }, "vfile-location": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-2.0.6.tgz", - "integrity": "sha512-sSFdyCP3G6Ka0CEmN83A2YCMKIieHx0EDaj5IDP4g1pa5ZJ4FJDvpO0WODLxo4LUX4oe52gmSCK7Jw4SBghqxA==" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-3.1.0.tgz", + "integrity": "sha512-FCZ4AN9xMcjFIG1oGmZKo61PjwJHRVA+0/tPUP2ul4uIwjGGndIxavEMRpWn5p4xwm/ZsdXp9YNygf1ZyE4x8g==" }, "vfile-message": { "version": "2.0.4", diff --git a/website/package.json b/website/package.json index 488c953c0f..b5d07b25e2 100644 --- a/website/package.json +++ b/website/package.json @@ -18,16 +18,14 @@ "@hashicorp/react-inline-svg": "^1.0.0", "@hashicorp/react-mega-nav": "^4.0.1-2", "@hashicorp/react-product-downloader": "^4.0.2", + "@hashicorp/react-search": "^2.1.0", "@hashicorp/react-section-header": "^2.0.0", "@hashicorp/react-subnav": "^3.2.3", "@hashicorp/react-tabs": "^0.4.0", "@hashicorp/react-text-and-content": "^4.1.1", "@hashicorp/react-use-cases": "^1.0.4", "@hashicorp/react-vertical-text-block-list": "^2.0.1", - "algoliasearch": "^4.3.0", "babel-plugin-import-glob-array": "^0.2.0", - "dotenv": "^8.2.0", - "gray-matter": "^4.0.2", "imagemin-mozjpeg": "^9.0.0", "imagemin-optipng": "^8.0.0", "imagemin-svgo": "^8.0.0", @@ -37,7 +35,6 @@ }, "devDependencies": { "dart-linkcheck": "^2.0.15", - "glob": "^7.1.6", "husky": "^4.2.5", "inquirer": "^7.1.0", "prettier": "^2.0.5" diff --git a/website/pages/style.css b/website/pages/style.css index 8d4c4d407a..114902ce44 100644 --- a/website/pages/style.css +++ b/website/pages/style.css @@ -10,32 +10,34 @@ } @import '~@hashicorp/react-button/dist/style.css'; -@import '~@hashicorp/react-hero/dist/style.css'; -@import '~@hashicorp/react-section-header/dist/style.css'; -@import '~@hashicorp/react-use-cases/dist/style.css'; -@import '~@hashicorp/react-logo-grid/dist/style.css'; -@import '~@hashicorp/react-product-downloader/dist/style.css'; -@import '~@hashicorp/react-vertical-text-block-list/dist/style.css'; -@import '~@hashicorp/react-docs-sidenav/dist/style.css'; @import '~@hashicorp/react-case-study-slider/dist/style.css'; -@import '~@hashicorp/react-content/dist/style.css'; -@import '~@hashicorp/react-text-and-content/dist/style.css'; @import '~@hashicorp/react-code-block/dist/style.css'; @import '~@hashicorp/react-consent-manager/dist/style.css'; -@import '~@hashicorp/react-toggle/dist/style.css'; +@import '~@hashicorp/react-content/dist/style.css'; @import '~@hashicorp/react-docs-page/dist/style.css'; -@import '~@hashicorp/react-tabs/dist/style.css'; +@import '~@hashicorp/react-docs-sidenav/dist/style.css'; @import '~@hashicorp/react-enterprise-alert/dist/style.css'; +@import '~@hashicorp/react-hero/dist/style.css'; +@import '~@hashicorp/react-logo-grid/dist/style.css'; +@import '~@hashicorp/react-product-downloader/dist/style.css'; +@import '~@hashicorp/react-search/dist/style.css'; +@import '~@hashicorp/react-section-header/dist/style.css'; +@import '~@hashicorp/react-tabs/dist/style.css'; +@import '~@hashicorp/react-text-and-content/dist/style.css'; +@import '~@hashicorp/react-toggle/dist/style.css'; +@import '~@hashicorp/react-use-cases/dist/style.css'; +@import '~@hashicorp/react-vertical-text-block-list/dist/style.css'; /* Global Components - Transpiled */ @import '~@hashicorp/react-mega-nav/style.css'; /* Local Components */ @import '../components/before-after-diagram/style.css'; -@import '../components/use-case-cta-section/style.css'; -@import '../components/subnav/style.css'; @import '../components/footer/style.css'; +@import '../components/search-bar/style.css'; +@import '../components/subnav/style.css'; @import '../components/tabs/style.css'; +@import '../components/use-case-cta-section/style.css'; /* Pages */ @import './not-found/style.css'; diff --git a/website/scripts/index_search_content.js b/website/scripts/index_search_content.js index 871b542dcf..f853b4ddf7 100644 --- a/website/scripts/index_search_content.js +++ b/website/scripts/index_search_content.js @@ -1,101 +1,3 @@ -require('dotenv').config() +const { indexDocsContent } = require('@hashicorp/react-search/tools') -const algoliasearch = require('algoliasearch') -const glob = require('glob') -const matter = require('gray-matter') -const path = require('path') - -// In addition to the content of the page, -// define additional front matter attributes that will be search-indexable -const SEARCH_DIMENSIONS = ['page_title', 'description'] - -main() - -async function main() { - const pagesFolder = path.join(__dirname, '../pages') - - // Grab all search-indexable content and format for Algolia - const searchObjects = glob - .sync(path.join(pagesFolder, '**/*.mdx')) - .map((fullPath) => { - const { content, data } = matter.read(fullPath) - - // Get path relative to `pages` - const __resourcePath = fullPath.replace(`${pagesFolder}/`, '') - - // Use clean URL for Algolia id - const objectID = __resourcePath.replace('.mdx', '') - - const searchableDimensions = Object.keys(data) - .filter((key) => SEARCH_DIMENSIONS.includes(key)) - .map((dimension) => ({ - [dimension]: data[dimension], - })) - - return { - ...searchableDimensions, - content, - __resourcePath, - objectID, - } - }) - - try { - await indexSearchContent(searchObjects) - } catch (e) { - console.error(e) - process.exit(1) - } -} - -async function indexSearchContent(objects) { - const { - NEXT_PUBLIC_ALGOLIA_APP_ID: appId, - NEXT_PUBLIC_ALGOLIA_INDEX: index, - ALGOLIA_API_KEY: apiKey, - } = process.env - - if (!apiKey || !appId || !index) { - throw new Error( - `[*** Algolia Search Indexing Error ***] Received: ALGOLIA_API_KEY=${apiKey} ALGOLIA_APP_ID=${appId} ALGOLIA_INDEX=${index} \n Please ensure all Algolia Search-related environment vars are set in CI settings.` - ) - } - - console.log(`updating ${objects.length} indices...`) - - try { - const searchClient = algoliasearch(appId, apiKey) - const searchIndex = searchClient.initIndex(index) - - await searchIndex.partialUpdateObjects(objects, { - createIfNotExists: true, - }) - - // Remove indices for items that aren't included in the new batch - const newObjectIds = objects.map(({ objectID }) => objectID) - let staleObjects = [] - - await searchIndex.browseObjects({ - query: '', - batch: (batch) => { - staleObjects = staleObjects.concat( - batch.filter(({ objectID }) => !newObjectIds.includes(objectID)) - ) - }, - }) - - const staleIds = staleObjects.map(({ objectID }) => objectID) - - if (staleIds.length > 0) { - console.log(`deleting ${staleIds.length} stale indices:`) - console.log(staleIds) - - await searchIndex.deleteObjects(staleIds) - } - - console.log('done') - process.exit(0) - } catch (error) { - throw new Error(error) - } -} +indexDocsContent()