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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong url when linking an html that is in a subdirectory #2774

Closed
cruzlutor opened this issue Mar 12, 2019 · 1 comment
Closed

Wrong url when linking an html that is in a subdirectory #2774

cruzlutor opened this issue Mar 12, 2019 · 1 comment

Comments

@cruzlutor
Copy link

馃悰 bug report

when I try to link an HTML document that is in a subdirectory to itself the url is not correct

馃帥 Configuration (.babelrc, package.json, cli command)

package.json

{
	"name": "parcel-links",
	"version": "1.0.0",
	"main": "index.js",
	"license": "MIT",
	"scripts": {
		"dev": "parcel index.html",
		"build": "parcel build index.html"
	}
}

馃 Expected Behavior

if I'm in /categories/home.html the url when linking to the same page should be /categories/home.html

馃槸 Current Behavior

if I'm in /categories/home.html the url when linking to the same page is /home.html

馃敠 Context

We need to create a website with subcategories reusing the same menu file in all the pages

馃捇 Code Sample

index.html

<html>
<body>
  <h1>Index Home</h1>
  <a href="/index.html">Home</a>
  <a href="/categories/home.html">Categories Home</a>
</body>
</html>

categories/home.html

<html>
<body>
  <h1>Categories Home</h1>
  <a href="/index.html">Home</a>
  <a href="/categories/home.html">Categories Home</a>
</body>
</html>

Here is the full code https://github.com/cruzlutor/parcel-link-testing

馃實 Your Environment

Software Version(s)
Parcel 1.12.0
Node 11.10.0
npm/Yarn 1.13.0
Operating System MacOS
@mischnic
Copy link
Member

Fixed by #2740

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

No branches or pull requests

3 participants