Skip to content

Commit

Permalink
Add release docs 2.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
wuchunfu committed Aug 20, 2024
1 parent f49403f commit 7c552c0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ sink {
- 当在任务的配置中, 没有添加`tag_filter`时, 会从所有节点中随机选择节点来运行任务.
- 当`tag_filter`中存在多个过滤条件时, 会根据key存在以及value相等的全部匹配的节点, 当没有找到匹配的节点时, 会抛出 `NoEnoughResourceException`异常.

![img.png](images/resource-isolation.png)
![img.png](../images/resource-isolation.png)

4 changes: 2 additions & 2 deletions tools/build-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ function prepareDocs() {
});

console.log(`===>>>: Replace images path in ${PROJECT_SITE_DOC_DIR}`);
replaceImagesPath(PROJECT_SITE_DOC_DIR);
replaceImagesPath(PROJECT_SITE_DOC_DIR, "images", "images");

console.log(`===>>>: Replace images path in ${PROJECT_SITE_ZH_DOC_DIR}`);
replaceImagesPath(PROJECT_SITE_ZH_DOC_DIR, "/image_zh");
replaceImagesPath(PROJECT_SITE_ZH_DOC_DIR, "images", "images");

console.log("===>>>: End documents sync");
}
Expand Down
13 changes: 7 additions & 6 deletions tools/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,21 @@ export const VERSION = readJsonSync(path.resolve(SOURCE_PATH, "versions.json"));
// Utility function to replace image paths
export function replaceImagesPath(
replaceDir: string,
to: string = "/image_en",
from: string = "images"
from: string = "images",
to: string = "images"
) {
const regex = new RegExp(`(\\.\\.\\/)*${from}`, "g");
const regex = new RegExp(`../${from}`, "g");
for (const fileName of fs.readdirSync(replaceDir)) {
const filePath = path.resolve(replaceDir, fileName);
if (fs.statSync(filePath).isDirectory()) {
replaceImagesPath(filePath, to, from);
replaceImagesPath(filePath, from, to);
} else if (filePath.endsWith(".md") || filePath.endsWith(".mdx")) {
console.log(
` ---> Replace images path form ${from} to ${to} in ${filePath}`
` ---> Replace images path form ${regex} to ${to} in ${filePath}`
);
let content = fs.readFileSync(filePath, "utf-8");
content = content.replace(regex, to);
content = content.replace(regex, to)
content = content.replace(new RegExp(`(\\.)${to}`, "g"), `.io/${to}`);
fs.writeFileSync(filePath, content);
}
}
Expand Down
4 changes: 2 additions & 2 deletions tools/image-copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ function copyAndReplaceImagesPath() {
);

// replace images path in versioned docs
replaceImagesPath(newVersionedDir, `${IMAGEDIR}`, "/image_en");
replaceImagesPath(newVersionedZHDir, `${IMAGEDIR}`, "/image_zh");
// replaceImagesPath(newVersionedDir, `${IMAGEDIR}`, "/image_en");
// replaceImagesPath(newVersionedZHDir, `${IMAGEDIR}`, "/image_zh");
}

copyAndReplaceImagesPath();
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ sink {
- If not set `tag_filter` in job config, it will random choose the node in all active nodes.
- When you add multiple tag in `tag_filter`, it need all key exist and value match. if all node not match, you will get `NoEnoughResourceException` exception.

![img.png](images/resource-isolation.png)
![img.png](../images/resource-isolation.png)

0 comments on commit 7c552c0

Please sign in to comment.