-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
.File.Dir and .FilePath return absolute paths when used in directory based archetypes #7589
Comments
Confirmed. Reproduced with Hugo Static Site Generator v0.75.0-DEV/extended linux/amd64 BuildDate: unknown. |
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. |
Possibly related: When |
The old implementation had some issues, mostly related to the context (e.g. name, file paths) passed to the template. This new implementation is using the exact same code path for evaluating the pages as in a regular build. This also makes it more robust and easier to reason about in a multilingual setup. Now, if you are explicit about the target path, Hugo will now always pick the correct mount and language: ```bash hugo new content/en/posts/my-first-post.md ``` Fixes gohugoio#9032 Fixes gohugoio#7589 Fixes gohugoio#9043
The old implementation had some issues, mostly related to the context (e.g. name, file paths) passed to the template. This new implementation is using the exact same code path for evaluating the pages as in a regular build. This also makes it more robust and easier to reason about in a multilingual setup. Now, if you are explicit about the target path, Hugo will now always pick the correct mount and language: ```bash hugo new content/en/posts/my-first-post.md ``` Fixes gohugoio#9032 Fixes gohugoio#7589 Fixes gohugoio#9043
The old implementation had some issues, mostly related to the context (e.g. name, file paths) passed to the template. This new implementation is using the exact same code path for evaluating the pages as in a regular build. This also makes it more robust and easier to reason about in a multilingual setup. Now, if you are explicit about the target path, Hugo will now always pick the correct mount and language: ```bash hugo new content/en/posts/my-first-post.md ``` Fixes gohugoio#9032 Fixes gohugoio#7589 Fixes gohugoio#9043 Fixes gohugoio#9046
The old implementation had some issues, mostly related to the context (e.g. name, file paths) passed to the template. This new implementation is using the exact same code path for evaluating the pages as in a regular build. This also makes it more robust and easier to reason about in a multilingual setup. Now, if you are explicit about the target path, Hugo will now always pick the correct mount and language: ```bash hugo new content/en/posts/my-first-post.md ``` Fixes gohugoio#9032 Fixes gohugoio#7589 Fixes gohugoio#9043 Fixes gohugoio#9046
The old implementation had some issues, mostly related to the context (e.g. name, file paths) passed to the template. This new implementation is using the exact same code path for evaluating the pages as in a regular build. This also makes it more robust and easier to reason about in a multilingual setup. Now, if you are explicit about the target path, Hugo will now always pick the correct mount and language: ```bash hugo new content/en/posts/my-first-post.md ``` Fixes gohugoio#9032 Fixes gohugoio#7589 Fixes gohugoio#9043 Fixes gohugoio#9046
The old implementation had some issues, mostly related to the context (e.g. name, file paths) passed to the template. This new implementation is using the exact same code path for evaluating the pages as in a regular build. This also makes it more robust and easier to reason about in a multilingual setup. Now, if you are explicit about the target path, Hugo will now always pick the correct mount and language: ```bash hugo new content/en/posts/my-first-post.md ``` Fixes gohugoio#9032 Fixes gohugoio#7589 Fixes gohugoio#9043 Fixes gohugoio#9046
The old implementation had some issues, mostly related to the context (e.g. name, file paths) passed to the template. This new implementation is using the exact same code path for evaluating the pages as in a regular build. This also makes it more robust and easier to reason about in a multilingual setup. Now, if you are explicit about the target path, Hugo will now always pick the correct mount and language: ```bash hugo new content/en/posts/my-first-post.md ``` Fixes gohugoio#9032 Fixes gohugoio#7589 Fixes gohugoio#9043 Fixes gohugoio#9046
The old implementation had some issues, mostly related to the context (e.g. name, file paths) passed to the template. This new implementation is using the exact same code path for evaluating the pages as in a regular build. This also makes it more robust and easier to reason about in a multilingual setup. Now, if you are explicit about the target path, Hugo will now always pick the correct mount and language: ```bash hugo new content/en/posts/my-first-post.md ``` Fixes gohugoio#9032 Fixes gohugoio#7589 Fixes gohugoio#9043 Fixes gohugoio#9046 Fixes gohugoio#9047
The old implementation had some issues, mostly related to the context (e.g. name, file paths) passed to the template. This new implementation is using the exact same code path for evaluating the pages as in a regular build. This also makes it more robust and easier to reason about in a multilingual setup. Now, if you are explicit about the target path, Hugo will now always pick the correct mount and language: ```bash hugo new content/en/posts/my-first-post.md ``` Fixes #9032 Fixes #7589 Fixes #9043 Fixes #9046 Fixes #9047
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. |
I have a directory based archetype and a standard archetype:
Both
.md
files are identical and just include:New content created from the standard archetype contains a path relative to
content/
as expected (https://gohugo.io/variables/files/):However, new content created from the directory based archetype contains the full path:
hugo new -k test-bundle blog/test cat content/blog/test/index.md # /home/tom/projects/test-hugo-dir/content/blog/test/
I assume the issue is somewhere in https://github.com/gohugoio/hugo/blob/master/create/content.go and the
NewContent
/newContentFromDir
functions but my Hugo/Go knowledge is not enough to work out exactly what.Example repository:
https://github.com/thomasmarkrea/test-hugo-dir
Related forum post:
https://discourse.gohugo.io/t/file-dir-returns-absolute-path/27621
What version of Hugo are you using (
hugo version
)?also tested on
Does this issue reproduce with the latest release?
Yes
The text was updated successfully, but these errors were encountered: