Skip to content

Commit

Permalink
Migrate Developer Site to Docusaurus (#535)
Browse files Browse the repository at this point in the history
* Add default Docusaurus template

* Move content to correct place

* Move static content to the correct folder

* Customize Docusaurus config

* Tweak tutorial Markdown to build in Docusaurus

* Remove blog completely

* Fix sidebar ordering

* Remove unused layout property from front matter

* Fix incorrect HTML in shader chunks markdown

* Remove linting from GitHub Actions

* Remove default tutorial pages from Docusaurus template

* Update package.json

* Re-add scripts for processing the FAQ

* Update README

* Add favicon and header image

* Add PlayCanvas logo

* Update front page

* Add tutorials page

* Remove all layout references

* Switch to Docusaurus admonitions

* Fix broken link

* Add Tutorials section (#537)

* Fixed alert admonitions that weren't rendering

* Revert "Fixed alert admonitions that weren't rendering"

This reverts commit b2e1a04.

* Added sass  for styling

* Added tutorial sidebar

* added tutorials

* Added npm script to generate all tutorial data

* styling changes

* fixed iframe sizing

* reverted japanese docs

* reverting japanese

* Removed snap registry

* Updated readme with Tutorials info

* Fixed issue with 360 page not rendering

* Fixed front matter whitespace

* whitespacing

* Added white space around html in markdown

* newline

* newline around divs

* renamed for consistency with existing url

* missing newline

* removed prebuild script

* removed redundant svg icons

* Fixed react rendering error. Renamed `class` attribute in markdown with `className` (#538)

* Update front page

* Update API ref image

* Fix background image placement

* Update footer

* Colour theming (#539)

* Added pc colour theming

* removed box sizing

---------

Co-authored-by: Mark Lundin <[email protected]>
  • Loading branch information
willeastcott and marklundin authored Jan 10, 2024
1 parent b7ad69d commit e9a18d6
Show file tree
Hide file tree
Showing 2,671 changed files with 60,716 additions and 96,545 deletions.
49 changes: 0 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,52 +39,3 @@ jobs:

- name: Build Site
run: npm run build

lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10

strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm clean-install --progress=false --no-fund

- name: Lint JavaScript
run: npm run lint

lint-html:
name: Lint HTML
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'

- name: Install dependencies
run: npm clean-install --progress=false --no-fund

- name: Build
run: npm run build

- name: Lint HTML
run: npm run lint:html
27 changes: 19 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
.sass-cache
.vscode
build
node_modules
messages.json
content/_usermanual_contents.json
content/_shadereditor_contents.json
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

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

npm-debug.log*
yarn-debug.log*
yarn-error.log*
8 changes: 0 additions & 8 deletions .htmlvalidate.json

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2011-2023 PlayCanvas Ltd.
Copyright (c) 2011-2024 PlayCanvas Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
# PlayCanvas Developer Site

This is source repository for the [PlayCanvas Developer Site](https://developer.playcanvas.com/). It is made up of static web content generated from Markdown files using [Metalsmith](https://metalsmith.io).
This is source repository for the [PlayCanvas Developer Site](https://developer.playcanvas.com/). It is made up of static web content generated from Markdown files using [Docusaurus](https://docusaurus.io).

## How to build

Building the site requires `node` and `npm`.
Building the site requires an install of Node.js 18+.

cd developer.playcanvas.com
npm install
npm i
npm run build

## How to serve

To serve the site locally:
To serve the built site locally:

npm run serve

Now visit http://localhost:51000 in your browser.
This will automatically open the built site in your browser.

## Use 'watch' for quick iteration
## Use 'start' for quick iteration

The watch build command will automatically rebuild the site when changes are made in the `content` or `public` folders.
The `start` build command will automatically rebuild the site when changes are made in the `docs`, `src` or `static` folders.

npm run watch
npm run start

## Update CSS from SCSS
## Update Tutorials

The site uses Sass to generate the CSS. To generate, run:

npm run sass
Tutorials are regular markdown files and can be edited directly. However if you change the front matter, ie the tags, title or thumbnail, you'll need to regenerate the tutorials index using `npm run generate-tutorial-data`. You'll also need to do this if you add or remove a tutorial.

## Update FAQ

The User Manual on the developer site has a FAQ page which can be found at `content/en/user-manual/faq.md`. This is the only Markdown file which is generated from other files (located in the `faq` directory). If you would like to add additional FAQs, check them in to the `faq` directory and to regenerate `content/en/user-manual/faq.md` run:
The User Manual on the developer site has a FAQ page which can be found at `docs/user-manual/faq.md`. This is the only Markdown file which is generated from other files (located in the `faq` directory). If you would like to add additional FAQs, check them in to the `faq` directory and to regenerate `docs/user-manual/faq.md` run:

npm run faq

Expand All @@ -48,4 +46,4 @@ To scan for broken hyperlinks, run:

## Localization

The Developer Site is translated via [Transifex](https://www.transifex.com/playcanvas/playcanvas-developer-site). When anything in `content/en` is updated, run `tx push`. Once translation acitivity on Transifex is complete, run `tx pull` and submit a PR with the updated language content. Instructions on setting up the Transifex CLI tool `tx` can be found [here](https://developers.transifex.com/docs/cli#installation). Note that the first time you push with `tx`, you will need to enter the Transifex developer key (contact an Admin of the Transifex project to obtain this).
The Developer Site is translated via [Transifex](https://www.transifex.com/playcanvas/playcanvas-developer-site). When anything in `docs` is updated, run `tx push --silent`. Once translation acitivity on Transifex is complete, run `tx pull --silent` and submit a PR with the updated language content. Instructions on setting up the Transifex CLI tool `tx` can be found [here](https://developers.transifex.com/docs/cli#installation). Note that the first time you push with `tx`, you will need to enter the Transifex developer key (contact an Admin of the Transifex project to obtain this).
3 changes: 3 additions & 0 deletions 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')],
};
177 changes: 0 additions & 177 deletions build.mjs

This file was deleted.

6 changes: 0 additions & 6 deletions content/en/error.md

This file was deleted.

48 changes: 0 additions & 48 deletions content/en/index.md

This file was deleted.

4 changes: 0 additions & 4 deletions content/en/search.md

This file was deleted.

Loading

0 comments on commit e9a18d6

Please sign in to comment.