Skip to content
Merged
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
14 changes: 8 additions & 6 deletions packages/create-docusaurus/templates/shared/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,23 @@ This website is built using [Docusaurus](https://docusaurus.io/), a modern stati
## Installation

```bash
yarn
npm install
```

**Note**: feel free to use the package manager of your choice.

## Local Development

```bash
yarn start
npm run 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

```bash
yarn build
npm run build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.
Expand All @@ -29,13 +31,13 @@ This command generates static content into the `build` directory and can be serv
Using SSH:

```bash
USE_SSH=true yarn deploy
USE_SSH=true npm run deploy
```

Not using SSH:

```bash
GIT_USER=<Your GitHub username> yarn deploy
GIT_USER=<Your GitHub username> npm run 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.
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.
19 changes: 19 additions & 0 deletions website/docs/api/plugins/plugin-ideal-image.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,25 @@ import thumbnail from './path/to/img.png';
<Image img={require('./path/to/img.png')} />
```

:::note

When `plugin-ideal-image` is installed, importing a supported image file no longer returns a plain URL string. Instead, it returns an object with the shape: `{ preSrc: string, src: { src: string, width: number, height: number } }`.

If you need to use the image in a standard `<img>` tag, access it like this:

```jsx
<img
src={image.src.src}
width={image.src.width}
height={image.src.height}
alt="description"
/>
```

To avoid dealing with this object shape directly, it is recommended to use the `<Image>` component provided by this plugin instead.

:::

:::warning

This plugin registers a [Webpack loader](https://webpack.js.org/loaders/) that changes the type of imported/require images:
Expand Down
16 changes: 8 additions & 8 deletions website/docs/deployment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: npm

- name: Install dependencies
Expand Down Expand Up @@ -455,7 +455,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: npm

- name: Install dependencies
Expand Down Expand Up @@ -487,7 +487,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: yarn

- name: Install dependencies
Expand Down Expand Up @@ -541,7 +541,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: yarn

- name: Install dependencies
Expand Down Expand Up @@ -608,7 +608,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
Expand All @@ -623,7 +623,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: yarn
- uses: webfactory/ssh-agent@v0.5.0
with:
Expand Down Expand Up @@ -675,7 +675,7 @@ Continuous integration (CI) services are typically used to perform routine tasks
```yml title=".travis.yml"
language: node_js
node_js:
- 20
- 24
branches:
only:
- main
Expand Down Expand Up @@ -734,7 +734,7 @@ steps:

- task: NodeTool@0
inputs:
versionSpec: '20'
versionSpec: '24'
displayName: Install Node.js

- script: |
Expand Down
Loading