Skip to content

Can not get right routes with multi sections #2370

Closed
@Koooooo-7

Description

@Koooooo-7
          > > I am currently encountering issue 2, and I do not want to change my document directory structure. Is there any way to resolve this?

Hi @L-Super , could provide more details on your issue? and I may find a workaround to solve it before we settle this issue down. For path related issue, consider try alias or rewrite it in hooks instead of re- structure your docs totally.

I placed this repo under the docs folder and renamed SUMMARY.md to guide.md, while my directory structure for docs is as follows:
image

index.html:

<body>
  <div id="app"></div>
  <script>
    window.$docsify = {
      name: '<span>docsify</span>',
      logo: '/favicon.svg',
      relativePath: true,
      loadSidebar: 'guide.md',
      auto2top: true,
      loadNavbar: true,
      subMaxLevel: 2,
      mergeNavbar: true,


      repo: 'https://github.com/L-Super',

      pagination: {
        previousText: '上一章节',
        nextText: '下一章节',
        crossChapter: true,
        crossChapterText: true,
      },
      loadFooter: true,
      baiduTjId: "xxxx",
      // 广告配置
      ads: [
        {
          img: 'resources/images/wx_qrcode.png'
        },
      ],
    }

    window.$docsify.customPageTitle = {
      prefix: false,      // [optional] title prefix. default: false eg: prefix: "Application"
      suffix: "在线充电站",      // [optional] title suffix. default: false eg: suffix: "v1.0.0"
      separator: '|',       // [optional] separator for title eg: title->   prefix | title | suffix
      debug: false,      // [optional] should debug
    }
  </script>
  <!-- Docsify v4 -->
  <script src="resources/js/docsify.js"></script>

  <script src="resources/js/prism-bash.min.js"></script>
  <script src="resources/js/prism-cpp.min.js"></script>
  <script src="resources/js/docsify-pagination.min.js"></script>
  <script src="resources/js/docsify-footer.min.js"></script>
  <script src="resources/js/vanilla-back-to-top.min.js"></script>
  <script src="resources/js/docsify-plugin-title.min.js"></script>
  <script src="resources/js/docsify-ads.min.js"></script>
  <script src="resources/js/docsify-baidu-tj.min.js"></script>

  <script>
    addBackToTop({
      diameter: 56,
      backgroundColor: 'rgb(66, 185, 131)',
      textColor: '#fff',
    });
  </script>

  <script>
    if (typeof navigator.serviceWorker !== 'undefined') {
      navigator.serviceWorker.register('pwa.js')
    }
  </script>
</body>

root guide.md:

* [程序员英语学习指南](/A-Programmers-Guide-to-English/README.md)

Directory structure:

docs/A-Programmers-Guide-to-English
├─assets
├─essence
├─make-a-program
├─qa
├─resources
└─training

When I switch between different sections from the left side, the URL shows an incorrect path.

Current behaviour:

http://localhost:3000/#/A-Programmers-Guide-to-English/essence/make-a-program/README

Expected behaviour:

http://localhost:3000/#/A-Programmers-Guide-to-English/make-a-program/README

Originally posted by @L-Super in #1891 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions