Skip to content

Commit

Permalink
chore: update docusaurus template (#401)
Browse files Browse the repository at this point in the history
Signed-off-by: aeneasr <aeneas@ory.sh>
  • Loading branch information
aeneasr authored Apr 6, 2020
1 parent 9cfa582 commit e29054b
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 68 deletions.
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

/tmp
7 changes: 7 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,10 @@ module.exports = {

Next, put your markdown files in `./docs/docs`. You may also want to add the CircleCI Orb `ory/docs` to your CI config,
depending on the project type.

## Update Documentation

Check out [docusaurus-template](https://github.com/ory/docusaurus-template) using `git clone git@github.com:ory/docusaurus-template.git docusaurus-template`.
It is important that the directory is named `docusaurus-template`!

Then, make your changes, and run `./update.sh`.
2 changes: 1 addition & 1 deletion docs/contrib/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const projects = [
name: 'ORY Oathkeeper',
},
{
slug: 'Keto',
slug: 'keto',
name: 'ORY Keto',
},
].filter((item) => config.projectSlug !== item.slug);
Expand Down
9 changes: 4 additions & 5 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
const config = require('./contrib/config.js')
const fs = require('fs')

let versions = [
'next'
]
const admonitions = require('remark-admonitions');

const links = [
{
Expand Down Expand Up @@ -71,6 +68,7 @@ module.exports = {
logo: {
alt: config.projectName,
src: `img/logo-${config.projectSlug}.svg`,
href: `https://www.ory.sh/${config.projectSlug}`
},
links: links
},
Expand Down Expand Up @@ -105,10 +103,11 @@ module.exports = {
path: config.projectSlug === 'docusaurus-template' ? 'contrib/docs' : 'docs',
sidebarPath: require.resolve('./contrib/sidebar.js'),
editUrl:
`https://github.com/docs/${config.projectSlug}/edit/master/docs`,
`https://github.com/ory/${config.projectSlug}/edit/master/docs`,
routeBasePath: '',
showLastUpdateAuthor: true,
showLastUpdateTime: true,
remarkPlugins: [admonitions],
},
],
[
Expand Down
77 changes: 39 additions & 38 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"generate:api": "widdershins -u ../.widdershins/templates -e ../.widdershins/config.json ../api.swagger.json -o ../docs/oathkeeper/sdk/api.md",
"format": "prettier --write '{docs/**,docs,scripts,static,contrib}/*.{md,json,js,css,html}' || true"
},
"dependencies": {
"@docusaurus/core": "2.0.0-alpha.50",
"@docusaurus/preset-classic": "2.0.0-alpha.50",
"classnames": "^2.2.6",
"node-fetch": "^2.6.0",
"react": "^16.8.4",
"react-dom": "^16.8.4"
"classnames": "2.2.6",
"node-fetch": "2.6.0",
"react": "16.8.4",
"react-dom": "16.8.4"
},
"browserslist": {
"production": [
Expand All @@ -32,10 +31,11 @@
]
},
"devDependencies": {
"json-schema-faker": "^0.5.0-rcv.24",
"json-schema-ref-parser": "^8.0.0",
"prettier": "^2.0.2",
"ramda": "^0.27.0",
"yaml": "^1.8.3"
"json-schema-faker": "0.5.0-rcv.25",
"json-schema-ref-parser": "8.0.0",
"prettier": "2.0.2",
"ramda": "0.27.0",
"remark-admonitions": "1.2.1",
"yaml": "1.8.3"
}
}
2 changes: 1 addition & 1 deletion docs/scripts/fix-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fs.readFile(file, (err, b) => {

const t = b
.toString()
.replace(/^id: api/gim, '')
.replace(/^id: api/img,'')
.replace(/^title:(.*)/im, 'title: REST API\nid: api') // improve title, add docusaurus id
.replace(/^language_tabs:.*\n/im, '') // not supported by docusaurus
.replace(/^toc_footers.*\n/im, '') // not supported by docusaurus
Expand Down
28 changes: 15 additions & 13 deletions docs/scripts/rerelease.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
const path = require('path');
const name = process.argv[2];
const fs = require('fs');

const p = path.join(__dirname, '../versions.json');

fs.writeFile(p, JSON.stringify(require(p).filter((v) => v !== name)), function (
err
) {
if (err) {
return console.error(err);
}
});
const path = require('path')
const name = process.argv[2];
const fs = require('fs');

const p = path.join(__dirname, '../versions.json');

fs.writeFile(
p,
JSON.stringify(require(p).filter(v => v !== name)),
function(err) {
if (err) {
return console.error(err);
}
}
);

0 comments on commit e29054b

Please sign in to comment.