openGauss-website
Source code repository of the openGauss community official website
Directory Structure
The website is built with Vue 3 and TypeScript on top of the VitePress framework. Most of its functions are rendered with static files, while only a few function modules (calendar, CVE, search, and filtering) require backend deployment.
app
├─ .vitepress
├─ public // Static resource file, not packaged or compiled
├─ src // Services
├─ api // APIs
├─ assets // Resource files
├─ components // Components
├─ i18 // Internationalization
├─ shared // Public methods/styles
├─ stores // Status management
├─ views // Service Vue files
├─ en // English page
├─ zh // Chinese page
Contributions
- Fork this repository.
- Create a
Feat_xxxbranch. - Commit code.
- Create a pull request (PR).
Note: Merge commit with git rebase -i to ensure there is only one commit for a PR. For detailed operations, see Related Documents.
Instructions
Naming
Naming Pattern
camelCasekebab-casePascalCaseSnake
Description
- Use
kebab-casefor all file and file folder names (except Vue SFC). - Use
PascalCasefor Vue SFC file names and Vue components used by the files. - Use
kebab-caseforemitevents of the Vue components. - Use
camelCasefor variable and method names andSnakefor resource files, with the style (light/dark) and language (zh/en/ru) specified in the style_language sequence (e.g.homeBanner_light_zh). - Use
kebab-casefor CSS names. - Add the
Iconprefix for Icon components to be imported (e.g.import IconDownload from '~icons/app/download').
Development Specifications
- Specify all API class methods in
app/.vitepress/src/apiand comment them according to the JSDoc comment rules. Distinguish the APIs by file between modules (e.g.api-cve.ts). - Comment public utils methods according to JSDoc comment rules.
- Name variables with self-explanatory description and name methods with verbs or verb-object structures (e.g.
import warningImg from '@/assets/icons/warning.png,const getUserEmail=()=>{}). - Use
try {} catch(error) {}for verification when calling an API to obtain data. - Use
Object.keys().forEachto replacefor...inwhenever possible. - Use the
prettierplug-in as the formatting tool. - Before commits, run
pnpm lintto perform an ESLint check. Do not commit until all errors are cleared. Ifgit commitfails the checks configured in the project's git hooks, resolve the issues based on the error messages. - Follow related specifications whenever possible when using
git commit. - For other specifications, consult prevailing development specifications in the industry.
Get Help
- IRC: #opengauss-infra
- Email: infra@opengauss.org