Skip to content

Commit

Permalink
chore: docs build for 7.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Feb 27, 2023
1 parent 2b948fd commit 23b95c9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ for (var i = 0; i < pairs.length; ++i) {
}
}

var defaultVersion = '6.x';
var defaultVersion = '7.x';
var versionFromUrl = window.location.pathname.match(/^\/docs\/(\d+\.x)/);
var version = versionFromUrl ? versionFromUrl[1] : defaultVersion;

Expand Down
4 changes: 2 additions & 2 deletions docs/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ html(lang='en')
a(href="#").pure-menu-link Version #{package.version}
ul.pure-menu-children
li.pure-menu-item
a.pure-menu-link(href="/docs/5.x") Version #{package.latest5x}
a.pure-menu-link(href="/docs/6.x") Version #{package.latest6x}
li.pure-menu-item
a.pure-menu-link(href="/docs/4.x") Version #{package.latest4x}
a.pure-menu-link(href="/docs/5.x") Version #{package.latest5x}
li.pure-menu-item.search
input#search-input-nav(type="text", placeholder="Search")
button#search-button-nav
Expand Down
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,27 +73,32 @@
"scripts": {
"docs:clean": "npm run docs:clean:stable",
"docs:clean:stable": "rimraf index.html && rimraf -rf ./docs/*.html && rimraf -rf ./docs/api && rimraf -rf ./docs/tutorials/*.html && rimraf -rf ./docs/typescript/*.html && rimraf -rf ./docs/*.html && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp",
"docs:clean:legacy": "rimraf index.html && rimraf -rf ./docs/5.x && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp",
"docs:clean:5x": "rimraf index.html && rimraf -rf ./docs/5.x && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp",
"docs:clean:6x": "rimraf index.html && rimraf -rf ./docs/6.x && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp",
"docs:copy:tmp": "mkdirp ./tmp/docs/css && mkdirp ./tmp/docs/js && mkdirp ./tmp/docs/images && mkdirp ./tmp/docs/tutorials && mkdirp ./tmp/docs/typescript && ncp ./docs/css ./tmp/docs/css --filter=.css$ && ncp ./docs/js ./tmp/docs/js --filter=.js$ && ncp ./docs/images ./tmp/docs/images && ncp ./docs/tutorials ./tmp/docs/tutorials && ncp ./docs/typescript ./tmp/docs/typescript && cp index.html ./tmp",
"docs:copy:tmp:legacy": "rimraf ./docs/5.x && ncp ./tmp ./docs/5.x",
"docs:copy:tmp:5x": "rimraf ./docs/5.x && ncp ./tmp ./docs/5.x",
"docs:copy:tmp:6x": "rimraf ./docs/5.x && ncp ./tmp ./docs/5.x",
"docs:checkout:gh-pages": "git checkout gh-pages",
"docs:checkout:legacy": "git checkout 5.x",
"docs:checkout:5x": "git checkout 5.x",
"docs:checkout:6x": "git checkout 5.x",
"docs:generate": "node ./scripts/website.js",
"docs:generate:search": "node ./scripts/generateSearch.js",
"docs:merge:stable": "git merge master",
"docs:merge:legacy": "git merge 5.x",
"docs:merge:5x": "git merge 5.x",
"docs:merge:6x": "git merge 6.x",
"docs:test": "npm run docs:generate && npm run docs:generate:search",
"docs:view": "node ./scripts/static.js",
"docs:prepare:publish:stable": "npm run docs:checkout:gh-pages && npm run docs:merge:stable && npm run docs:clean:stable && npm run docs:generate && npm run docs:generate:search",
"docs:prepare:publish:legacy": "npm run docs:checkout:legacy && npm run docs:merge:legacy && npm run docs:clean:stable && npm run docs:generate && npm run docs:copy:tmp && docs:checkout:gh-pages && docs:copy:tmp:legacy",
"docs:prepare:publish:5x": "npm run docs:checkout:5x && npm run docs:merge:5x && npm run docs:clean:stable && npm run docs:generate && npm run docs:copy:tmp && docs:checkout:gh-pages && docs:copy:tmp:5x",
"docs:prepare:publish:6x": "npm run docs:checkout:6x && npm run docs:merge:6x && npm run docs:clean:stable && npm run docs:generate && npm run docs:copy:tmp && docs:checkout:gh-pages && docs:copy:tmp:6x",
"docs:check-links": "blc http://127.0.0.1:8089 -ro",
"lint": "eslint .",
"lint-js": "eslint . --ext .js",
"lint-ts": "eslint . --ext .ts",
"build-browser": "(rm ./dist/* || true) && node ./scripts/build-browser.js",
"prepublishOnly": "npm run build-browser",
"release": "git pull && git push origin master --tags && npm publish",
"release-legacy": "git pull origin 5.x && git push origin 5.x --tags && npm publish --tag legacy",
"release-5x": "git pull origin 5.x && git push origin 5.x --tags && npm publish --tag 5x",
"mongo": "node ./tools/repl.js",
"test": "mocha --exit ./test/*.test.js",
"test-deno": "deno run --allow-env --allow-read --allow-net --allow-run --allow-sys --allow-write ./test/deno.js",
Expand Down
2 changes: 1 addition & 1 deletion scripts/generateSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ async function run() {

await Content.deleteMany({ version });
for (const content of contents) {
if (version === '6.x') {
if (version === '7.x') {
let url = content.url.startsWith('/') ? content.url : `/${content.url}`;
if (!url.startsWith('/docs')) {
url = '/docs' + url;
Expand Down
2 changes: 1 addition & 1 deletion scripts/website.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ function getLatestLegacyVersion(startsWith) {

// use last release
pkg.version = getVersion();
pkg.latest6x = getLatestLegacyVersion('6.');
pkg.latest5x = getLatestLegacyVersion('5.');
pkg.latest4x = getLatestLegacyVersion('4.');

// Create api dir if it doesn't already exist
try {
Expand Down

0 comments on commit 23b95c9

Please sign in to comment.