Skip to content

Commit

Permalink
feat: use @nuxt/image
Browse files Browse the repository at this point in the history
Add example how to use `@nuxt/image` to load an image.

Closes #265
  • Loading branch information
jojomatik committed Sep 1, 2023
1 parent 7c9756a commit 117214a
Show file tree
Hide file tree
Showing 5 changed files with 265 additions and 20 deletions.
11 changes: 5 additions & 6 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
<div style="display: flex; align-items: center">
Nuxt 3 Base by
<a href="https://github.com/jojomatik" class="pl-1">
<v-img
:src="jojomatikLogo"
<nuxt-img
src="/assets/jojomatik.png"
width="120"
preload
alt="Jojomatik Logo"
></v-img>
></nuxt-img>
</a>
</div>
</v-app-bar-title>
Expand All @@ -20,8 +21,6 @@
</template>

<script setup lang="ts">
import jojomatikLogo from "assets/jojomatik.png";
const i18n = useI18n();
useHead({ htmlAttrs: { lang: i18n.locale.value } });
Expand All @@ -31,7 +30,7 @@ useSeoMeta({
ogTitle: i18n.t("title"),
description: i18n.t("description"),
ogDescription: i18n.t("description"),
ogImage: jojomatikLogo,
ogImage: "/assets/jojomatik.png",
});
</script>

Expand Down
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default defineNuxtConfig({
},
},
css: ["vuetify/styles"],
modules: ["@nuxtjs/i18n", "@nuxtjs/robots"],
modules: ["@nuxt/image", "@nuxtjs/i18n", "@nuxtjs/robots"],
hooks: {
"nitro:build:before": () => {
const fontsDir = "public/assets/fonts/";
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"dependencies": {
"@fontsource/roboto": "^5.0.8",
"@mdi/js": "^7.2.96",
"@nuxt/image": "^1.0.0-rc.1",
"nuxt": "^3.7.0",
"vue": "^3.3.4",
"vue-i18n": "^9.2.2",
Expand Down
File renamed without changes
Loading

1 comment on commit 117214a

@vercel
Copy link

@vercel vercel bot commented on 117214a Sep 1, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.