Skip to content

Commit

Permalink
chore: update docusaurus template (#776)
Browse files Browse the repository at this point in the history
Signed-off-by: aeneasr <aeneasr@users.noreply.github.com>

Co-authored-by: aeneasr <aeneasr@users.noreply.github.com>
  • Loading branch information
aeneasr and aeneasr committed Jul 5, 2021
1 parent 3381815 commit 28596d5
Show file tree
Hide file tree
Showing 5 changed files with 1,722 additions and 1,132 deletions.
3 changes: 2 additions & 1 deletion docs/contrib/config.js
Expand Up @@ -16,7 +16,8 @@ let config = {
updateConfig: {
src: '.schema/config.schema.json',
dst: './docs/docs/reference/configuration.md'
}
},
enableRedoc: true
}

const cn = path.join(__dirname, '..', 'config.js')
Expand Down
35 changes: 12 additions & 23 deletions docs/docusaurus.config.js
Expand Up @@ -14,19 +14,21 @@ let links = [
}
]

if (config.openApiSpec) {
if (config.enableRedoc) {
links = [
...links,
{
to: baseUrl,
label: `Docs`,
position: 'left',
activeBaseRegex: 'docs/(?!http-api/).*'
activeBaseRegex: '/docs/(?!http-api).*'
},
{
to: baseUrl + 'http-api/',
label: `HTTP API`,
position: 'left'
type: 'docsVersion',
position: 'left',
to: '/http-api',
label: 'HTTP API',
docsPluginId: 'default'
}
]
}
Expand Down Expand Up @@ -197,12 +199,14 @@ module.exports = {
? 'contrib/docs'
: 'docs',
sidebarPath: require.resolve('./contrib/sidebar.js'),
editUrl: ({ docPath }) =>
`https://github.com/ory/${githubRepoName}/edit/master/docs/docs/${docPath}`,
editUrl: `https://github.com/ory/${githubRepoName}/edit/master/docs`,
editCurrentVersion: false,
routeBasePath: '/',
showLastUpdateAuthor: true,
showLastUpdateTime: true,
disableVersioning: false
disableVersioning: false,

include: ['**/*.md', '**/*.mdx', '**/*.js']
}
],
'@docusaurus/plugin-content-pages',
Expand All @@ -217,20 +221,5 @@ module.exports = {
}
],
'@docusaurus/theme-search-algolia'
],
presets: [
[
'redocusaurus',
{
specs: config.openApiSpec
? [
{
routePath: '/http-api/',
specUrl: config.openApiSpec
}
]
: []
}
]
]
}

0 comments on commit 28596d5

Please sign in to comment.