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

Update to Docusaurus 3.7 #427

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
78 changes: 17 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,100 +3,56 @@ OpenRefine.org website

We use [Docusaurus](https://docusaurus.io/) for our website.

If you want to run it locally, you can follow the instructions below, otherwise you should be able to edit most pages directly with a Markdown editor.
Opening a pull request for your changes will generate a preview that you can browse to check the rendering.
If you want to run it locally, you can follow the instructions below, otherwise you should be able to edit most pages directly with a Markdown editor or IDE.
Opening a pull request for your changes will generate a preview on Netlify that you can browse to check the rendering.

### Requirements

Assuming you have [Node.js (LTS recommended)](https://nodejs.org/en/download/) installed (which now includes corepack), you can install Docusaurus with:

Enable Corepack, if it isn't already; this will add the [Yarn](https://yarnpkg.com/getting-started/install) binary to your PATH:

```sh
corepack enable
```

Update Yarn to the latest version:

```sh
yarn set version stable
```
- [Node.js (LTS recommended)](https://nodejs.org/en/download/)
- includes npm package manager

### Installation

Once you have installed yarn, navigate to docs directory & set-up the dependencies.
Once you have installed Node, which includes the npm package manager, we can install and set-up the dependencies:

```sh
cd docs
yarn
npm install
```

### Local Development

```sh
yarn start
```

This command starts a local development server and opens up a browser window. Usually at the URL <http://localhost:3000>
Most changes are reflected live without having to restart the server.

If you get an error starting yarn mentioning `update.latest` such as

```sh
>yarn start

if (notifier.update && semver.gt(this.update.latest, this.update.current)) {
TypeError: Cannot read property 'latest' of undefined
at Object.<anonymous> (E:\GitHubRepos\OpenRefine\docs\node_modules\@docusaurus\core\bin\docusaurus.js:49:46)
error Command failed with exit code 1.
```
The following command starts a local development server and opens up a browser window. Usually at the URL <http://localhost:3000>.

then it is likely that you will need to first upgrade dependencies across all workspaces at the same time
Most changes you make to pages and content are reflected live without having to restart the server.

```sh
yarn up
npm run start
```

which will update all dependencies and store them in the `yarn.lock` file to also be committed.

### Next version of OpenRefine docs
Copy link
Member Author

@thadguidry thadguidry Feb 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wetneb @ostephens FYI, since we don't do versioning of docs any longer, then this section in the README.md needed to be removed as well.


If you wish to work on the next version of docs for OpenRefine (`master` branch) then you will need to:

1. Git checkout our `master` branch
2. Edit files under `docs/docs/`
3. Preview changes with the URL kept pointing to <http://localhost:3000/next> which will automatically
show changes live with yarn after you save a file.

### Build

The following command generates static content into the `build` directory and can be served using any static contents hosting service.

```sh
yarn build
npm run build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.
### (Optional) Test Build Locally
You can locally test ([with parameters](https://docusaurus.io/docs/cli#docusaurus-serve-sitedir)) the static content in the `build` directory (in case you don't have access to a hosting service) by using:

```sh
yarn serve
```

or to build and then serve locally with one command:

```sh
yarn serve --build
npm run serve
```

### Deployment

```sh
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website
and push to the `gh-pages` branch.

```sh
GIT_USER=<Your GitHub username> USE_SSH=true npm run deploy
```

### License

This website is published under the [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).
11 changes: 11 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,21 @@ return {
},
blog: {
blogSidebarCount: 'ALL',
onInlineAuthors: 'ignore',

},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
svgr: {
svgrConfig: {
// Your SVGR options ...
svgoConfig: {
// Your SVGO options ...
// Use "svgoConfig: undefined" to use a svgo.config.js file
},
},
},
},
],
],
Expand Down
7 changes: 4 additions & 3 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# Note: this file's config overrides the Netlify UI admin config

[context.production]
command = "yarn netlify:build:production"
command = "npm run netlify:build:production"
environment = { NPM_FLAGS = "--force --no-progress" }

[context.deploy-preview]
command = "yarn netlify:build:deployPreview"

command = "npm run netlify:build:deployPreview"
environment = { NPM_FLAGS = "--force --no-progress" }
Loading