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

With "uglyURLs = true" parts of file name is stripped #4666

Closed
pgundlach opened this Issue Apr 24, 2018 · 4 comments

Comments

Projects
None yet
4 participants
@pgundlach
Copy link

pgundlach commented Apr 24, 2018

hugo version:
Hugo Static Site Generator v0.40 darwin/amd64 BuildDate:

I have a page called foo-makeindex.md and I try to link to it with {{ ref . "foo-makeindex.md" }}. The file name is stripped to foo-make (the part index.html gets removed) and thus creating a broken link.

I have put all the files in a repository to re-create the issue: https://github.com/pgundlach/hugoexampleindexhtml

This is the config.toml:

baseURL = "http://example.org/"
languageCode = "en-us"
title = "My New Hugo Site"


uglyURLs = true

This is the index.html in layouts

<!DOCTYPE html>
<html>
<head>
	<title>a title</title>
</head>
<body>
<h1>index.html</h1>
{{ ref . "foo-makeindex.md" }}
</body>
</html>

And this is the result after calling hugo:

<!DOCTYPE html>
<html>
<head>
	<meta name="generator" content="Hugo 0.40" />
	<title>a title</title>
</head>
<body>
<h1>index.html</h1>
http://example.org/foo-make
</body>
</html>

I would expect the link goes to http://example.org/foo-makeindex.html

@kaushalmodi

This comment has been minimized.

Copy link
Member

kaushalmodi commented Apr 24, 2018

Looks like a funny bug.. may be "/index." should be stripped instead of "index."? (and then the "/" re-added for pretty URLs?)

pgundlach added a commit to speedata/publisher that referenced this issue May 30, 2018

@stale

This comment has been minimized.

Copy link

stale bot commented Aug 22, 2018

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label Aug 22, 2018

@kaushalmodi

This comment has been minimized.

Copy link
Member

kaushalmodi commented Aug 22, 2018

@bep This looks like a bug. Can you remove the stale tag?

@stale stale bot removed the Stale label Aug 22, 2018

@stale

This comment has been minimized.

Copy link

stale bot commented Dec 20, 2018

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label Dec 20, 2018

@moorereason moorereason added Bug Keep and removed Stale labels Dec 20, 2018

moorereason added a commit to moorereason/hugo that referenced this issue Dec 21, 2018

@bep bep closed this in #5547 Dec 21, 2018

bep added a commit that referenced this issue Dec 21, 2018

@bep bep added this to the v0.53 milestone Dec 21, 2018

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