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

Forcing path to / results in weird defaults #15

Closed
lionello opened this issue Oct 2, 2019 · 2 comments
Closed

Forcing path to / results in weird defaults #15

lionello opened this issue Oct 2, 2019 · 2 comments

Comments

@lionello
Copy link

lionello commented Oct 2, 2019

Running resources with relative paths like ../logo.png results in assets that have a weird name like "/../logo.png" (parent of the root?).

I'd find it more predictable if the default asset names are identical to the paths used during generation. Perhaps an new option --root could be added to keep the current behavior?

{{range $path, $file := .Files }}"/{{ $path }}": {{ template "file" $file }},{{ end }}

@omeid
Copy link
Owner

omeid commented Oct 11, 2019

Hello @lionello,

Sorry for late reply. In the context of web /../logo.png means parent of the current documents' directory and is used fairly often I am afraid.

A --root option is an acceptable solution, any reason you can't run resources from the a base that you no longer need relative paths?

Hope this helps.

tslocum added a commit to tslocum/go-resources that referenced this issue Feb 27, 2020
This makes generated paths consistent with live.Dir paths.

Also add tests for live.Dir.

Resolves omeid#15 and omeid#18.
@omeid
Copy link
Owner

omeid commented Oct 19, 2022

Closing due to lack of response.

@omeid omeid closed this as completed Oct 19, 2022
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

Successfully merging a pull request may close this issue.

2 participants