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

get_url with @ only finds Markdown files #2530

Closed
xpe opened this issue Jun 18, 2024 · 5 comments
Closed

get_url with @ only finds Markdown files #2530

xpe opened this issue Jun 18, 2024 · 5 comments

Comments

@xpe
Copy link
Contributor

xpe commented Jun 18, 2024

Documentation issue

Summary

It is not clear from the documentation that using @ with get_url only will find Markdown files.

Why I care

I want to get a build-time verified hyperlink to an image file. get_url won't do this at present. I'll ask on the forum for other ways to do it.

Commentary

The name get_url is indeed generic and works as expected as long as @ is not used. The @ implies additional meaning, but this implied meaning is not made clear in the documentation.

@Keats
Copy link
Collaborator

Keats commented Jun 19, 2024

I guess we should link to https://www.getzola.org/documentation/content/linking/#internal-links in there

@xpe
Copy link
Contributor Author

xpe commented Jun 19, 2024

Ooops. I made a mistake above:

I want to get a build-time verified hyperlink to an image file. get_url won't [provide build-time verification]

Actually get_url does do build-time checking.

@xpe
Copy link
Contributor Author

xpe commented Jun 19, 2024

I guess we should link to https://www.getzola.org/documentation/content/linking/#internal-links in there

I don't see how this addresses my core concern.

Here is my suggested verbiage to add to the docs for get_url:

Note: get_url with a @ prefix only searches for Markdown files

@Keats
Copy link
Collaborator

Keats commented Jun 19, 2024

A link starting with @/ is an internal link and how they work is described in that page

@xpe
Copy link
Contributor Author

xpe commented Jun 20, 2024

@Keats Have you tried to understand this from another person's point of view?

Here is an example of what a user might do:

  1. A person visits https://www.getzola.org/documentation/templates/overview/#get-url

  2. The person sees mention of @ and reads the description.

Gets the permalink for the given path. If the path starts with @/, it will be treated as an internal link like the ones used in Markdown, starting from the root content directory as well as validated.

  1. The user might reasonably expect that @ can be used to link to any file underneath content.

This is what I've done. And the documentation isn't clear from my POV. Remember, the documentation is for users, which have their own points of view.

If this sounds... overly spelled out or even preachy, it is only because my earlier messages didn't get the point across, so I'm trying the "be more direct" approach.

@Keats Keats closed this as completed in 2e17c77 Jun 21, 2024
berdandy pushed a commit to berdandy/azola that referenced this issue Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants