loopbackio / loopback-next

LoopBack makes it easy to build modern API applications that require complex integrations.
https://loopback.io
Other
4.95k stars 1.07k forks source link

Consistent URL slug style for documentation pages #5798

Closed bajtos closed 3 years ago

bajtos commented 4 years ago

At the moment, the documentation files in docs/site are using different ways for creating URL slugs (filename-like parts of the URL path).

Personally, I'd like to use nested paths in URLs, e.g. /doc/en/lb4/migration/models/overview.html. I encountered some issues with that approach the last time I tried it, but I didn't investigate them deeper.

Let's discuss what URL style(s) we want to use in our docs and ideally come up with a single style to use consistently everywhere. @raymondfeng @hacksparrow @achrinza @strongloop/loopback-maintainers

bajtos commented 4 years ago

Important: it's easy to preserve old URLs to keep working as redirects to new paths, the trick is to add redirect_from to front-matter:

-permalink: /doc/en/lb4/Using-database-transactions.html
+permalink: /doc/en/lb4/data-access-guides-transactions.html
+redirect_from: /doc/en/lb4/Using-database-transactions.html
raymondfeng commented 4 years ago
  1. I would prefer to have to file names and urls to use snake style:

    • application.md => application.html
    • openapi-generator.md => openapi-generator.html
  2. We need to understand the impact of renaming existing urls as it may break existing references

  3. We should also have more structures for docs/site - by moving some files into child directories

  4. IIRC, using nesting paths in html urls caused some problems in Jeykyll rendering of sidebars.

jannyHou commented 4 years ago

Facing similar problem in https://github.com/strongloop/loopback-next/pull/6085 Agree with using snake style and -