webdoc-labs / webdoc

Documentation generator for the web
https://www.webdoclabs.com
Other
79 stars 9 forks source link

Default index page does not selected explorer item without "index.html" #124

Closed bigtimebuddy closed 2 years ago

bigtimebuddy commented 3 years ago

isSamePage helper does not handle default pages well for selecting the ExplorerItem. For instance:

Example

Example: https://pixijs.io/guides/ Notice that "Welcome" IS NOT selected

Example: https://pixijs.io/guides/index.html Notice that "Welcome" IS selected

Problem

This originates from this logic in the default-template.

https://github.com/webdoc-labs/webdoc/blob/fe0c1c1ebe7dbf1fb514ddea6bba369530dd83e5/packages/webdoc-default-template/src/app/components/Explorer/helpers.js#L1-L13

When I console.log('isSamePage', data.page, path); with in that function I get:

isSamePage /guides/index.html /guides/.html

It returns false when it should be true.