diff --git a/docs/package.json b/docs/package.json index 368d94d7d4..2a0dbe33c8 100644 --- a/docs/package.json +++ b/docs/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "hexo": { - "version": "3.2.2" + "version": "3.3.5" }, "dependencies": { "hexo": "^3.2.0", @@ -15,4 +15,4 @@ "markdown-it-replace-link": "^1.0.0", "markdown-it-toc-and-anchor": "^4.1.1" } -} +} \ No newline at end of file diff --git a/docs/source/_data/menu.yml b/docs/source/_data/menu.yml index 51aff73270..c273cdf213 100644 --- a/docs/source/_data/menu.yml +++ b/docs/source/_data/menu.yml @@ -1,5 +1,5 @@ -guide: /intro/ -# api: /api -tutorials: /tutorials/index.html +guide: intro/ +api: /api/ +tutorials: tutorials/index.html plugins: https://github.com/search?q=topic%3Aegg-plugin&type=Repositories release: https://github.com/eggjs/egg/releases diff --git a/docs/source/api/index.md b/docs/source/api/index.md deleted file mode 100644 index dfd1de1284..0000000000 --- a/docs/source/api/index.md +++ /dev/null @@ -1,3 +0,0 @@ -layout: api -title: API ---- diff --git a/docs/themes/egg/scripts/helpers.js b/docs/themes/egg/scripts/helpers.js index 53858fdb82..5fe1cc75ee 100644 --- a/docs/themes/egg/scripts/helpers.js +++ b/docs/themes/egg/scripts/helpers.js @@ -35,8 +35,11 @@ hexo.extend.helper.register('menu_link', function() { let link = menus[menu]; const content = getI18nText(this.__, menu, 'menu.'); - if (this.page.lang !== 'en' && !/^http/.test(link)) { - link = '/' + this.page.lang + link; + // http://example.com -> http://example.com + // /api -> /api + // intro/ -> /zh-cn/intro/ + if (this.page.lang !== 'en' && !/^http/.test(link) && !/^\//.test(link)) { + link = '/' + this.page.lang + '/' + link; } links += `
  • ${content}
  • `; } diff --git a/scripts/doc.js b/scripts/doc.js index 3d3a060a85..b0bb06a8a3 100755 --- a/scripts/doc.js +++ b/scripts/doc.js @@ -38,8 +38,8 @@ co(function* () { switch (command) { case 'server': - yield runscript('hexo --cwd docs server -l'); yield jsdoc('docs/public/api'); + yield runscript('hexo --cwd docs server -l'); break; case 'build': yield runscript('hexo --cwd docs generate --force');