mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
squid-java as submodule, get metadata from pom.xml
This commit is contained in:
parent
2fd5410a0e
commit
94947912f0
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -5,3 +5,6 @@
|
||||
[submodule "external/squid-js"]
|
||||
path = external/squid-js
|
||||
url = https://github.com/oceanprotocol/squid-js.git
|
||||
[submodule "external/squid-java"]
|
||||
path = external/squid-java
|
||||
url = https://github.com/oceanprotocol/squid-java.git
|
||||
|
1
external/squid-java
vendored
Submodule
1
external/squid-java
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 486f370d55ce498e23363f466128cb89f650fe75
|
@ -4,6 +4,8 @@ const path = require('path')
|
||||
const { createFilePath } = require('gatsby-source-filesystem')
|
||||
const Swagger = require('swagger-client')
|
||||
const { redirects } = require('./config')
|
||||
const parser = require('xml-js')
|
||||
const fs = require('fs')
|
||||
|
||||
exports.onCreateNode = ({ node, getNode, actions }) => {
|
||||
const { createNodeField } = actions
|
||||
@ -57,6 +59,23 @@ const getSpec = async () => {
|
||||
return spec
|
||||
}
|
||||
|
||||
let metaSquidJava
|
||||
|
||||
const getSquidJavaMeta = () => {
|
||||
fs.readFile('./external/squid-java/pom.xml', (err, data) => {
|
||||
if (err) return err
|
||||
|
||||
const json = parser.xml2js(data, {
|
||||
compact: true
|
||||
})
|
||||
|
||||
metaSquidJava = json.project
|
||||
// return json.project
|
||||
})
|
||||
}
|
||||
|
||||
getSquidJavaMeta()
|
||||
|
||||
exports.createPages = ({ graphql, actions }) => {
|
||||
const { createPage, createRedirect } = actions
|
||||
|
||||
@ -272,7 +291,12 @@ exports.createPages = ({ graphql, actions }) => {
|
||||
component: javadocTemplate,
|
||||
context: {
|
||||
slug,
|
||||
javadoc
|
||||
javadoc,
|
||||
title: name,
|
||||
description: `${metaSquidJava.name._text}. ${
|
||||
metaSquidJava.description._text
|
||||
}.`,
|
||||
version: metaSquidJava.version._text
|
||||
}
|
||||
})
|
||||
})
|
||||
|
@ -50,6 +50,7 @@
|
||||
"gatsby-source-graphql": "^2.0.15",
|
||||
"gatsby-transformer-remark": "^2.3.8",
|
||||
"gatsby-transformer-sharp": "^2.1.17",
|
||||
"gatsby-transformer-xml": "^2.0.9",
|
||||
"gatsby-transformer-yaml": "^2.1.10",
|
||||
"giphy-js-sdk-core": "^1.0.6",
|
||||
"intersection-observer": "^0.5.1",
|
||||
@ -83,7 +84,9 @@
|
||||
"stylelint-config-bigchaindb": "^1.2.1",
|
||||
"stylelint-config-css-modules": "^1.3.0",
|
||||
"stylelint-config-standard": "^18.2.0",
|
||||
"typedoc": "^0.14.2"
|
||||
"typedoc": "^0.14.2",
|
||||
"xml-js": "^1.6.11",
|
||||
"xml2json": "^0.11.2"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -14,10 +14,6 @@ import stylesDoc from '../Doc.module.scss'
|
||||
import Toc from './Toc'
|
||||
import { cleanPaths } from './utils'
|
||||
|
||||
const title = 'squid-java'
|
||||
const description = 'Java client library for Ocean Protocol'
|
||||
const version = '0.2.0'
|
||||
|
||||
const Paths = ({ javadoc }) => {
|
||||
return Object.keys(javadoc).map(path => (
|
||||
<div
|
||||
@ -50,7 +46,7 @@ export default class JavadocTemplate extends Component {
|
||||
|
||||
render() {
|
||||
const { location, pageContext } = this.props
|
||||
const { javadoc } = pageContext
|
||||
const { javadoc, title, description, version } = pageContext
|
||||
|
||||
return (
|
||||
<>
|
||||
|
Loading…
Reference in New Issue
Block a user