8000 Fix only one language by btnguyen2k · Pull Request #79 · btnguyen2k/docms · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix only one language #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Nov 6, 2024
5 changes: 5 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# DOCMS Release Notes

## 2024-11-06

Runtime `v0.4.0.2`:
- Fix: if the requested locale language is not available, the first available language will be used.

## 2023-06-29

Runtime `v0.4.0.1`:
Expand Down
2 changes: 1 addition & 1 deletion appinfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name" : "DOCMS",
"shortname" : "docms",
"initial" : "DOCMS",
"version" : "0.4.0.1",
"version" : "0.4.0.2",
"description": "Content Management System where its content is built through CI-CD pipeline"
}
2 changes: 1 addition & 1 deletion dosrc/03-components/01-docli/index-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ go install github.com/btnguyen2k/docms/docli@latest

You can also install a specific version (*):
```shell
go install github.com/btnguyen2k/docms/docli@cli-v0.3.1.1
go install github.com/btnguyen2k/docms/docli@cli-v0.3.1.3
```

```bs-alert warning
10000 Expand Down
2 changes: 1 addition & 1 deletion dosrc/03-components/01-docli/index-vi.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ go install github.com/btnguyen2k/docms/docli@latest

Cài đặt chỉ định một phiên bản cụ thể (*) qua câu lệnh:
```shell
go install github.com/btnguyen2k/docms/docli@cli-v0.3.1.1
go install github.com/btnguyen2k/docms/docli@cli-v0.3.1.3
```

```bs-alert warning
Expand Down
Binary file modified dosrc/03-components/02-runtime/bootstrap1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dosrc/03-components/02-runtime/bootstrap2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dosrc/03-components/02-runtime/bootstrap3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dosrc/03-components/02-runtime/coderdocs1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dosrc/03-components/02-runtime/coderdocs2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dosrc/03-components/02-runtime/coderdocs3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 86 additions & 5 deletions dosrc/03-components/02-runtime/index-en.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
`DO CMS runtime` is responsible for rendering website content. It also offers other features such as i18n and fulltext search.
`DO CMS runtime` is responsible for rendering website content. It also offers other features such as _i18n_ and _fulltext search_.

