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

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

Closed
pgundlach opened this issue Apr 24, 2018 · 5 comments · Fixed by #5547
Closed

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

pgundlach opened this issue Apr 24, 2018 · 5 comments · Fixed by #5547

Comments

@pgundlach
Copy link

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
Copy link
Contributor

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
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
Copy link
Contributor

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

@stale stale bot removed the Stale label Aug 22, 2018
@stale
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 added a commit to moorereason/hugo that referenced this issue Dec 21, 2018
@bep bep closed this as completed in #5547 Dec 21, 2018
bep pushed a commit that referenced this issue Dec 21, 2018
@bep bep added this to the v0.53 milestone Dec 21, 2018
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants