Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify major version number in URLs #780

Closed
jhildenbiddle opened this issue Feb 21, 2019 · 4 comments · Fixed by #1225
Closed

Specify major version number in URLs #780

jhildenbiddle opened this issue Feb 21, 2019 · 4 comments · Fixed by #1225

Comments

@jhildenbiddle
Copy link
Member

The HTML rendered by docsify-cli and listed in the Manual Installation section of the official docs results in the very latest version of docsify being loaded by default. This is not only bad practice generally speaking, but it also means that breaking changes introduced in a new major release could break a lot of live docsify sites.

The suggested fix is to specify a major version number in all docsify URLs:

<link rel="stylesheet" href="//unpkg.com/docsify@4/themes/vue.css">
<script src="//unpkg.com/docsify@4/lib/docsify.min.js"></script>

This means that when a new major version is released, site admins will need to manually update the URLs with the new major version number (e.g. @5). The benefit of this approach is that breaking changes in the new release will not affect existing docsify sites since they are loading the previous version.

If URLs are being updated, it's also worth considering the following:

  • Use CDN redirect URLs instead of specifying a path for the main lib file
  • Specify the URL scheme to avoid unnecessary redirects (i.e use https:// instead of //)
  • Switch to jsDelivr (Consider jsDelivr over unpkg for CDN #756) for better CDN performance
<script src="https://cdn.jsdelivr.net/npm/docsify@4/themes/vue.css"></script>
<script src="https://cdn.jsdelivr.net/npm/docsify@4"></script>
@jhildenbiddle jhildenbiddle mentioned this issue Feb 21, 2019
5 tasks
@timaschew
Copy link
Member

So this issue should be then migrated (or at least linked) to the CLI project, right?

@timaschew timaschew added this to the 5.0 milestone Feb 26, 2019
@jhildenbiddle jhildenbiddle changed the title Specify major version number in URLS (docsify-CLI & docs) Specify major version number in URLs Feb 28, 2019
@jhildenbiddle
Copy link
Member Author

It's a valid issue for this repo since the Manual Installation section of the docs needs to be updated, but yes--work will also need to be done in the CLI repo.

I've made a similar issue in the CLI repo.

@trusktr
Copy link
Member

trusktr commented Jun 21, 2020

Shouldn't this be in the 4.x project board?

@jhildenbiddle jhildenbiddle removed this from the 5.x milestone Jun 21, 2020
@jhildenbiddle
Copy link
Member Author

Yep. Done. 😄

anikethsaha pushed a commit that referenced this issue Jun 23, 2020
…ixes #780) (#1225)

* feat: Updated docs with instructions for installing specific version

* Removed path and name from script tag

* Updated stylesheet with specific version

* Formatted and organized headings and html blocks for version specification

* Removed html block for latest version
trusktr added a commit that referenced this issue Jul 4, 2020
* develop:
  docs: removed codefund docs and plugin (#1262)
  docs: remove bundle size from the home page and documentation (#1257)
  fix: search can not search the table header (#1256)
  fix: after setting the background image, the button is obscured (#1234)
  Fix: fixed onlycover flag in mobile (#1243)
  fix: Updated docs with instructions for installing specific version (fixes #780) (#1225)
  fix: Add error handling for missing dependencies (fixes #1210) (#1232)
  [documdocs:  deploy docsify in docker. (#1241)
  docs: Add embed gist instructions to Embed Files (fixes #932 ) (#1238)
  chore: add changelog 4.11.4
  [build] 4.11.4
  feat: added html sanitizer for remote rendering (#1128)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants