Static Resource Standards
How to use this guide
Shared naming and reference rules are maintained here. Follow the recommendations for new assets; inspect actual paths, references and build configuration before changing existing assets.
1. Current asset entry points
| Location | Current role |
|---|---|
qontology-ui/src/assets/ | Existing directories include ai, fonts, iconfont, icons, ke and system |
src/assets/system/styles/ | Global and product styles loaded by main.js |
src/assets/icons/svg/ | Directory scanned by the SVG sprite plugin |
src/assets/iconfont/ | Icon fonts and styles |
qontology-ui/public/ | Static files served directly |
vite/plugins/svg-icon.js scans src/assets/icons/svg and uses icon-[dir]-[name] for symbol IDs. When moving an SVG, check its SvgIcon references; moving the file alone can make the icon disappear.
2. Recommended layout for new assets
The following is a proposal for incremental organization, not the current tree. Group new assets by type and business owner. Put shared assets in that type’s common directory rather than duplicating them across modules. Add page-level directories when needed.
assets/
├── images/
│ ├── common/
│ ├── basic/
│ ├── om/
│ ├── app/
│ ├── ai/
│ └── system/
├── icons/svg/
│ ├── common/
│ └── om/
├── fonts/common/
└── styles/common/3. Naming and formats
| Category | Example | Guidance |
|---|---|---|
| Images | empty-ontology.svg, banner-modeling.webp | Use a purpose prefix and meaningful lowercase hyphenated names |
| Brand assets | logo-qontology.svg | Preserve artwork and proportions |
| Action icons | action-add-object.svg | Use the same icon for the same action |
| Icon font classes | icon-action-save | Name new classes clearly; preserve old references |
| Fonts | example-sans-regular.woff2 | Name by family and weight; this is an example filename |
| Styles | ontology-canvas.scss | Name by responsibility; avoid vague new/final names |
Choose formats that balance clarity and size: SVG for icons, WebP/JPEG for photos, and PNG/WebP for transparent bitmaps. Export at suitable display dimensions instead of using huge originals for small thumbnails. Add animation only when useful, and write alt text that describes the image rather than its filename.
4. Referencing assets
Use static imports for bundled assets so the build tool can discover dependencies. The following path is an example; create the referenced file before using it:
<script setup>
import emptyOntology from '@/assets/images/om/empty-ontology.svg'
</script>
<template>
<img :src="emptyOntology" alt="Ontology" width="240" height="160" />
</template>Serve files in public relative to the deployment base, without public/ in the URL. For subpath deployments, construct URLs using the project’s base configuration and verify them. Do not turn arbitrary user input into import paths or embed local absolute filesystem paths in pages.
5. Fonts and styles
Load only the font weights and character ranges actually needed, verify redistribution rights, and provide fallback fonts and an appropriate font-display. Avoid importing a whole font package for one icon.
Keep component-specific styles scoped; centralize theme variables and reusable styles. Check the current import order in main.js before changing global entries to avoid unintended overrides of Element Plus or other pages. The proposed layout does not require moving every existing stylesheet.
6. Before submitting changes
- Check size, filename case, duplicates and unused files; verify imports resolve.
- After replacement, review affected menus, login screens, empty states and graph canvases.
- Look for 404s in the browser Network panel and confirm SVG symbols match component references.
- Verify development and production builds, narrow screens, and light/dark backgrounds.
- Keep secrets, user data and internal-environment screenshots out of assets.
See Source Code Tour for project entry points.
