#Using alias in .md files

3 messages · Page 1 of 1 (latest)

tired sapphire
#

Is it possible to use an alias in a markdown.
So instead of heroImage: ../../assets/images/north-middlesex-hospital/north-middlesex-hospital-47574190.jpg using @images/north-middlesex-hospital/north-middlesex-hospital-47574190.jpg

I am getting this error:
18:44:08 [ERROR] [content] end of the stream or a document separator is expected
Hint:
Browser APIs are not available on the server.

cosmic dockBOT
#

Hi @tired sapphire. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the information provided in the extracts, it appears that there have been issues reported with using aliases in markdown files in Astro. For example, in issue #6490 (https://github.com/withastro/astro/issues/6490), the user reported that an asset referenced in markdown files using the alias ~/assets/file.jpg was not found. Similarly, in issue #9036 (https://github.com/withastro/astro/issues/9036), the user reported that the @assets import alias failed in Astro.

However, the extracts do not provide a definitive answer on whether this issue has been resolved or if there's a workaround. Therefore, I recommend checking the latest Astro documentation or the open issues on the Astro GitHub page for the most up-to-date information.

As for the error message you're seeing, it seems unrelated to the use of aliases. The message "Browser APIs are not available on the server" typically means that some code is trying to use a feature that's only available in the browser environment, but this code is running on the server. This could be due to a variety of reasons, and without more context, it's hard to provide a specific solution.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: