Ricardo Gladwell 759ffac992
fix: Unable to navigate on server without default index support (#1372)
* Fix: Cannot serve off `/.../index.html`

Docsify must be hosted on a server that supports a default directory
index (i.e. maps `/.../` -> `/.../index.html`).

Some platforms do not support this, however. For example, HTML apps
hosted on the popular game/software platform, Itch.io.

This change supports hosting Docsify off an explicit path file, such as
`/index.html`. It does this by:

 1. Adding handling for paths like `index.html#/blah`, and
 2. Normalising paths with fragments back to markdown paths

For example, `http://example.org/index.html#/blah` would be mapped to
`http://example.org/blah.md`.

This fixes:

https://github.com/docsifyjs/docsify/issues/427

* Add end-to-end test for index file hosting

* Add code comments for explicit file changes

* Add additional tests for index file hosting

* Add additional tests for index file hosting

* [wip] Attempt to switch tests to Jest

* Add e2e test for new Jest test framework

* Verify sidebar links use file hosting

* Fix: endsWith() not supported for IE11

* Refactor: utility method moved to utility file

* Fix IE11 error from use of String.includes()

Co-authored-by: John Hildenbiddle <jhildenbiddle@users.noreply.github.com>
2021-02-07 10:25:37 -06:00
2020-10-05 14:10:30 -05:00
2020-10-05 14:10:30 -05:00
2020-10-05 14:10:30 -05:00
2017-03-18 17:21:59 +01:00
2020-08-22 19:42:40 +08:00
2017-12-16 12:06:12 +08:00
2021-02-04 18:53:14 -06:00
2020-11-11 16:57:22 -06:00
2017-05-31 10:01:15 +08:00
2017-12-26 18:01:57 +08:00
2020-08-22 11:51:08 +08:00

docsify

A magical documentation site generator.

Backers on Open Collective Sponsors on Open Collective Unit tests Suite Linting Checks Testing the e2e test suites npm donate gitter Gitpod Ready-to-Code

Gold Sponsor via Open Collective

Features

  • No statically built html files
  • Simple and lightweight
  • Smart full-text search plugin
  • Multiple themes
  • Useful plugin API
  • Compatible with IE11
  • Support SSR (example)
  • Support embedded files

Quick start

Look at this tutorial

Edit 307qqv236

Showcase

These projects are using docsify to generate their sites. Pull requests welcome 😊

Move to awesome-docsify

Similar projects

Project Description
docute 📜 Effortlessly documentation done right
docpress Documentation website generator

Contributing

Online one-click setup for Contributing

You can use Gitpod(A free online VS Code-like IDE) for contributing. With single click it'll launch a workspace and automatically:

  • clone the docsify repo.
  • install the dependencies.
  • start npm run dev.

So that you can start straight away.

Open in Gitpod

  • Fork it!
  • Create your feature branch: git checkout -b my-new-feature
  • Commit your changes: git add . && git commit -m 'Add some feature'
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request

Development

npm run bootstrap && npm run dev

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

Contributors

This project exists thanks to all the people who contribute. [Contribute].

License

MIT

Special Thanks

Vercel has given us a Pro account.

Description
🃏 A magical documentation site generator.
Readme MIT 70 MiB
Languages
JavaScript 86.8%
CSS 12.5%
TypeScript 0.3%
Shell 0.2%
HTML 0.2%