Nuxt/docs/2.guide/2.directory-structure/1.public.md

28 lines
732 B
Markdown
Raw Normal View History

---
title: "public"
description: "The public/ directory is used to serve your website's static assets."
head.title: "public/"
navigation.icon: i-ph-folder
---
Files contained within the `public/` directory are served at the root and are not modified by the build process. This is suitable for files that have to keep their names (e.g. `robots.txt`) _or_ likely won't change (e.g. `favicon.ico`).
```bash [Directory structure]
-| public/
---| favicon.ico
---| og-image.png
---| robots.txt
```
```vue [app.vue]
<script setup lang="ts">
useSeoMeta({
ogImage: '/og-image.png'
})
</script>
```
::tip{to="https://v2.nuxt.com/docs/directory-structure/static" target="_blank"}
This is known as the [`static/`] directory in Nuxt 2.
::