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

Allow href without .html extension for links between app's pages #2328

Closed
gereleth opened this issue Jul 31, 2021 · 2 comments
Closed

Allow href without .html extension for links between app's pages #2328

gereleth opened this issue Jul 31, 2021 · 2 comments

Comments

@gereleth
Copy link

Is your feature request related to a problem? Please describe.

I want to have several pages in my app with links between them.
Suppose my distDir contains two files: index.html and about.html.
My index page has a link to the About page:
<a href="about"> About </a>
On the web this link opens the about.html file.
But in Tauri this link doesn't work unless I put href="about.html" there.

Describe the solution you'd like
The link should work even if I don't add the .html part.

Describe alternatives you've considered
_

Additional context
_

@amrbashir
Copy link
Member

amrbashir commented Jul 31, 2021

as discussed on discord
given this directory structure , if you want about.html then you need to explicitly set your <a> tag to link to about.html
ex: <a href="about.html">About</a>

|_ index.html
|_ about.html

if you want <a href="about">About</a> to work then your folder structure should be like this

|_ index.html
|_ about
	|_ index.html

@gereleth
Copy link
Author

Thanks. I realised after looking into this that I had a setting called clean_urls enabled in a Vercel-hosted app which made my links work that way.
What you described about folder structure makes total sense. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants