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

Path aliases in Markdown front-matter are not respected #10949

Closed
1 task
NicksPatties opened this issue May 4, 2024 · 1 comment
Closed
1 task

Path aliases in Markdown front-matter are not respected #10949

NicksPatties opened this issue May 4, 2024 · 1 comment
Labels
needs triage Issue needs to be triaged

Comments

@NicksPatties
Copy link

Astro Info

Astro                    v4.7.1
Node                     v20.12.2
System                   Linux (x64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             @astrojs/mdx
                         @astrojs/sitemap

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

I have defined a path alias in my tsconfig.json file to my src/assets directory called @assets. I have used the path alias in the front-matter of a markdown file and in the body of the markdown file. The path alias is not processed in the same way as it is in the image link in the markdown file.

What's the expected result?

According to the documentation, images are processed in frontmatter the same way as they are in Markdown files, meaning that I can either use a relative path or an import alias to find the correct file.

In the sample provided, in the "Markdown Style Guide" blog page, I assign this path to my heroImage property, and also use it in my blog post. I expect the photo to be visible in both locations on the page, but only the image in the article is visible.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-frac3r?file=src%2Fcontent%2Fblog%2Fmarkdown-style-guide.md

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label May 4, 2024
@Princesseuh
Copy link
Member

Your schema is not configured properly. https://docs.astro.build/en/guides/images/#images-in-content-collections

@Princesseuh Princesseuh closed this as not planned Won't fix, can't repro, duplicate, stale May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants