Skip to content

LocationProvider baseName / publicPath #276

Open
@jacob-ebey

Description

@jacob-ebey

It would be nice to have a configurable property on the LocationProvider that would prefix local routes with a base name / public path.

The use-case for this is to be able to support hosting platforms like github pages where things are hosted on https://basepath.com/repository-name.

I envision the usage as something like:

<LocationProvider basename="/repository-name">
  ...
</LocationProvider>

This would then route the following anchors respectively:

<a href="/">Home</a> /* /repository-name/ */
<a href="/about">About</a> /* /repository-name/about */

What are your thoughts on this? Could be solved with a simple "Link" component in the project that would reference some injected global for the prefix allowing for the anchors to match their location, but thought I'd throw this idea out there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlibpreact-iso, etc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions