Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] feat: new docs website #7416

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ coverage/
reports/
.nyc_output/
tmp/
docs/
dist/
lib/
es/
Expand Down
11 changes: 10 additions & 1 deletion scripts/deploy/build_docs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,23 @@

set -e

# Docusaurus must know the base URL to work properly
DOCS_BASE_URL="/new-docs/"
if [ -n "${GIT_PULL_REQUEST_ID}" ] && [ "${GIT_PULL_REQUEST_ID}" != "false" ]; then
DOCS_BASE_URL="/pr_${GIT_PULL_REQUEST_ID}/new-docs/"
fi

echo "Docusaurus base URL set to: ${DOCS_BASE_URL}"

# Compile using base image from pre_command.sh
echo "Building docs using ${DOCKER_BASE_IMAGE} Docker image"
docker pull "$DOCKER_BASE_IMAGE"
docker run \
--rm -i \
--env HOME=/tmp \
--env DOCS_BASE_URL="$DOCS_BASE_URL" \
--"user=$(id -u)":"$(id -g)" \
--volume "$PWD":/app \
--workdir /app \
"$DOCKER_BASE_IMAGE" \
bash -c 'yarn && yarn build && yarn build-docs && yarn build-storybook'
bash -c 'yarn && yarn build && yarn build-docs && yarn build-storybook && yarn --cwd website && yarn --cwd website build'
9 changes: 8 additions & 1 deletion scripts/deploy/deploy_docs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ post_comment_to_gh()
printf '\nAdding comment to GitHub Pull Request: %i\n' "${GIT_PULL_REQUEST_ID}"
comment="Preview staging links for this PR:
- Docs site: https://eui.elastic.co/pr_${GIT_PULL_REQUEST_ID}/
- Storybook: https://eui.elastic.co/pr_${GIT_PULL_REQUEST_ID}/storybook"
- Storybook: https://eui.elastic.co/pr_${GIT_PULL_REQUEST_ID}/storybook
- New docs site (in development): https://eui.elastic.co/pr_${GIT_PULL_REQUEST_ID}/new-docs/"

curl \
--silent \
Expand All @@ -81,11 +82,17 @@ publish_to_bucket()
-z js,css,html # enable gzip encoding for these extensions
)

# Current docs
echo "Copying ${PWD}/docs/* to ${full_bucket_path}"
gsutil "${copy_options[@]}" "${PWD}/docs/*" "${full_bucket_path}"

# Storybook
echo "Copying ${PWD}/storybook-static/* to ${full_bucket_path}storybook/"
gsutil "${copy_options[@]}" "${PWD}/storybook-static/*" "${full_bucket_path}storybook/"

# New docs
echo "Copying ${PWD}/website/build/* to ${full_bucket_path}new-docs/"
gsutil "${copy_options[@]}" "${PWD}/website/build/*" "${full_bucket_path}new-docs/"
}

if [[ "$1" != "nodocker" ]]; then
Expand Down
20 changes: 20 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
25 changes: 25 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Website

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.
3 changes: 3 additions & 0 deletions website/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
2 changes: 2 additions & 0 deletions website/docs/01_guidelines/_category_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
label: Guidelines
collapsed: false
Loading
Loading