diff --git a/.babelrc b/.babelrc new file mode 100644 index 000000000..1ff94f7ed --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["next/babel"] +} diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 8ccfb9390..000000000 --- a/.dockerignore +++ /dev/null @@ -1,4 +0,0 @@ -.cache/ -node_modules/ -public/ -.git/ diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 000000000..97a2bb84e --- /dev/null +++ b/.eslintrc @@ -0,0 +1,3 @@ +{ + "extends": ["next", "next/core-web-vitals"] +} diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 226ba59df..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: "[Bug]" -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/epic.md b/.github/ISSUE_TEMPLATE/epic.md deleted file mode 100644 index 78ae6976a..000000000 --- a/.github/ISSUE_TEMPLATE/epic.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -name: Epic -about: An epic is a large body of work that can be broken down into a number of smaller - stories/issue -title: "[EPIC]" -labels: '' -assignees: '' - ---- - -## Description -Brief summary of what this Epic is, whether it's a larger project, goal, or user story. Describe the job to be done, which persona this Epic is mainly for, or if more multiple, break it down by user and job story. - -## Initiative / goal -Describe how this Epic impacts an initiative the business is working on. - -### Hypothesis -What is your hypothesis on the success of this Epic? Describe how success will be measured and what leading indicators the team will have to know if success has been hit. - -## Acceptance criteria and must have scope -Define what is a must-have for launch and in-scope. Keep this section fluid and dynamic until you lock-in priority during planning. - -## Stakeholders -Describe who needs to be kept up-to-date about this Epic, included in discussions, or updated along the way. Stakeholders can be both in Product/Engineering, as well as other teams like Customer Success who might want to keep customers updated on the Epic project. - -## Timeline -What's the timeline for this Epic, what resources are needed, and what might potentially block this from hitting the projected end date. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index f9acdb30b..000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: "[Feature]" -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/deploy-landingpage-s3.yml b/.github/workflows/deploy-landingpage-s3.yml deleted file mode 100644 index 92a50189d..000000000 --- a/.github/workflows/deploy-landingpage-s3.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Deploy - -on: - push: - branches-ignore: - - source - repository_dispatch: - types: [deploy-website-staging] - -env: - GATSBY_HAYSTACK_HUB_TOKEN: ${{ secrets.HAYSTACK_HUB_TOKEN }} - -jobs: - deploy: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - ref: ${{ github.ref }} - - name: Use Node.js 12 - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: Build - run: | - npm install - githubRef=$(echo '${{ github.event.client_payload.ref }}' | sed 's/refs\/heads\///g') - echo $githubRef - [[ ! -z "${githubRef}" ]] && npm run update_img_dev $githubRef || npm run update_img_dev master - [[ ! -z "${githubRef}" ]] && npm run update_apidocs_dev $githubRef || npm run update_apidocs_dev master - [[ ! -z "${githubRef}" ]] && npm run update_tutorialsdocs_dev $githubRef || npm run update_tutorialsdocs_dev master - [[ ! -z "${githubRef}" ]] && npm run update_usagedocs_dev $githubRef || npm run update_usagedocs_dev master - [[ ! -z "${githubRef}" ]] && npm run update_benchmarks_dev $githubRef || npm run update_benchmarks_dev master - npm ci - npm run build - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: eu-central-1 - - name: Deploy - uses: jonelantha/gatsby-s3-action@v1-content-type-fix - with: - dest-s3-bucket: haystackhub-website - - name: Sleep for 30 seconds - uses: jakejarvis/wait-action@master - with: - time: '30s' - - name: Check links - run: | - npm install broken-link-checker -g - npm install sitemap-urls - npm run check_links_dev diff --git a/.github/workflows/deploy_website.yml b/.github/workflows/deploy_website.yml deleted file mode 100644 index 91850ada0..000000000 --- a/.github/workflows/deploy_website.yml +++ /dev/null @@ -1,51 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Repository Dispatch - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the source branch -on: - push: - branches: - - source - repository_dispatch: - types: [deploy-website] - -env: - GATSBY_HAYSTACK_HUB_TOKEN: ${{ secrets.HAYSTACK_HUB_TOKEN }} - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out master in order to use it for the deployment - - uses: actions/checkout@v2 - - # Install packages and run custom deployment (update all files and push to github pages) - - name: Install and update - run: | - npm install - npm run update_img - npm run update_apidocs - npm run update_tutorialsdocs - npm run update_usagedocs - npm run update_benchmarks - - - uses: enriikke/gatsby-gh-pages-action@v2 - with: - access-token: ${{ secrets.TOKEN_FOR_DEPLOYMENT }} - - - name: Sleep for 30 seconds - uses: jakejarvis/wait-action@master - with: - time: '30s' - - name: Check links - run: | - sudo npm install broken-link-checker -g - npm install sitemap-urls - npm run check_links_prod diff --git a/.gitignore b/.gitignore index e2c4e67b2..1437c53f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,75 +1,34 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Typescript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history +# dependencies +/node_modules +/.pnp +.pnp.js -# Output of 'npm pack' -*.tgz +# testing +/coverage -# dotenv environment variable files -.env* +# next.js +/.next/ +/out/ -# gatsby files -.cache/ -public +# production +/build -# Mac files +# misc .DS_Store +*.pem -# Yarn -yarn-error.log -.pnp/ -.pnp.js -# Yarn Integrity file -.yarn-integrity +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* -# Pycharm files -.idea +# local env files +.env.local +.env.development.local +.env.test.local +.env.production.local -# Log files from wget -wget-log* \ No newline at end of file +# vercel +.vercel diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 58d06c368..000000000 --- a/.prettierignore +++ /dev/null @@ -1,4 +0,0 @@ -.cache -package.json -package-lock.json -public diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 33d2cfa3f..000000000 --- a/.prettierrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "arrowParens": "avoid", - "semi": false -} diff --git a/CNAME b/CNAME deleted file mode 100644 index 15d18dfcc..000000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -haystack.deepset.ai diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 0de15d179..000000000 --- a/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM gatsbyjs/gatsby:onbuild as build - -FROM gatsbyjs/gatsby -COPY --from=build /site/public /pub diff --git a/README.md b/README.md index 8b8e1d79c..2384757c4 100644 --- a/README.md +++ b/README.md @@ -1,76 +1,65 @@ -******************************************************* -# Haystack — Documentation -******************************************************* +## Development +### Environment Variables -Setup Gatsby -============ +Get a [personal access token from GitHub](https://github.com/settings/tokens/new). The `public_repo` scope is sufficient. -Requirements: -- Node.js -- Git +Create a `.env.local` file and add your token as an env variable: -The Gatsby CLI is available via npm and should be installed globally by running: +```bash +GITHUB_PERSONAL_ACCESS_TOKEN="youraccesstoken" +``` -npm install -g gatsby-cli +### Getting Started -Clone master branch and run it locally: +First, run the development server: +```bash +npm run dev +# or +yarn dev ``` -git clone https://github.com/deepset-ai/haystack-io.git -cd haystack-io -npm install -gatsby develop + +If you're editing mdx files, run the following command to see your changes update automatically: + +```bash +npm run dev:watch +# or +yarn dev:watch ``` -Open up a new tab in your browser and navigate to `http://localhost:8000/` +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. +### Required Reading -Edit documentation -============ +This project makes heavy use of Next.js's [getStaticProps](https://nextjs.org/docs/basic-features/data-fetching#getstaticprops-static-generation) and [getStaticPaths](https://nextjs.org/docs/basic-features/data-fetching#getstaticpaths-static-generation) functions, to fetch markdown files at build time (locally from the `docs` directory as well as from GitHub using the GitHub API) and generate html pages for each of these files. Before working on the project, it's vital that you understand how these functions work and how they apply to this project. [This example](https://github.com/vercel/next.js/tree/canary/examples/blog-starter-typescript) and [this example](https://github.com/vercel/next.js/tree/canary/examples/with-mdx-remote) may be used as simple demonstrations of these functions to solidify your understanding. -Go to the docs direcotry: +## Docs Publishing Process -``` -cd ./src/pages/docs/site/en -``` +### Overview & Usage Docs -Currently, the documentation is splitted into three parts: -- **Usage:** How to use Haystack -- **Tutorials:** Collection of different use cases for Haystack -- **API:** Python docstrings +These docs live in the `docs` directory, in the given version directory. The docs are written in .mdx, which allows us to include JSX inside these files. This allows us to add [Headless UI](http://headlessui.dev/) components, a React component library based on Tailwind.css. See the `components/Disclosures` and `components/Tabs` components as examples and how these are used inside of .mdx files such as `docs/v0.9.0/overview/get-started.mdx`. Whenever you want edit or create new documentation, simply do so by adding .mdx files to a given version directory or by editing existing .mdx files. For new files one additional step is required, please add the new page to the `menu.json` file which is located in the folder `docs/vX.X.X`. When you push a branch with your changes to GitHub, Vercel will automatically generate a preview environment for you (check the Vercel Dashboard to find the preview URL). -In order to add a new Markdown file to this structure, you need choose the right directory and copy the file to it. Add the following information on top of the file so that it can be loaded automatically: +### Tutorial & Reference Docs -``` ---- -title: "" -metaTitle: "<metatitle>" -metaDescription: "" -slug: "/docs/<filename>" -date: "<date>" -id: "<filename>" ---- -``` +These docs live in the [Haystack repository](https://github.com/deepset-ai/haystack/tree/master/docs), in the given version directory. The docs are generated markdown files and we fetch these **at build time** using the GitHub API. Thanks to Vercel's [Incremental Static Regeneration](https://vercel.com/docs/next.js/incremental-static-regeneration), the static pages we create for these docs are always up-to-date. This means that if existing tutorials or references are changed, the changes will be visible on the docs website automatically. + +#### Preview from non-master branches + +To preview docs that are on a non-master branch of the Haystack repo, you run this project locally and navigate to `lib/github.ts`, where you have to add a `ref` parameter to the `octokit.rest.repos.getContent` function call with the value of the branch name that you would like to preview. You also need to add the tutorials/references you would like to preview to `docs/{GIVEN_VERSION}/menu.json` and `lib/constants.ts`. + +### Updating docs after a release + +When there's a new Haystack release, we need to create a directory for the new version within the local `/docs` directory. In this directory, we can write new overview and usage docs in .mdx (or manually copy over the ones from the previous version directory). Once this is done, the project will automatically fetch the reference and tutorial docs for the new version from GitHub. Bear in mind that a `menu.json` file needs to exist in every new version directory so that our Menu components know which page links to display. Additionally, the `referenceFiles` and `tutorialFiles` constants in `lib/constants` need to be updated with any new reference or tutorial docs that get created as part of a new release. **Lastly**, we have to update the constant specified in the `components/VersionSelect` component, so that we default to the new version when navigating between pages. + +## Styling + +We use [Tailwind](https://tailwindcss.com) for CSS. It's a CSS utility library, which allows us to write barely any CSS ourselves. The `tailwind.config.js` file contains configuration to provide classes that match deepset.ai's new style guide. Additionally, there is a `styles/global.css` file, which loads our custom font provided by the style guide. Lastly, we have two css module files within the `components` directory (markdown.module.css and tutorial.module.css), wich are applied on the `components/Layout` component. These files allow us to provide some defaults for certain HTML elements, which get applied to the HTML tags generated when we convert markdown to html at build time. We also use a React component library authored by the Tailwind team, called [Headless UI](http://headlessui.dev/). This allows us to easily create React components such as the `components/Tabs` and `components/Disclosures` components. + +## Deployment + +This application gets deployed on [Vercel](https://vercel.com). In the dashboard, connect the `haystack-website` repo to a new project and it should handle builds, preview environments (all branches other than master), and production environments (master branch) automatically. + +## Future Work -Last but not least, you need to include the file into the menu structure which is defined in the file `./src/pages/docs/site/en/menuStructure/menu.json`. Here you need to add a json object to the structure: - -```json -{ - "id": "<IdFromFile>", - "title": "<NameInMenu>", - "label1": "<LabelOfParent>", - "label2": "", - "label3": "", - "order": <NumberInMenu> -}, -``` - -Deployment -============ - -1. Push changes to branch **source** -2. Merge changes to branch **gh-pages** -3. Option 1 without updating the documentation files: Run `npm run deploy`<br> - Option 2 with updating the documentation files: Run `npm run update_deploy` (need to be run from the directory **haystack-website**) -4. Documentation gets deployed to **haystack.deepset.ai** +Convert the remote markdown files for references and tutorials to .mdx, so that we can inject React components into these. This would also allow for more code sharing between the overview+usage pages and tutorial+reference pages. diff --git a/src/pages/benchmarks/versions/v0.4.0/site/en/map/retriever_map.json b/benchmarks/v0.4.0/map/retriever_map.json similarity index 100% rename from src/pages/benchmarks/versions/v0.4.0/site/en/map/retriever_map.json rename to benchmarks/v0.4.0/map/retriever_map.json diff --git a/src/pages/benchmarks/versions/v0.4.0/site/en/performance/reader_performance.json b/benchmarks/v0.4.0/performance/reader_performance.json similarity index 100% rename from src/pages/benchmarks/versions/v0.4.0/site/en/performance/reader_performance.json rename to benchmarks/v0.4.0/performance/reader_performance.json diff --git a/src/pages/benchmarks/versions/v0.4.0/site/en/performance/retriever_performance.json b/benchmarks/v0.4.0/performance/retriever_performance.json similarity index 100% rename from src/pages/benchmarks/versions/v0.4.0/site/en/performance/retriever_performance.json rename to benchmarks/v0.4.0/performance/retriever_performance.json diff --git a/src/pages/benchmarks/versions/v0.4.0/site/en/speed/retriever_speed.json b/benchmarks/v0.4.0/speed/retriever_speed.json similarity index 100% rename from src/pages/benchmarks/versions/v0.4.0/site/en/speed/retriever_speed.json rename to benchmarks/v0.4.0/speed/retriever_speed.json diff --git a/src/pages/benchmarks/versions/v0.5.0/site/en/map/retriever_map.json b/benchmarks/v0.5.0/map/retriever_map.json similarity index 100% rename from src/pages/benchmarks/versions/v0.5.0/site/en/map/retriever_map.json rename to benchmarks/v0.5.0/map/retriever_map.json diff --git a/src/pages/benchmarks/versions/v0.5.0/site/en/performance/reader_performance.json b/benchmarks/v0.5.0/performance/reader_performance.json similarity index 100% rename from src/pages/benchmarks/versions/v0.5.0/site/en/performance/reader_performance.json rename to benchmarks/v0.5.0/performance/reader_performance.json diff --git a/src/pages/benchmarks/versions/v0.5.0/site/en/performance/retriever_performance.json b/benchmarks/v0.5.0/performance/retriever_performance.json similarity index 100% rename from src/pages/benchmarks/versions/v0.5.0/site/en/performance/retriever_performance.json rename to benchmarks/v0.5.0/performance/retriever_performance.json diff --git a/src/pages/benchmarks/versions/v0.5.0/site/en/speed/retriever_speed.json b/benchmarks/v0.5.0/speed/retriever_speed.json similarity index 100% rename from src/pages/benchmarks/versions/v0.5.0/site/en/speed/retriever_speed.json rename to benchmarks/v0.5.0/speed/retriever_speed.json diff --git a/src/pages/benchmarks/versions/v0.6.0/site/en/map/retriever_map.json b/benchmarks/v0.6.0/map/retriever_map.json similarity index 100% rename from src/pages/benchmarks/versions/v0.6.0/site/en/map/retriever_map.json rename to benchmarks/v0.6.0/map/retriever_map.json diff --git a/src/pages/benchmarks/versions/v0.6.0/site/en/performance/reader_performance.json b/benchmarks/v0.6.0/performance/reader_performance.json similarity index 100% rename from src/pages/benchmarks/versions/v0.6.0/site/en/performance/reader_performance.json rename to benchmarks/v0.6.0/performance/reader_performance.json diff --git a/src/pages/benchmarks/versions/v0.6.0/site/en/performance/retriever_performance.json b/benchmarks/v0.6.0/performance/retriever_performance.json similarity index 100% rename from src/pages/benchmarks/versions/v0.6.0/site/en/performance/retriever_performance.json rename to benchmarks/v0.6.0/performance/retriever_performance.json diff --git a/src/pages/benchmarks/versions/v0.6.0/site/en/speed/retriever_speed.json b/benchmarks/v0.6.0/speed/retriever_speed.json similarity index 100% rename from src/pages/benchmarks/versions/v0.6.0/site/en/speed/retriever_speed.json rename to benchmarks/v0.6.0/speed/retriever_speed.json diff --git a/src/pages/benchmarks/versions/v0.7.0/site/en/map/retriever_map.json b/benchmarks/v0.7.0/map/retriever_map.json similarity index 100% rename from src/pages/benchmarks/versions/v0.7.0/site/en/map/retriever_map.json rename to benchmarks/v0.7.0/map/retriever_map.json diff --git a/src/pages/benchmarks/versions/v0.7.0/site/en/performance/reader_performance.json b/benchmarks/v0.7.0/performance/reader_performance.json similarity index 100% rename from src/pages/benchmarks/versions/v0.7.0/site/en/performance/reader_performance.json rename to benchmarks/v0.7.0/performance/reader_performance.json diff --git a/src/pages/benchmarks/versions/v0.7.0/site/en/performance/retriever_performance.json b/benchmarks/v0.7.0/performance/retriever_performance.json similarity index 100% rename from src/pages/benchmarks/versions/v0.7.0/site/en/performance/retriever_performance.json rename to benchmarks/v0.7.0/performance/retriever_performance.json diff --git a/src/pages/benchmarks/versions/v0.7.0/site/en/speed/retriever_speed.json b/benchmarks/v0.7.0/speed/retriever_speed.json similarity index 100% rename from src/pages/benchmarks/versions/v0.7.0/site/en/speed/retriever_speed.json rename to benchmarks/v0.7.0/speed/retriever_speed.json diff --git a/src/pages/benchmarks/versions/v0.8.0/site/en/map/retriever_map.json b/benchmarks/v0.8.0/map/retriever_map.json similarity index 100% rename from src/pages/benchmarks/versions/v0.8.0/site/en/map/retriever_map.json rename to benchmarks/v0.8.0/map/retriever_map.json diff --git a/src/pages/benchmarks/versions/latest/site/en/performance/reader_performance.json b/benchmarks/v0.8.0/performance/reader_performance.json similarity index 100% rename from src/pages/benchmarks/versions/latest/site/en/performance/reader_performance.json rename to benchmarks/v0.8.0/performance/reader_performance.json diff --git a/src/pages/benchmarks/versions/v0.8.0/site/en/performance/retriever_performance.json b/benchmarks/v0.8.0/performance/retriever_performance.json similarity index 100% rename from src/pages/benchmarks/versions/v0.8.0/site/en/performance/retriever_performance.json rename to benchmarks/v0.8.0/performance/retriever_performance.json diff --git a/src/pages/benchmarks/versions/v0.8.0/site/en/speed/retriever_speed.json b/benchmarks/v0.8.0/speed/retriever_speed.json similarity index 100% rename from src/pages/benchmarks/versions/v0.8.0/site/en/speed/retriever_speed.json rename to benchmarks/v0.8.0/speed/retriever_speed.json diff --git a/src/pages/benchmarks/versions/latest/site/en/map/retriever_map.json b/benchmarks/v0.9.0/map/retriever_map.json similarity index 100% rename from src/pages/benchmarks/versions/latest/site/en/map/retriever_map.json rename to benchmarks/v0.9.0/map/retriever_map.json diff --git a/src/pages/benchmarks/versions/v0.8.0/site/en/performance/reader_performance.json b/benchmarks/v0.9.0/performance/reader_performance.json similarity index 100% rename from src/pages/benchmarks/versions/v0.8.0/site/en/performance/reader_performance.json rename to benchmarks/v0.9.0/performance/reader_performance.json diff --git a/src/pages/benchmarks/versions/latest/site/en/performance/retriever_performance.json b/benchmarks/v0.9.0/performance/retriever_performance.json similarity index 100% rename from src/pages/benchmarks/versions/latest/site/en/performance/retriever_performance.json rename to benchmarks/v0.9.0/performance/retriever_performance.json diff --git a/src/pages/benchmarks/versions/latest/site/en/speed/retriever_speed.json b/benchmarks/v0.9.0/speed/retriever_speed.json similarity index 100% rename from src/pages/benchmarks/versions/latest/site/en/speed/retriever_speed.json rename to benchmarks/v0.9.0/speed/retriever_speed.json diff --git a/broken-link-checker.sh b/broken-link-checker.sh deleted file mode 100755 index 40dd5918e..000000000 --- a/broken-link-checker.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -if [ "$1" = "dev" ]; then - urls=$(curl http://haystackhub-website.s3-website.eu-central-1.amazonaws.com/sitemap.xml | sitemap-urls) -else - urls=$(curl https://haystack.deepset.ai/sitemap.xml | sitemap-urls) -fi - -for url in $(echo $urls | tr " " "\n") -do - if [ "$1" = "dev" ]; then - url="${url/https:\/\/haystack.deepset.ai/http:\/\/haystackhub-website.s3-website.eu-central-1.amazonaws.com}" - fi - blc $url -o --exclude https://www.linkedin.com/company/deepset-ai/ \ - --exclude http://127.0.0.1:8000/docs \ - --exclude https://medium.com/deepset-ai/modern-question-answering-systems-explained-4d0913744097 \ - --exclude http://haystackhub-website.s3-website.eu-central-1.amazonaws.com/docs/v0.4.0/tutorial2md \ - --exclude https://haystack.deepset.ai/docs/v0.4.0/tutorial2md \ - --exclude https://raw.githubusercontent.com/deepset-ai/haystack/master/docs/img/annotation_tool.png \ - --exclude http://haystackhub-website.s3-website.eu-central-1.amazonaws.com/docs/v0.4.0/tutorial6md \ - --exclude https://haystack.deepset.ai/docs/v0.4.0/tutorial6md \ - --exclude https://raw.githubusercontent.com/deepset-ai/haystack/master/docs/img/colab_gpu_runtime.jpg \ - --exclude http://github.com/deepset-ai/haystack/ \ - --exclude http://github.com/deepset-ai/haystack/stargazers/ \ - --exclude https://twitter.com/deepset_ai/ \ - --exclude https://huggingface.co/illuin/camembert-large-fquad \ - --exclude https://deepset.ai/imprint \ - --exclude https://deepset.ai/harry_potter/ \ - --exclude https://graphdb.ontotext.com/documentation/free/configuring-a-repository.html#configure-a-repository-programmatically \ - --exclude https://deepset.ai/ \ - --exclude https://deepset.ai/german-bert \ - --exclude https://deepset.ai/germanquad \ - --exclude https://ext-models-haystack.s3.eu-central-1.amazonaws.com/ \ - --exclude https://github.com/deepset-ai/haystack/blob/master/rest_api/pipelines.yaml \ - --exclude https://www.meetup.com/de-DE/open-nlp-meetup/ \ - --filter-level 1 --host-requests 1 - status=$? - - if [ "$status" != "0" ]; then - exit 1 - fi - sleep 1 -done diff --git a/components/Code.tsx b/components/Code.tsx new file mode 100644 index 000000000..37ce64234 --- /dev/null +++ b/components/Code.tsx @@ -0,0 +1,24 @@ +import Highlight, { defaultProps } from "prism-react-renderer"; + +export default function Code({ children }: { children: string }) { + return ( + <Highlight + {...defaultProps} + code={children} + language="python" + theme={undefined} + > + {({ className, tokens, getLineProps, getTokenProps }) => ( + <code className={className}> + {tokens.map((line, i) => ( + <div key={i} {...getLineProps({ line, key: i })}> + {line.map((token, key) => ( + <span key={key} {...getTokenProps({ token, key })} /> + ))} + </div> + ))} + </code> + )} + </Highlight> + ); +} diff --git a/components/DesktopNav.tsx b/components/DesktopNav.tsx new file mode 100644 index 000000000..3f8a723cc --- /dev/null +++ b/components/DesktopNav.tsx @@ -0,0 +1,63 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import { useState, useEffect } from "react"; + +type Props = { + menu: any; +}; + +export default function Sidebar({ menu = [] }: Props) { + const router = useRouter(); + const [versionPath, setVersionPath] = useState<string>(); + + useEffect(() => { + if (router.query.slug && router.query.slug.length > 1) { + setVersionPath(`${router.query.slug[0]}/`); + } else { + setVersionPath(undefined); + } + }, [router.query]); + + return ( + <div className="fixed inset-0 p-6 pt-24 w-60 bg-dark-blue sm:block hidden overflow-y-scroll text-medium-grey dark:bg-black"> + <ol> + {menu.map((submenu: any) => ( + <li key={submenu.subMenuTitle}> + <p className="text-xl text-white mb-3 font-medium"> + {submenu.subMenuTitle} + </p> + <ol className="mb-8"> + {submenu.items.map((item: any) => ( + <li + key={item.title} + className={`mb-2 ${ + router.asPath === + `${submenu.pathPrefix}${versionPath ? versionPath : ""}${ + item.slug + }` + ? "text-yellow-dark-theme" + : "hover:text-light-grey" + }`} + > + <Link + href={`${submenu.pathPrefix}${ + versionPath ? versionPath : "" + }${item.slug}`} + > + <a + href={`${submenu.pathPrefix}${ + versionPath ? versionPath : "" + }${item.slug}`} + > + {item.title} + </a> + </Link> + </li> + ))} + </ol> + </li> + ))} + </ol> + </div> + ); +} diff --git a/components/Disclosures.tsx b/components/Disclosures.tsx new file mode 100644 index 000000000..065e16a5e --- /dev/null +++ b/components/Disclosures.tsx @@ -0,0 +1,36 @@ +import { Disclosure } from "@headlessui/react"; +import { ChevronUpIcon } from "@heroicons/react/solid"; + +export default function Disclosures({ + options, +}: { + options: { title: string; content: string | JSX.Element }[]; +}) { + return ( + <div className="w-full"> + {options.map((option, idx) => ( + <Disclosure key={idx}> + {({ open }) => ( + <> + <Disclosure.Button + className={`${ + open ? "rounded-tl-lg rounded-tr-lg" : "mb-1 rounded-lg" + } flex justify-between w-full px-4 py-2 font-medium text-left text-light-grey bg-dark-blue hover:text-off-white border-yellow-dark-theme`} + > + <span>{option.title}</span> + <ChevronUpIcon + className={`${ + open ? "transform rotate-180" : "" + } w-5 h-5 text-off-white`} + /> + </Disclosure.Button> + <Disclosure.Panel className="px-4 pt-4 pb-2 text-gray-500 bg-light-grey mb-3 rounded-bl-lg rounded-br-lg"> + {option.content} + </Disclosure.Panel> + </> + )} + </Disclosure> + ))} + </div> + ); +} diff --git a/components/Footer.tsx b/components/Footer.tsx new file mode 100644 index 000000000..0e3a32977 --- /dev/null +++ b/components/Footer.tsx @@ -0,0 +1,67 @@ +import { FC } from "react"; +import Link from "next/link"; +import { AiFillGithub, AiFillYoutube, AiOutlineTwitter } from "react-icons/ai"; + +const Footer: FC = () => { + const year = new Date().getFullYear(); + + return ( + <footer className="bg-light-grey-BG text-medium-grey w-full px-3 py-6 sm:pl-64 sm:pr-8 sm:py-8 dark:bg-gray-800"> + <div className="flex flex-col sm:flex-row sm:items-center justify-between"> + <div className="flex mb-5 sm:m-0"> + <Link href="https://www.deepset.ai/imprint"> + <a + target="_blank" + href="https://www.deepset.ai/imprint" + className="text-sm font-semibold mr-3 hover:text-dark-grey" + rel="noopener noreferrer" + > + Imprint + </a> + </Link> + <Link href="https://www.deepset.ai/privacy"> + <a + target="_blank" + href="https://www.deepset.ai/privacy" + className="text-sm font-semibold hover:text-dark-grey" + rel="noopener noreferrer" + > + Privacy + </a> + </Link> + </div> + <div className="flex mb-5 sm:m-0"> + <a + target="_blank" + href="https://twitter.com/deepset_ai" + className="mr-3 sm:mr-6" + rel="noreferrer noopener" + aria-label="Go to our Twitter page" + > + <AiOutlineTwitter className="h-9 w-9 hover:text-dark-grey" /> + </a> + <a + target="_blank" + href="https://github.com/deepset-ai" + className="mr-3 sm:mr-6" + rel="noreferrer noopener" + aria-label="Go to our GitHub page" + > + <AiFillGithub className="h-8 w-8 hover:text-dark-grey" /> + </a> + <a + target="_blank" + href="https://www.youtube.com/channel/UC5dfn9m310oyt-cbeegfvZw" + rel="noreferrer noopener" + aria-label="Go to our YouTube channel" + > + <AiFillYoutube className="h-9 w-9 hover:text-dark-grey" /> + </a> + </div> + </div> + <p className="text-xs">© 2020 - {year} deepset. All rights reserved.</p> + </footer> + ); +}; + +export default Footer; diff --git a/components/Header.tsx b/components/Header.tsx new file mode 100644 index 000000000..4e2bede95 --- /dev/null +++ b/components/Header.tsx @@ -0,0 +1,144 @@ +import Link from "next/link"; +import VersionSelect from "./VersionSelect"; +import { useState, useEffect } from "react"; +import { Switch } from "@headlessui/react"; +import { SunIcon, MoonIcon } from "@heroicons/react/outline"; + +type Props = { + docsType: string; +}; + +export default function Header({ docsType = "haystack" }: Props) { + const [darkMode, setDarkMode] = useState(false); + + const handleChange = () => { + if (localStorage.theme === undefined) { + localStorage.theme = "light"; + setDarkMode(false); + } + localStorage.theme === "light" + ? (localStorage.theme = "dark") + : (localStorage.theme = "light"); + if ( + localStorage.theme === "dark" || + (!("theme" in localStorage) && + window.matchMedia("(prefers-color-scheme: dark)").matches) + ) { + document.documentElement.classList.add("dark"); + setDarkMode(true); + } else { + document.documentElement.classList.remove("dark"); + setDarkMode(false); + } + }; + + useEffect(() => { + if ( + localStorage.theme === "dark" || + (!("theme" in localStorage) && + window.matchMedia("(prefers-color-scheme: dark)").matches) + ) { + setDarkMode(true); + } else { + setDarkMode(false); + } + }); + + return ( + <header className="sticky top-0 p-2 sm:px-6 sm:py-3 z-10 w-full xl:max-w-8xl mx-auto flex items-center justify-between bg-dark-blue border-b border-medium-grey dark:bg-black"> + <Link href="/" passHref> + <div className="w-44 lg:w-60"> + <svg + xmlns="http://www.w3.org/2000/svg" + viewBox="0 0 184 47" + role="img" + focusable="false" + aria-label="Haystack logo" + > + <path + d="M61.91 11.64c-2.23 0-3.67 1.1-4.53 2.63V5.58c0-.28-.18-.46-.46-.46h-3.3c-.28 0-.46.18-.46.46v20.96c0 .28.18.46.46.46h3.3c.28 0 .46-.18.46-.46v-7.77c0-2.11 1.16-3.24 2.94-3.24 1.81 0 2.78 1.13 2.78 3.24v7.77c0 .28.18.46.46.46h3.27c.28 0 .49-.18.49-.46v-8.72c0-3.92-2.29-6.18-5.41-6.18zm14.78 15.73c2.23 0 3.86-.95 4.9-2.48l.06 1.65c0 .28.18.46.46.46h2.97c.28 0 .49-.18.49-.46V12.47c0-.28-.18-.46-.46-.46h-3c-.28 0-.46.18-.46.46l-.06 1.65c-1.01-1.56-2.63-2.48-4.9-2.48-4.22 0-7.13 3.43-7.13 7.86 0 4.47 2.91 7.87 7.13 7.87zm.89-3.86c-2.23 0-3.89-1.59-3.89-4.01 0-2.39 1.65-4.01 3.89-4.01s3.79 1.59 3.79 4.01-1.56 4.01-3.79 4.01zm17.05 9.3c.24 0 .46-.12.55-.37l7.93-19.92c.12-.34-.03-.52-.37-.52h-3.37c-.24 0-.46.12-.55.37l-3.55 9.73-3.58-9.73a.57.57 0 00-.55-.37h-3.37c-.34 0-.49.18-.37.52l5.78 14.5-2.17 5.26c-.15.34.03.52.37.52l3.25.01zm15.09-5.44c3 0 5.6-1.56 5.63-4.59.03-2.3-1.47-3.58-3.37-4.35l-2.11-.83c-.83-.31-1.44-.73-1.44-1.47 0-.64.46-1.19 1.44-1.19.89 0 1.74.43 2.72 1.25.28.21.49.24.7 0l1.35-1.62c.15-.18.21-.43.03-.64-1.26-1.5-3.06-2.3-5.02-2.3-2.78 0-5.23 1.65-5.23 4.53 0 2.08 1.35 3.34 3.27 4.1l1.9.77c1.1.46 1.56.83 1.56 1.56 0 .86-.67 1.25-1.68 1.25-1.16 0-2.2-.52-3.46-1.47-.24-.18-.52-.24-.76.12l-1.07 1.5c-.21.34-.25.67-.06.89 1.19 1.42 3.09 2.49 5.6 2.49zm14.01 0c1.01 0 2.54-.18 2.54-.89v-2.23c0-.31-.21-.46-.55-.43-.37.03-.67.03-.95.03-.79 0-1.32-.43-1.32-1.32v-7.25h2.36c.28 0 .46-.18.46-.46v-2.36c0-.28-.18-.46-.46-.46h-2.36V8.49c0-.28-.18-.46-.46-.46h-3.33c-.28 0-.46.18-.46.46v3.52h-1.9c-.28 0-.46.18-.46.46v2.36c0 .28.18.46.46.46h1.9V23c0 3.27 2.14 4.37 4.53 4.37zm11.45 0c2.23 0 3.86-.95 4.9-2.48l.06 1.65c0 .28.18.46.46.46h2.97c.27 0 .49-.18.49-.46V12.47c0-.28-.18-.46-.46-.46h-3c-.27 0-.46.18-.46.46l-.06 1.65c-1.01-1.56-2.63-2.48-4.9-2.48-4.22 0-7.13 3.43-7.13 7.86 0 4.47 2.91 7.87 7.13 7.87zm.89-3.86c-2.23 0-3.89-1.59-3.89-4.01 0-2.39 1.65-4.01 3.89-4.01 2.23 0 3.79 1.59 3.79 4.01s-1.56 4.01-3.79 4.01zm18.79 3.86c2.42 0 4.47-1.04 5.75-2.69.18-.21.12-.46-.06-.64l-1.84-1.81a.546.546 0 00-.79 0c-.83.83-1.71 1.25-2.88 1.25-2.48 0-4.04-1.84-4.04-4.04s1.56-3.92 3.95-3.92c1.22 0 2.11.43 2.94 1.25.21.21.55.24.8 0l1.84-1.81c.18-.18.25-.43.06-.64-1.29-1.65-3.34-2.69-5.81-2.69-4.5 0-7.83 3.37-7.83 7.8-.01 4.51 3.35 7.94 7.91 7.94zm12.5-.37c.28 0 .46-.18.46-.46v-3.18l1.87-2.11 4.04 5.48c.15.21.31.28.55.28h3.55c.37 0 .49-.24.28-.55l-5.88-8.11 5.08-5.78c.24-.31.15-.55-.25-.55h-3.76c-.21 0-.4.06-.55.24l-4.93 5.81V5.58c0-.28-.18-.46-.46-.46h-3.34c-.27 0-.46.18-.46.46v20.96c0 .28.18.46.46.46h3.34z" + fill="#f3f3f7" + /> + <path + d="M57.88 44.18c2.06 0 3.48-1.67 3.48-3.86 0-2.17-1.42-3.85-3.48-3.85-1.02 0-1.78.38-2.28 1.03v-4c0-.14-.09-.23-.22-.23h-1.64c-.13 0-.22.09-.22.23v10.27c0 .14.1.23.24.23h1.47c.14 0 .23-.09.23-.23l.03-.81c.5.75 1.28 1.22 2.39 1.22zm-.43-1.89c-1.11 0-1.88-.78-1.88-1.97 0-1.18.76-1.97 1.88-1.97 1.08 0 1.89.8 1.89 1.97 0 1.19-.81 1.97-1.89 1.97zm7.9 4.56c.12 0 .22-.06.27-.18l3.88-9.76c.06-.17-.01-.26-.18-.26h-1.65c-.12 0-.23.06-.27.18l-1.74 4.77-1.76-4.77a.279.279 0 00-.27-.18h-1.65c-.16 0-.24.09-.18.26l2.83 7.11-1.06 2.58c-.07.17.02.26.18.26l1.6-.01zm11.55-2.67c1.09 0 1.89-.47 2.4-1.22l.03.81c0 .14.09.23.22.23h1.46c.13 0 .24-.09.24-.23V33.5c0-.14-.09-.23-.22-.23h-1.64c-.14 0-.22.09-.22.23v4c-.5-.66-1.25-1.03-2.26-1.03-2.07 0-3.5 1.68-3.5 3.85-.01 2.19 1.42 3.86 3.49 3.86zm.43-1.89c-1.1 0-1.9-.78-1.9-1.97 0-1.17.81-1.97 1.9-1.97s1.86.78 1.86 1.97-.76 1.97-1.86 1.97zm9.36 1.89c1.03 0 1.98-.3 2.61-.93.13-.12.15-.23.07-.33l-.56-.76c-.07-.1-.15-.12-.25-.06-.6.35-1.14.45-1.71.45-1.19 0-1.95-.51-2.18-1.44h4.47c.64 0 .81-.41.81-1.12 0-1.86-1.29-3.51-3.53-3.51-2.26 0-3.78 1.67-3.78 3.83.02 2.2 1.64 3.87 4.05 3.87zm-2.04-4.53c.18-.97.89-1.47 1.8-1.47.88 0 1.54.49 1.66 1.47h-3.46zm10.37 4.53c1.04 0 1.98-.3 2.61-.93.14-.12.15-.23.08-.33l-.56-.76c-.08-.1-.15-.12-.26-.06-.6.35-1.14.45-1.71.45-1.18 0-1.95-.51-2.18-1.44h4.47c.65 0 .81-.41.81-1.12 0-1.86-1.29-3.51-3.53-3.51-2.26 0-3.78 1.67-3.78 3.83.01 2.2 1.63 3.87 4.05 3.87zm-2.04-4.53c.18-.97.89-1.47 1.8-1.47.89 0 1.54.49 1.67 1.47h-3.47zm8.56 7.2c.13 0 .22-.09.22-.22v-3.5c.51.66 1.28 1.05 2.28 1.05 2.06 0 3.48-1.67 3.48-3.86 0-2.17-1.42-3.85-3.48-3.85-1.12 0-1.9.45-2.4 1.22l-.03-.81c0-.14-.09-.23-.22-.23H99.9c-.13 0-.22.09-.22.23v9.75c0 .13.09.22.22.22h1.64zm2.07-4.56c-1.11 0-1.88-.78-1.88-1.97 0-1.18.76-1.97 1.88-1.97 1.08 0 1.89.8 1.89 1.97 0 1.19-.82 1.97-1.89 1.97zm7.68 1.89c1.47 0 2.75-.77 2.76-2.25.01-1.12-.72-1.76-1.65-2.13l-1.04-.4c-.4-.15-.7-.36-.7-.72 0-.32.22-.58.7-.58.44 0 .86.21 1.34.61.13.1.24.12.34 0l.66-.79c.07-.09.1-.21.01-.32-.61-.74-1.5-1.12-2.46-1.12-1.36 0-2.57.81-2.57 2.22 0 1.02.66 1.63 1.61 2.01l.93.38c.54.23.76.41.76.77 0 .42-.33.61-.83.61-.57 0-1.08-.26-1.69-.72-.12-.09-.25-.12-.38.06l-.52.74c-.11.17-.12.33-.03.44.6.66 1.53 1.19 2.76 1.19zm7.82 0c1.04 0 1.98-.3 2.61-.93.14-.12.15-.23.07-.33l-.56-.76c-.07-.1-.15-.12-.25-.06-.6.35-1.14.45-1.71.45-1.18 0-1.95-.51-2.18-1.44h4.47c.65 0 .81-.41.81-1.12 0-1.86-1.29-3.51-3.53-3.51-2.26 0-3.78 1.67-3.78 3.83.02 2.2 1.64 3.87 4.05 3.87zm-2.04-4.53c.18-.97.89-1.47 1.8-1.47.89 0 1.54.49 1.67 1.47h-3.47zm9.48 4.53c.49 0 1.24-.09 1.24-.44v-1.1c0-.15-.1-.22-.27-.21-.18.01-.33.01-.47.01-.39 0-.64-.21-.64-.65v-3.56h1.15c.14 0 .22-.09.22-.22v-1.15c0-.14-.09-.23-.22-.23h-1.15v-1.72c0-.14-.09-.23-.22-.23h-1.64c-.14 0-.22.09-.22.23v1.72h-.93c-.14 0-.22.09-.22.23v1.15c0 .13.09.22.22.22h.93v3.78c0 1.63 1.05 2.17 2.22 2.17z" + fill="#a0a0c0" + /> + <path + d="M3.56 0h29.88C35.41 0 37 1.59 37 3.56v39.88C37 45.4 35.41 47 33.44 47H3.56C1.59 47 0 45.4 0 43.44V3.56C0 1.59 1.59 0 3.56 0z" + fill="#03af9d" + className="haystack-logo_svg__green-area" + /> + <path + d="M7 18.51C7 12.15 12.16 7 18.52 7s11.52 5.16 11.52 11.52V35.5c0 .28-.22.5-.5.5-2.49 0-4.5-2.01-4.5-4.5V18.51c0-3.6-2.92-6.52-6.52-6.52S12 14.92 12 18.51v4.98c0 .28.22.5.5.5h3c.28 0 .5-.22.5-.5v-4a2.5 2.5 0 015 0v20c0 .28-.22.5-.5.5-2.49 0-4.5-2.01-4.5-4.5v-6c0-.28-.22-.5-.5-.5h-3c-.28 0-.5.22-.5.5v2c0 2.49-2.01 4.5-4.5 4.5a.48.48 0 01-.5-.49V18.51z" + fill="#f3f3f7" + /> + </svg> + <span className="sr-only">Haystack docs home page</span> + </div> + </Link> + <div className="hidden lg:flex w-full justify-end"> + <div className="mr-8 xl:mr-12 2xl:mr-16"> + <Link href="/overview/intro"> + <div className="text-white font-bold lg:text-xl xl:text-2xl cursor-pointer"> + Haystack Docs + </div> + </Link> + </div> + {/* <div className="mr-8 xl:mr-12 2xl:mr-16"> + <Link href="/overview/get-started"> + <div className="text-white font-bold lg:text-xl xl:text-2xl cursor-pointer"> + Haystack Hub Docs + </div> + </Link> + </div> */} + <div className="mr-8 xl:mr-12 2xl:mr-16"> + <Link href="/benchmarks/v0.9.0"> + <div className="text-white font-bold lg:text-xl xl:text-2xl cursor-pointer"> + Benchmarks + </div> + </Link> + </div> + <div className="mr-8 xl:mr-12 2xl:mr-16"> + <Link href="/community/join"> + <div className="text-white font-bold lg:text-xl xl:text-2xl cursor-pointer"> + Join Slack + </div> + </Link> + </div> + <div className="mr-8 xl:mr-12 2xl:mr-16 flex"> + <Link href="https://www.meetup.com/de-DE/open-nlp-meetup/"> + <a + target="_blank" + href="https://www.meetup.com/de-DE/open-nlp-meetup/" + className="text-white font-bold lg:text-xl xl:text-2xl cursor-pointer" + rel="noopener noreferrer" + > + Join Open NLP + </a> + </Link> + </div> + </div> + <div className="hidden lg:flex items-center mr-8 xl:mr-12 2xl:mr-16"> + <Switch + checked={darkMode} + onChange={handleChange} + className="relative flex-shrink-0 flex items-center h-8 w-16 border-2 border-white rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75" + > + <span className="sr-only">Toggle dark mode</span> + <span + aria-hidden="true" + className={`${darkMode ? "translate-x-8" : "translate-x-0"} + p-1 bg-white border border-white pointer-events-none inline-block h-7 w-7 rounded-full shadow-lg transform transition ease-in-out duration-200`} + > + {darkMode ? ( + <SunIcon className="h-full w-full text-black" /> + ) : ( + <MoonIcon className="h-full w-full text-dark-blue" /> + )} + </span> + </Switch> + </div> + <VersionSelect docsType={docsType} /> + </header> + ); +} diff --git a/components/Layout.tsx b/components/Layout.tsx new file mode 100644 index 000000000..e282261d3 --- /dev/null +++ b/components/Layout.tsx @@ -0,0 +1,76 @@ +import { FC } from "react"; +import styles from "./markdown.module.css"; +import Head from "next/head"; +import { useRouter } from "next/router"; +import Header from "components/Header"; +import DesktopNav from "components/DesktopNav"; +import MobileNav from "components/MobileNav"; +import Footer from "components/Footer"; +import Toc from "components/Toc"; +import { StaticPageProps } from "lib/utils"; + +type LayoutProps = Pick< + StaticPageProps, + "menu" | "toc" | "editOnGitHubLink" | "stars" +>; + +const Layout: FC<LayoutProps> = ({ + menu, + toc, + editOnGitHubLink, + stars, + children, +}) => { + const router = useRouter(); + + const meta = { + title: "Haystack Docs", + description: "Haystack enables Question Answering at Scale", + image: "./img/haystack-logo-colored.png", + type: "website", + }; + + return ( + <div className="dark:bg-gray-800"> + <Head> + <title>Haystack Docs + + + + + + + + + + + + + + + + +
+ + +
+
{children}
+
+ +
+
+