Skip to content

Commit

Permalink
Merge pull request #1215 from milvus-io/preview
Browse files Browse the repository at this point in the history
Preview
  • Loading branch information
shanghaikid authored Sep 11, 2023
2 parents ddff8fe + f01f4a1 commit abab69d
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 3 deletions.
10 changes: 10 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand All @@ -132,6 +141,7 @@ exports.sourceNodes = ({ actions, createNodeId, createContentDigest }) => {
});
}
break;

default:
break;
}
Expand Down
1 change: 1 addition & 0 deletions gatsbyUtils/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ const generateTitle = ({
'pymilvus-orm': 'Python (ORM)',
go: 'Go',
java: 'Java',
charp: 'C#',
node: 'Node',
};
const [, label2 = ''] = labels;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/versions/master
Submodule master updated 722 files
9 changes: 9 additions & 0 deletions src/templates/apiDocTemplate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 8 additions & 0 deletions src/templates/docTemplate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ export default function Template({ data, pageContext }) {
});
}

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',
Expand Down
6 changes: 5 additions & 1 deletion walkFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit abab69d

Please sign in to comment.