Static assets
Images, fonts, styles and scripts get to the site in one of two ways: copied as they are from the public folder, or processed by Vite.
The public folder
Files in the public folder, postdoc/public/ by default, are copied to the root of the site unchanged. postdoc/public/favicon.png is served at /favicon.png, and postdoc/public/images/logo.svg at /images/logo.svg.
Use the public folder for files whose name must not change, such as robots.txt or a favicon, and for images in your Markdown:
To use another folder, set directories.vitePublic.
Files processed by Vite
Any other path that starts with / points to a file in your project, relative to the project root:
<link rel="stylesheet" href="/postdoc/css/site.css" />
<script type="module" src="/postdoc/js/site.js"></script>In a build, Vite bundles these files: it follows their imports, minifies them and adds a content hash to the file names, so browsers can cache them for as long as they like. A script can import packages from node_modules, and a stylesheet can be Sass or PostCSS if you install the tools Vite needs.
Sites in a subfolder
When the site has a base path, builds add it to every path that starts with /: in links and attributes, in inline styles, and in stylesheets, including the ones in the public folder. Write paths from the root of the site either way.
Theme files
The theme's public files are served as if they were in your public folder. A file of yours with the same path replaces the theme's, which is how you swap a theme's stylesheet or logo.