From c5c143f2aec0e5f7ceceff8c655784578d2dbfba Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 17 Apr 2019 13:36:30 +0200 Subject: [PATCH] add past versions linking to swaggerhub --- gatsby-node.js | 2 ++ src/templates/Doc.module.scss | 10 +++++++++- src/templates/Swagger/index.jsx | 9 +++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index 59d482c9..60b3264e 100755 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -173,6 +173,7 @@ exports.createPages = ({ graphql, actions }) => { component: apiSwaggerTemplate, context: { slug: slugAquarius, + name: swaggerComponents[0], api: specAquarius } }) @@ -185,6 +186,7 @@ exports.createPages = ({ graphql, actions }) => { component: apiSwaggerTemplate, context: { slug: slugBrizo, + name: swaggerComponents[1], api: specBrizo } }) diff --git a/src/templates/Doc.module.scss b/src/templates/Doc.module.scss index e5e7eb6d..e8ae0c3c 100644 --- a/src/templates/Doc.module.scss +++ b/src/templates/Doc.module.scss @@ -50,9 +50,17 @@ } .version { + color: $brand-grey-light; font-size: $font-size-base; font-family: $font-family-monospace; - color: $brand-grey-light; + + a { + font-size: $font-size-mini; + font-family: $font-family-base; + font-weight: $font-weight-base; + display: inline-block; + margin-left: .5rem; + } } .pathName { diff --git a/src/templates/Swagger/index.jsx b/src/templates/Swagger/index.jsx index 4cd75ad5..0845dbd0 100644 --- a/src/templates/Swagger/index.jsx +++ b/src/templates/Swagger/index.jsx @@ -69,7 +69,7 @@ export default class ApiSwaggerTemplate extends Component { render() { const { location, pageContext } = this.props - const { api } = pageContext + const { api, name } = pageContext const { host, basePath, info, paths } = api const { title, description, version, license, contact } = info @@ -106,7 +106,12 @@ export default class ApiSwaggerTemplate extends Component { description={description} prepend={ - {version} + v{version} + + past versions + } />