Some checks failed
CI/CD Pipeline / Test Suite (push) Has been cancelled
CI/CD Pipeline / Security Audit (push) Has been cancelled
CI/CD Pipeline / Build Docker Image (push) Has been cancelled
CI/CD Pipeline / Deploy to Staging (push) Has been cancelled
CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Performance Benchmarks (push) Has been cancelled
CI/CD Pipeline / Cleanup (push) Has been cancelled
68 lines
1.6 KiB
Markdown
68 lines
1.6 KiB
Markdown
# Public Assets Directory
|
|
|
|
This directory contains static assets that are served directly by your web server.
|
|
|
|
## Structure
|
|
|
|
```
|
|
public/
|
|
├── favicon.ico # Site favicon
|
|
├── robots.txt # Search engine directives
|
|
├── sitemap.xml # Site map for SEO
|
|
├── images/ # Image assets
|
|
├── styles/ # Additional CSS files
|
|
├── scripts/ # Client-side JavaScript
|
|
└── documents/ # Downloadable files
|
|
```
|
|
|
|
## Asset Processing
|
|
|
|
- **Images**: Automatically optimized and served
|
|
- **Styles**: Processed through UnoCSS and PostCSS
|
|
- **Scripts**: Bundled through Vite
|
|
- **Documents**: Served as-is
|
|
|
|
## Usage
|
|
|
|
### Images
|
|
Place images in `public/images/` and reference them:
|
|
```html
|
|
<img src="/images/logo.png" alt="Logo" />
|
|
```
|
|
|
|
### Custom Styles
|
|
Add custom CSS to `public/styles/custom.css`:
|
|
```css
|
|
.my-custom-class {
|
|
/* Your styles */
|
|
}
|
|
```
|
|
|
|
### Client Scripts
|
|
Add JavaScript to `public/scripts/`:
|
|
```javascript
|
|
// Custom client-side code
|
|
console.log('Hello from {{project_name}}!');
|
|
```
|
|
|
|
## SEO Files
|
|
|
|
The basic template includes:
|
|
- `robots.txt` - Search engine crawling rules
|
|
- `sitemap.xml` - Generated automatically from your content
|
|
- `manifest.json` - PWA configuration (optional)
|
|
|
|
## Optimization
|
|
|
|
All assets are automatically:
|
|
- Compressed (gzip/brotli)
|
|
- Cached with appropriate headers
|
|
- Served through CDN (if configured)
|
|
- Optimized for performance
|
|
|
|
## Customization
|
|
|
|
You can customize asset handling in:
|
|
- `vite.config.js` - Build-time processing
|
|
- `rustelo.toml` - Runtime serving
|
|
- `unocss.config.ts` - CSS processing |