From 1f10785a4cd1dafa5dc65e9a24b17b84dedcd10e Mon Sep 17 00:00:00 2001 From: "ruiyi.jiang" Date: Mon, 11 Sep 2023 19:11:16 +0800 Subject: [PATCH 1/2] add csharp sdk Signed-off-by: ruiyi.jiang --- gatsby-node.js | 10 ++++++++++ gatsbyUtils/api.js | 1 + src/pages/blogs/versions/master | 2 +- src/pages/docs/versions/master | 2 +- src/templates/apiDocTemplate.jsx | 9 +++++++++ src/templates/docTemplate.jsx | 10 ++++++++++ walkFile.js | 6 +++++- 7 files changed, 37 insertions(+), 3 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index 18130ef4f..32bf135f0 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -123,6 +123,15 @@ exports.sourceNodes = ({ actions, createNodeId, createContentDigest }) => { }); } break; + case 'milvus-sdk-csharp': + for (const version of versions) { + handleApiFiles(nodes, { + parentPath: path, + version, + category: 'csharp', + }); + } + break; case 'milvus-restful': for (const version of versions) { handleApiFiles(nodes, { @@ -132,6 +141,7 @@ exports.sourceNodes = ({ actions, createNodeId, createContentDigest }) => { }); } break; + default: break; } diff --git a/gatsbyUtils/api.js b/gatsbyUtils/api.js index 7a38788c8..2d1e9cf1f 100644 --- a/gatsbyUtils/api.js +++ b/gatsbyUtils/api.js @@ -181,6 +181,7 @@ const generateTitle = ({ 'pymilvus-orm': 'Python (ORM)', go: 'Go', java: 'Java', + charp: 'C#', node: 'Node', }; const [, label2 = ''] = labels; diff --git a/src/pages/blogs/versions/master b/src/pages/blogs/versions/master index 600c377a7..6664f8b5f 160000 --- a/src/pages/blogs/versions/master +++ b/src/pages/blogs/versions/master @@ -1 +1 @@ -Subproject commit 600c377a7430a95e6510644a6f35227e0833aa90 +Subproject commit 6664f8b5fe552d4c6f15cc3a5445229f941a6667 diff --git a/src/pages/docs/versions/master b/src/pages/docs/versions/master index f74dfbe58..2b882709f 160000 --- a/src/pages/docs/versions/master +++ b/src/pages/docs/versions/master @@ -1 +1 @@ -Subproject commit f74dfbe58534f3df950f3566de71d948181b38d0 +Subproject commit 2b882709f968ed4b662e2aba17ddfd8b94b575f3 diff --git a/src/templates/apiDocTemplate.jsx b/src/templates/apiDocTemplate.jsx index 2becd8e25..764bc8522 100644 --- a/src/templates/apiDocTemplate.jsx +++ b/src/templates/apiDocTemplate.jsx @@ -114,6 +114,15 @@ export default function Template({ data, pageContext }) { } break; + case 'csharp': + if (name.endsWith('.md')) { + apiReferenceData.sourceUrl = `https://github.com/milvus-io/web-content/edit/master/API_Reference/milvus-sdk-csharp/${version}/${name.replace( + 'csharp_', + '' + )}`; + } + break; + case 'go': if (name.endsWith('.md')) { apiReferenceData.sourceUrl = `https://github.com/milvus-io/web-content/edit/master/API_Reference/milvus-sdk-go/${version}/${name.replace( diff --git a/src/templates/docTemplate.jsx b/src/templates/docTemplate.jsx index 7d99f50dd..79963b554 100644 --- a/src/templates/docTemplate.jsx +++ b/src/templates/docTemplate.jsx @@ -135,6 +135,16 @@ export default function Template({ data, pageContext }) { }); } + console.log(versionInfo) + + if (versionInfo[version] && versionInfo[version].csharp) { + APIs.children.push({ + id: 'csharp', + label: 'C#', + link: `/api-reference/csharp/${versionInfo[version].csharp}/About.md`, + }); + } + if (versionInfo[version] && versionInfo[version].restful) { APIs.children.push({ id: 'restful', diff --git a/walkFile.js b/walkFile.js index c9b1d8b0a..fee235666 100644 --- a/walkFile.js +++ b/walkFile.js @@ -63,7 +63,11 @@ const handleCfgFile = (fileObj, { dirPath, filePath, isVariables }) => { content?.milvus_restful_sdk_version && content?.milvus_restful_sdk_version >= '1.0.14' && `v${content?.milvus_restful_sdk_version}`; - result = { pymilvus, go, java, node, restful }; + const csharp = + content?.milvus_csharp_sdk_version && + content?.milvus_csharp_sdk_version >= '1.0.14' && + `v${content?.milvus_csharp_sdk_version}`; + result = { pymilvus, go, java, node, restful, csharp }; } fileObj[parent] = fileObj[parent] ? { ...fileObj[parent], ...result } From 12fd34d3339ab3521ac1bf2732bdcb31a55247c5 Mon Sep 17 00:00:00 2001 From: "ruiyi.jiang" Date: Mon, 11 Sep 2023 19:12:13 +0800 Subject: [PATCH 2/2] remove console Signed-off-by: ruiyi.jiang --- src/templates/docTemplate.jsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/templates/docTemplate.jsx b/src/templates/docTemplate.jsx index 79963b554..044089a2c 100644 --- a/src/templates/docTemplate.jsx +++ b/src/templates/docTemplate.jsx @@ -135,8 +135,6 @@ export default function Template({ data, pageContext }) { }); } - console.log(versionInfo) - if (versionInfo[version] && versionInfo[version].csharp) { APIs.children.push({ id: 'csharp',