Skip to content

Commit 4244224

Browse files
jpdriverryansrofegksander
authored
[Docs] New website (#1109)
* scaffold new Docusaurus site * replace /docs dir * set baseUrl and change build out-dir * re-add formideploy and config * update docs GH Actions workflow * fix incorrect build out-dir path * re-enable GTM * lint website dir too * restore brand colors to sidebar * commenting out dup nav item * adding styled components and types, oss-badges, copy-to-clipboard * touch when adding libs * adding statis assets from previous codebase, refactored file organization just a bit * removing infima based styles in favor of styled components * integrating previous non-typescript codebase to typescript for lander * optional props removing the requirement for noMargin and noPadding misc code cleanup * fix header svg and video issues * Update get-started.tsx cleanup and consistency * updating button styles * autoPlay still breaks the Video i have removed the autoPlay prop as it crashes the app at the terminal. made some comments as a reminder of the issue * include fix for PR number in Docs GH Action * adding autoPlay back to video needed to downgrade node to 16 LTS * adding and updating libs * added, removed, reorganized, and renamed various static asset files * moved to index dir * Delete custom.css converted to use sass * various updates to config for docusaurus updates for sass, alpha, there are some comments in here that are still in testing for nav items and footer * grok'd for old code, bridge between compiled CSS vars and JS * various global styles * the heart of our CSS customizations happens in this file * import paths, added content as props, and theme provider * overhaul of the preview section * overhaul of the oss section * overhaul of the header and hero sections * overhaul of the get started CTA section * overhaul of the features section * all content for the site comes from this file and is passed down via props * overhaul of various global components used like wrappers, buttons, titles, body copy, etc * removing getComputedStyle as it's unneeded and causes an SSR issue * adding engines <18 * docs for testing second level * touch update to libs * swapped icon for logo and removed old code * remove the privacy and cookie stuff * design adjustments * fix bug where copy button switches color depending on color mode * how dare they use any-link * adding new theme value * design updates and cleanup * fixing broken link preventing build from completing * update h1 to uppercase * add label for small screens * hero h1 uppercase * mobile adjustments * design tweaks * bug fix for broken link * additional design updates * update lib to 2.0-rc-1 * fix typo * adding a temp external link for testing * naming cleanup * documentation of styles * fix odd spacing * adding overrides for prism styles * refactor function to utils * cleanup and refactor to global, light, dark sections * footer logo link and mobile style adjustment * adding width and height to images * adding height auto so images can resize properly * auto height * adding a height to see if that will contain the badge * hover color to white * remove testing link * font color to 454545 * restore index.md page and filter from Sidebar * adding redirects docusaurus plugin * rewiring basic-concepts to be index for docs * comments * remove swizzled sidebar * ripping styles components and replacing with css modules * updating to 2.0 * touch * converting all rem values to be 37.5% smaller original code had a 62.5% font hack in it which was colliding with docusaurus. I've gone through and removed pattern and converted all rem values. Many values can be refactored into variables. * fixing grid and badge alignment * spacing adjustments * consolidating values to variables round 1 * consolidating values to variables round 2 * adding new darkest grey for prism background in dark mode * smoothing out animations, adding clsx where needed * removing testing MD files * Remove some JSX.Element * Small tweak to docusaurus config * Slim prism config * Prune some commented-out CSS * Remove superfluous && className * Dedup romanize fn * Update docs.yml * Docs footer logo fix * Add robots.txt * SEO fixes Co-authored-by: Ryan Srofe <[email protected]> Co-authored-by: Grant Sander <[email protected]>
1 parent 9fa5a30 commit 4244224

File tree

135 files changed

+13184
-14498
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+13184
-14498
lines changed

.github/workflows/docs.yml

Lines changed: 40 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,75 @@
1-
name: Docs
1+
name: Deploy Website
22

3-
defaults:
4-
run:
5-
working-directory: ./docs
6-
7-
# Compiles and deploys documentation on:
8-
# every push that has a change in the docs folder
9-
# every pull request with main branch as the base and has a change in the docs folder
103
on:
114
push:
125
paths:
136
- 'docs/**'
7+
- 'website/**'
148
pull_request:
159
branches:
1610
- main
1711
paths:
1812
- 'docs/**'
13+
- 'website/**'
14+
15+
defaults:
16+
run:
17+
working-directory: ./website
1918

2019
jobs:
21-
docs:
22-
name: Build the docs
23-
# TODO: Switch to `ubuntu-latest` when GH internal migration complete
24-
# because it has awscli@2 built in.
25-
# See `ubuntu-latest` note in: https://docs.github.com/en/actions/reference/specifications-for-github-hosted-runners#supported-runners-and-hardware-resources
26-
runs-on: ubuntu-20.04
27-
strategy:
28-
matrix:
29-
node-version: [14.x]
20+
deploy-website:
21+
runs-on: ubuntu-latest
22+
3023
steps:
3124
- uses: actions/checkout@v2
32-
- uses: actions/setup-node@v2
33-
with:
34-
node-version: ${{ matrix.node-version }}
3525

36-
- name: Get Yarn Cache Directory Path
37-
id: cache-dir-path
26+
- name: AWS CLI version
27+
run: "aws --version"
28+
29+
- name: Get yarn cache directory path
30+
id: yarn-cache-dir-path
3831
run: echo "::set-output name=dir::$(yarn cache dir)"
3932

40-
- name: Use Yarn Cache
41-
uses: actions/cache@v2
42-
id: cache
33+
- uses: actions/cache@v2
34+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
4335
with:
44-
path: ${{ steps.cache-dir-path.outputs.dir }}
45-
key: ${{ runner.os }}-yarn-${{ hashFiles('./docs/yarn.lock') }}
46-
47-
- name: Installation ${{ matrix.node-version }}
48-
run: yarn --prefer-offline --frozen-lockfile --non-interactive
49-
50-
# Used to install the root node_modules necessary for linting
51-
- name: Root Node Installation ${{ matrix.node-version }}
52-
working-directory: ./
53-
run: yarn --prefer-offline --frozen-lockfile --non-interactive
54-
55-
- name: Check Code ${{ matrix.node-version }}
56-
run: yarn check-ci
36+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
37+
key: ${{ runner.os }}-yarn-${{ hashFiles('website/yarn.lock') }}
38+
restore-keys: |
39+
${{ runner.os }}-yarn-
5740
58-
- name: Clean Code ${{ matrix.node-version }}
59-
run: yarn clean
41+
- name: Install Dependencies
42+
run: yarn install --frozen-lockfile
6043

61-
- name: Build Docs ${{ matrix.node-version }}
44+
- name: Build the website
6245
run: yarn build
6346

64-
# deploy to staging if the branch is not main
65-
- name: Deploy Docs (staging)
47+
# Use `gh` tool to infer more information about the pull request.
48+
# The underlying issue here is pushes to a non-mergeable/main target branch
49+
# don't have the PR number easily available.
50+
# https://stackoverflow.com/a/70102700
51+
- name: Get pull request info
52+
id: pr_info
53+
run: echo "::set-output name=pull_request_number::$(gh pr view --json number -q .number || echo "")"
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
57+
- name: Deploy docs (staging)
6658
if: github.ref != 'refs/heads/main'
6759
run: yarn deploy:stage
6860
env:
61+
# GH actions have a PR merge commit that _isn't_ our actual commits.
62+
# Manually infer correct branch and sha for pull requests.
6963
FORMIDEPLOY_GIT_SHA: ${{ github.event.pull_request.head.sha }}
64+
FORMIDEPLOY_PULL_REQUEST: ${{ steps.pr_info.outputs.pull_request_number }}
7065
GITHUB_DEPLOYMENT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7166
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
7267
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
7368

74-
# deploy to production only if the branch is main
7569
- name: Deploy docs (production)
7670
if: github.ref == 'refs/heads/main'
77-
run: yarn run deploy:prod
71+
run: yarn deploy:prod
7872
env:
7973
GITHUB_DEPLOYMENT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8074
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
81-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
82-
75+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

docs/.babelrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/README.md

Lines changed: 0 additions & 91 deletions
This file was deleted.

docs/content/advanced-concepts.md renamed to docs/advanced-concepts.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Advanced Concepts
33
order: 2
4+
sidebar_position: 2
45
---
56

67
# Advanced Concepts
@@ -29,8 +30,8 @@ A handful of query parameters are supported within your Spectacle presentation.
2930
Append your URL with one of the following parameters, like so: `&<parameter>=true`.
3031
To combine parameters, use multiple `&` to separate the parameters, e.g.: `&exportMode=true&printMode=true`
3132

32-
| Parameter | Description of Use |
33-
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
34-
| `exportMode` | For exporting your presentation as a PDF. Add it to your project URL and "Save to PDF" directly from the browser |
35-
| `printMode` | Turns your slideshow into a printer-friendly, black & white version. Meant for use concurrently with `?exportMode` e.g. `?exportMode=true&printMode=true` |
36-
| `presenterMode` | Displays a Presenter Mode for ease of presentation. For more info on this mode, please see [Presenting](./basic-concepts#presenting) in our Basic Concepts doc |
33+
| Parameter | Description of Use |
34+
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
35+
| `exportMode` | For exporting your presentation as a PDF. Add it to your project URL and "Save to PDF" directly from the browser |
36+
| `printMode` | Turns your slideshow into a printer-friendly, black & white version. Meant for use concurrently with `?exportMode` e.g. `?exportMode=true&printMode=true` |
37+
| `presenterMode` | Displays a Presenter Mode for ease of presentation. For more info on this mode, please see [Presenting](./#presenting) in our Basic Concepts doc |

docs/content/api-reference.md renamed to docs/api-reference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: API Reference
33
order: 5
4+
sidebar_position: 5
45
---
56

67
# API Reference

0 commit comments

Comments
 (0)