For your convenience, `DO CMS runtime` has already been containerized as a [Docker image](https://hub.docker.com/r/btnguyen2k/docmsruntime).

Expand All @@ -21,7 +21,9 @@ The Docker image offer the following tags:

## Environment Variables

**HTTP_LISTEN_ADDR** and **HTTP_LISTEN_PORT** - specify listen address & port number. Default value for HTTP_LISTEN_ADDR is `0.0.0.0` and HTTP_LISTEN_PORT is `8000`. The following command makes `DO CMS runtime` to listen on `127.0.0.1:3000`:
### HTTP_LISTEN_ADDR/HTTP_LISTEN_PORT

Specify listen address & port number. Default value for HTTP_LISTEN_ADDR is `0.0.0.0` and HTTP_LISTEN_PORT is `8000`. The following command makes `DO CMS runtime` to listen on `127.0.0.1:3000`:
```shell
docker run --name docms \
-p 8000:3000 \
Expand All @@ -30,7 +32,9 @@ docker run --name docms \
btng F438 uyen2k/docmsruntime
```

**GOOGLE_TAG** - specify Google Tag ID for Google Analytics, example:
### GOOGLE_TAG

Specify Google Tag ID for Google Analytics, example:
```shell
docker run --name docms \
-p 8000:8000 \
Expand All @@ -43,7 +47,9 @@ docker run --name docms \
`GOOGLE_TAG` is supported since runtime `v0.3.1` or Docker image `:20230426`.
```

**DOCMS_DATA_DIR** - specify the root directory where website content is located. Default value is `./dodata`. The following command makes `DO CMS runtime` to load website content from directory `/mydata`:
### DOCMS_DATA_DIR

Specify the root directory where website content is located. Default value is `./dodata`. The following command makes `DO CMS runtime` to load website content from directory `/mydata`:
```shell
docker run --name docms \
-p 8000:8000 \
Expand All @@ -52,7 +58,9 @@ docker run --name docms \
btnguyen2k/docmsruntime
```

**FRONTEND_TEMPLATE** - specify the GUI template to be used for the frontend. Currently there are 3 available templates `bootstrap`, `coderdocs` and `prettydocs` (default template is `bootstrap`). The following command switches the template to `coderdocs`:
### FRONTEND_TEMPLATE

Specify the GUI template to be used for the frontend. Currently there are 3 available templates `bootstrap`, `coderdocs` and `prettydocs` (default template is `bootstrap`). The following command switches the template to `coderdocs`:
```shell
docker run --name docms \
-p 8000:8000 \
Expand Down Expand Up @@ -113,3 +121,76 @@ docker run --name docms \
-title:Document page
]]
```

```bs-alert info

New template `blogy` has been added since `v0.3.1` (or Docker image `:20230511`). `blogy` template is suitable for blog-style website (site was [created](../docli/#helper-to-create-content-metadata) with `--mode blog`).
```

### MIME_TYPES

Specify allowed MINE types for media files attached to documents, value must be a valid JSON-encoded map, for example:
```shell
docker run --name docms \
-p 8000:8000 \
-e MIME_TYPES='{".jpg": "image/jpeg", ".gif": "image/gif"}' \
btnguyen2k/docmsruntime
```

```bs-alert info

`MIME_TYPES` is supported since runtime `v0.4.0` or Docker image `:20230628`.
```

The following MIME types are configured by default:
```json
## Media MIME types
media_mime {
# photo files
".jpg": "image/jpeg",
".jpeg": "image/jpeg",
".png": "image/png",
".gif": "image/gif",
".svg": "image/svg+xml",
# music files
".aac": "audio/aac",
".mp3": "audio/mp3",
".wav": "audio/wav",
".wma": "audio/wma",
# video files
".mp4": "audio/mp4",
".mov": "audio/mov",
".avi": "audio/avi",
# documents
".xml": "application/xml",
".json": "application/json",
".pdf": "application/pdf",
".csv": "application/csv",
".tsv": "application/tsv",
".doc": "application/doc",
".docx": "application/docx",
".xls": "application/xls",
".xlsx": "application/xlsx",
".ppt": "application/ppt",
".pptx": "application/pptx",
".odm": "application/odm",
".odt": "application/odt",
".odp": "application/odp",
".ods": "application/ods",
}
```

### MIME_TYPES_ADD

Add MINE types to the existing list, value must be a valid JSON-encoded map, for example:
```shell
docker run --name docms \
-p 8000:8000 \
-e MIME_TYPES_ADD='{".mp4": "video/mp4"}' \
btnguyen2k/docmsruntime
```

```bs-alert info

`MIME_TYPES_ADD` is supported since runtime `v0.4.0` or Docker image `:20230628`.
```
91 changes: 86 additions & 5 deletions dosrc/03-components/02-runtime/index-vi.md
E377
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
`DO CMS runtime` chịu trách nhiệm thể hiện nội dung trang web, và hỗ trợ một số tính năng khác như i18n hoặc tìm kiếm toàn văn (fulltext search).
`DO CMS runtime` chịu trách nhiệm thể hiện nội dung trang web, và hỗ trợ một số tính năng khác như _i18n_ hoặc _tìm kiếm toàn văn_ (fulltext search).

Để tiện sử dụng, `DO CMS runtime` đã được đóng gói sẵn thành [Docker image](https://hub.docker.com/r/btnguyen2k/docmsruntime).

Expand All @@ -21,7 +21,9 @@ Bản Docker image được đánh thẻ như sau:

## Biến môi trường

**HTTP_LISTEN_ADDR** và **HTTP_LISTEN_PORT** - chỉ định địa chỉ & cổng lắng nghe. Giá trị mặc định của HTTP_LISTEN_ADDR là `0.0.0.0` và HTTP_LISTEN_PORT là `8000`. Câu lệnh sau chi định `DO CMS runtime` lắng nghe `127.0.0.1:3000`:
### HTTP_LISTEN_ADDR/HTTP_LISTEN_PORT

Chỉ định địa chỉ & cổng lắng nghe. Giá trị mặc định của HTTP_LISTEN_ADDR là `0.0.0.0` và HTTP_LISTEN_PORT là `8000`. Câu lệnh sau chi định `DO CMS runtime` lắng nghe `127.0.0.1:3000`:
```shell
docker run --name docms \
-p 8000:3000 \
Expand All @@ -30,7 +32,9 @@ docker run --name docms \
btnguyen2k/docmsruntime
```

**GOOGLE_TAG** - chỉ định Google Tag ID để đẩy data lên Google Analytics, ví dụ:
### GOOGLE_TAG

Chỉ định Google Tag ID để đẩy data lên Google Analytics, ví dụ:
```shell
docker run --name docms \
-p 8000:8000 \
Expand All @@ -43,7 +47,9 @@ docker run --name docms \
`GOOGLE_TAG` được hỗ trợ từ bản runtime `v0.3.1` hoặc Docker image `:20230426`.
```

**DOCMS_DATA_DIR** - chỉ định thư mục gốc chứa nội dung trang web. Giá trị mặc định là `./dodata`. Câu lệnh sau chỉ định `DO CMS runtime` tải nội dung trang web từ thư mục `/mydata`:
### DOCMS_DATA_DIR

Chỉ định thư mục gốc chứa nội dung trang web. Giá trị mặc định là `./dodata`. Câu lệnh sau chỉ định `DO CMS runtime` tải nội dung trang web từ thư mục `/mydata`:
```shell
docker run --name docms \
-p 8000:8000 \
Expand All @@ -52,7 +58,9 @@ docker run --name docms \
btnguyen2k/docmsruntime
```

**FRONTEND_TEMPLATE** - chỉ định giao diện đồ hoạ cho phần thể hiện nội dung trang web. Hiện tại có 3 giao diện có thể lựa chọn là `bootstrap` (mặc định), `coderdocs` and `prettydocs`. Câu lệnh sau sẽ chỉ định `coderdocs` làm giao diện thể hiện:
### FRONTEND_TEMPLATE

Chỉ định giao diện đồ hoạ cho phần thể hiện nội dung trang web. Hiện tại có 3 giao diện có thể lựa chọn là `bootstrap` (mặc định), `coderdocs` and `prettydocs`. Câu lệnh sau sẽ chỉ định `coderdocs` làm giao diện thể hiện:
```shell
docker run --name docms \
-p 8000:8000 \
Expand Down Expand Up @@ -113,3 +121,76 @@ Giao diện **PrettyDocs**:
-title:Trang bài viết
]]
```

```bs-alert info

Giao diện đồ hoạ `blogy` được thêm vào từ phiên bản `v0.3.1` (hoặc Docker image `:20230511`). `blogy` thích hợp cho các trang web thien về blog (trang web [được tạo](../docli/#hỗ-trợ-tạo-metadata) với tham số `--mode blog`).
```

### MIME_TYPES

Chỉ định các loại định dạng tập tin được phép đính kèm theo tài liệu, giá trị phải là map ở định dạng 1 chuỗi JSON hợp lệ, ví dụ:
```shell
docker run --name docms \
-p 8000:8000 \
-e MIME_TYPES='{".jpg": "image/jpeg", ".gif": "image/gif"}' \
btnguyen2k/docmsruntime
```

```bs-alert info

`MIME_TYPES` được hỗ trợ từ bản runtime `v0.4.0` hoặc Docker image `:20230628`.
```

Các loại định dạng tập tin được cấu hình mặc định:
```json
## Media MIME types
media_mime {
# photo files
".jpg": "image/jpeg",
".jpeg": "image/jpeg",
".png": "image/png",
".gif": "image/gif",
".svg": "image/svg+xml",
# music files
".aac": "audio/aac",
".mp3": "audio/mp3",
".wav": "audio/wav",
".wma": "audio/wma",
# video files
".mp4": "audio/mp4",
".mov": "audio/mov",
".avi": "audio/avi",
# documents
".xml": "application/xml",
".json": "application/json",
".pdf": "application/pdf",
".csv": "application/csv",
".tsv": "application/tsv",
".doc": "application/doc",
".docx": "application/docx",
".xls": "application/xls",
".xlsx": "application/xlsx",
".ppt": "application/ppt",
".pptx": "application/pptx",
".odm": "application/odm",
".odt": "application/odt",
".odp": "application/odp",
".ods": "application/ods",
}
```

### MIME_TYPES_ADD

Thêm định dạng tập tin vào danh sách có sẵn, giá trị phải là map ở định dạng 1 chuỗi JSON hợp lệ, ví dụ:
```shell
docker run --name docms \
-p 8000:8000 \
-e MIME_TYPES_ADD='{".mp4": "video/mp4"}' \
btnguyen2k/docmsruntime
```

```bs-alert info

`MIME_TYPES_ADD` is supported since runtime `v0.4.0` or Docker image `:20230628`.
```
Binary file modified dosrc/03-components/02-runtime/prettydocs1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dosrc/03-components/02-runtime/prettydocs2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dosrc/03-components/02-runtime/prettydocs3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading
0