Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy docs

on:
push:
branches: [master]
pull_request:
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history for "last updated" timestamps
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run check:locales # every page must exist in both vi and en
- run: npm run build # fails on dead internal links
- uses: actions/configure-pages@v5
if: github.event_name != 'pull_request'
- uses: actions/upload-pages-artifact@v3
if: github.event_name != 'pull_request'
with:
path: src/.vitepress/dist

deploy:
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
src/.vitepress/dist/
src/.vitepress/cache/
plans/
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
# LCOJ Documentation

Tài liệu hướng dẫn cho hệ thống [LCOJ](https://github.com/luyencode/lcoj-site).
Tài liệu hướng dẫn cho hệ thống [LCOJ](https://github.com/luyencode/lcoj-site). Truy cập tại <https://docs.luyencode.net>.

LCOJ được phát triển dựa trên [DMOJ](https://github.com/DMOJ/online-judge) và [VNOJ](https://github.com/VNOI-Admin/OJ).

Truy cập tài liệu tại <https://luyencode.github.io/docs>.
## Chạy ở máy local

Cần Node.js 18 trở lên.

```sh
npm install
npm run dev # http://localhost:5173, tự reload khi sửa file
npm run build # build ra src/.vitepress/dist, báo lỗi nếu có link hỏng
npm run check:locales # kiểm tra mỗi trang có đủ bản tiếng Việt và tiếng Anh
npm run preview # xem bản build
```

## Cấu trúc

```
src/
├── .vitepress/config.mts # cấu hình chung
├── .vitepress/locales/ # menu, sidebar cho từng ngôn ngữ (vi, en)
├── public/ # ảnh, logo, CNAME
├── index.md # trang chủ tiếng Việt
├── features/ site/ judge/ problem_format/ about/
└── en/ # bản tiếng Anh, cùng cấu trúc với bản tiếng Việt
```

**Mỗi trang phải có đủ hai ngôn ngữ.** Thêm trang mới:

1. Tạo `src/<đường-dẫn>.md` (tiếng Việt) và `src/en/<đường-dẫn>.md` (tiếng Anh).
2. Thêm link vào sidebar trong cả `src/.vitepress/locales/vi.mts` và `en.mts`.
3. Chạy `npm run check:locales`. CI sẽ báo lỗi nếu một trang chỉ có một ngôn ngữ.

Tài liệu không dùng ảnh chụp màn hình. Hãy dùng sơ đồ Mermaid (khối ` ```mermaid `), bảng và hộp lưu ý (`::: tip`, `::: warning`).

## Triển khai

Mỗi lần push lên `master`, GitHub Actions (`.github/workflows/deploy.yml`) build và đăng lên GitHub Pages. Pull request chỉ build để kiểm tra.
Empty file removed docs/.nojekyll
Empty file.
18 changes: 0 additions & 18 deletions docs/README.md

This file was deleted.

32 changes: 0 additions & 32 deletions docs/_sidebar.md

This file was deleted.

Binary file removed docs/favicon.ico
Binary file not shown.
33 changes: 0 additions & 33 deletions docs/index.html

This file was deleted.

Loading
Loading