Skip to content

Commit

Permalink
chore: update docusaurus template
Browse files Browse the repository at this point in the history
Signed-off-by: aeneasr <aeneas@ory.sh>
  • Loading branch information
aeneasr committed Apr 12, 2020
1 parent 9f26506 commit 32da96b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/package.json
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"scripts": {
"gen": "node ./docs/scripts/fix-api.js ./docs/docs/reference/api.md && node ./docs/scripts/config.js docs/config.js",
"gen": "cd .. && node ./docs/scripts/fix-api.js ./docs/docs/reference/api.md && node ./docs/scripts/config.js docs/config.js",
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
Expand Down
8 changes: 4 additions & 4 deletions docs/scripts/docker-tag.js
Expand Up @@ -39,17 +39,17 @@ const replace = (path, replacer) =>
});
});

config.updateTags.forEach(({ files, image, pattern }) => {
config.updateTags.forEach(({files, image, replacer}) => {
files.forEach((loc) => {
replace(loc, (content) => {
if (pattern) {
content.replace(new RegExp(pattern, 'g'), `${image}:${next}`);
if (replacer) {
return replacer({ content, next })
}

return content.replace(
new RegExp(`${image}:v[0-9a-zA-Z\\.\\+\\_\\-]+`, 'g'),
`${image}:${next}`
);
)
})
.then(() => {
console.log('Done!');
Expand Down
2 changes: 1 addition & 1 deletion docs/scripts/fix-api.js
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
@@ -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 32da96b

Please sign in to comment.