Content-Length: 262883 | pFad | https://github.com/sveltia/sveltia-cms/issues/289

25 `public_folder` without path · Issue #289 · sveltia/sveltia-cms · GitHub
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

public_folder without path #289

Closed
lorensansol opened this issue Jan 4, 2025 · 7 comments
Closed

public_folder without path #289

lorensansol opened this issue Jan 4, 2025 · 7 comments

Comments

@lorensansol
Copy link

With media_folder: assets/img

  • If I use public_folder: /foo
    • Expectation?: image: /foo/example.jpg
    • Reality: image: /foo/example.jpg ✅
  • If I use public_folder: /foo/
    • Expectation?: image: /foo/example.jpg
    • Reality: image: /foo/example.jpg ✅
  • If I use public_folder: /
    • Expectation?: image: /example.jpg
    • Reality: image: //example.jpg ❌
  • If I use public_folder: '.'.
    • Expectation?: image: example.jpg ⬅️ I would especially like this
    • Reality: image: /./example.jpg ❌
  • If I use public_folder: ''.
    • Expectation?: image: example.jpg ⬅️ I would especially like this
    • Reality: image: /assets/img/example.jpg ❌
@kyoshino
Copy link
Member

kyoshino commented Jan 4, 2025

Is the public_folder a global option or folder collection option?

@lorensansol
Copy link
Author

Global option.

@kyoshino
Copy link
Member

kyoshino commented Jan 4, 2025

You cannot use a relative path ('' or '.') with the global public_folder option. It’s supposed to start with /. You should be able to use a relative path with the collection-level public_folder option.

The double slash with '/' is probably a bug. I’ll fix it.

@lorensansol
Copy link
Author

And can't there be some way to store the value without a leading slash?

@kyoshino
Copy link
Member

kyoshino commented Jan 4, 2025

A relative path with collection-level public_folder option works when the path option is used (for Hugo’s page bundles). In that case, a leading slash can be omitted with '' or '.'. It’s an entry-relative path.

Otherwise, the path is always root relative, starting with /.

@kyoshino
Copy link
Member

kyoshino commented Jan 4, 2025

When I use public_folder: /, I’ll get image: example.jpg instead of image: //example.jpg, but it’s a bug anyway... I’m fixing it.

@kyoshino
Copy link
Member

kyoshino commented Jan 5, 2025

The issue with public_folder: / is solved with v0.53.2. Later I’ll add config validation for the empty or relative path.

@kyoshino kyoshino closed this as not planned Won't fix, can't repro, duplicate, stale Jan 5, 2025
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

No branches or pull requests

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/sveltia/sveltia-cms/issues/289

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy