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

feat(docs): upgrade to latest Docus #678

Merged
merged 3 commits into from
Dec 7, 2022
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
2 changes: 0 additions & 2 deletions docs/.env.example

This file was deleted.

23 changes: 23 additions & 0 deletions docs/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export default defineAppConfig({
docus: {
url: 'https://image.nuxtjs.org',
title: 'Nuxt Image',
description: 'Plug-and-play image optimization for Nuxt apps. Resize and transform your images in your code using built-in optimizer or your favorite images CDN.',
header: {
logo: true
},
socials: {
twitter: '@nuxt_js',
github: 'nuxt/image',
nuxt: {
href: 'https://nuxt.com',
icon: 'simple-icons:nuxtdotjs',
label: 'Nuxt'
}
},
aside: {
level: 1
},
image: '/cover.jpg'
}
})
14 changes: 13 additions & 1 deletion docs/components/Logo.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<svg
class="w-auto h-8 text-[#18181B] dark:text-white"
width="198"
height="40"
viewBox="0 0 198 40"
Expand All @@ -15,3 +14,16 @@
<circle cx="6.55953" cy="10.56" r="3.04" fill="white" />
</svg>
</template>

<style lang="ts" scoped>
css({
svg: {
width: 'auto',
height: '2rem',
color: '#18181B',
'@dark': {
color: '{color.white}'
}
}
})
</style>
2 changes: 1 addition & 1 deletion docs/content/1.index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Optimized images for Nuxt
description: Plug-and-play image optimization for Nuxt apps. Resize and transform your images using built-in optimizer or your favorite images CDN.
layout: fluid
layout: page
navigation: false
---

Expand Down
24 changes: 10 additions & 14 deletions docs/content/2.get-started.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
---
title: Getting Started
description: Using image module in your Nuxt project is only one command away. ✨
icon: heroicons-outline:lightning-bolt
layout: page
aside: false
---

::article-hero
::
# Getting Started

::alert{type="info"}
Using image module in your Nuxt project is only one command away. ✨

::alert{type="info"}
You are reading the `v1` documentation compatible with **Nuxt 3** (experimental). Check out [image.nuxtjs.org](https://image.nuxtjs.org/getting-started/installation) for **Nuxt 2** compatible version. ([Announcement](https://github.com/nuxt/image/discussions/548)).

::

Add `@nuxt/image-edge` as a development dependency to your project:

::code-group
```bash [yarn]
yarn add --dev @nuxt/image-edge
```

```bash [npm]
npm install -D @nuxt/image-edge
```
```bash [yarn]
yarn add --dev @nuxt/image-edge
```
```bash [npm]
npm install -D @nuxt/image-edge
```
::

Add the module to `modules` in your `nuxt.config`:
Expand Down
21 changes: 11 additions & 10 deletions docs/content/3.components/1.nuxt-img.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: <nuxt-img>
description: Discover how to use and configure the nuxt-img component.
---
# `<nuxt-img>`

Discover how to use and configure the nuxt-img component.

`<nuxt-img>` is a drop-in replacement for the native `<img>` tag.

Expand Down Expand Up @@ -87,14 +86,15 @@ Use other provider instead of default [provider option](/configuration#provider)
</template>
```

```js [nuxt.config.js]
export default {

```ts [nuxt.config.ts]
export default defineNuxtConfig({
image: {
cloudinary: {
baseURL: "https://res.cloudinary.com/nuxt/image/upload/",
},
},
};
})
```

::
Expand All @@ -115,8 +115,9 @@ Presets are predefined sets of image modifiers that can be used create unified f
</template>
```

```ts [nuxt.config.js]
export default {

```ts [nuxt.config.ts]
export default defineNuxtConfig({
image: {
presets: {
cover: {
Expand All @@ -129,7 +130,7 @@ Presets are predefined sets of image modifiers that can be used create unified f
},
},
},
};
})
```

::
Expand Down
14 changes: 6 additions & 8 deletions docs/content/3.components/2.nuxt-picture.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
---
title: <nuxt-picture>
description: Discover how to use and configure the nuxt-picture component.
---
# `<nuxt-picture>`

Discover how to use and configure the nuxt-picture component.

`<nuxt-picture>` is a drop-in replacement for the native `<picture>` tag.

Usage of `<nuxt-picture>` is almost identical to [`<nuxt-img>`](nuxt-img)
but also allows serving modern formats like `webp` when possible.
Usage of `<nuxt-picture>` is almost identical to [`<nuxt-img>`](nuxt-img) but also allows serving modern formats like `webp` when possible.

Learn more about the [`<picture>` tag on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture)
Learn more about the [`<picture>` tag on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture).

## Props

::alert{type="info"}
See props supported by <a href="/components/nuxt-img#props">nuxt-img</a>
See props supported by[`<nuxt-img>`](/components/nuxt-img#props)</a>
::

### `legacyFormat`
Expand Down
7 changes: 4 additions & 3 deletions docs/content/4.api/2.$img.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
title: $img utility
description: Using $img utility to generate provider specific URLs.
aside: false
---

Sometimes it's required to directly use a generated image URL with applied transformations instead of `<nuxt-img>` and `<nuxt-picture>` components.
# $img utility

Sometimes it's required to directly use a generated image URL with applied transformations instead of `<nuxt-img>` and `<nuxt-picture>` components. This is where `$img` comes in.

## Usage

Expand Down
Loading