Hey guys, this is a bit of a weird issue that I don't know how to fix at the moment. I have multiple pages on my .astro site. Here is the structure inside my /src/pages directory:
index.astro
portfolio/
portfolioPieceOne.astro
portfolioPieceTwo.astro
portfolioPieceThree.astro
...
My index.astro page is fine.
In my index.astro page, I am trying to use:
<a href="/src/pages/portfolio/portfolioPieceOne.astro">Stuff</a>
...in order to link to the portfolioPieceOne.astro subpage.
NOTE: The reason I'm using a relative filepath to the root of the project directory is because apparently, according to Astro's site, Astro does not support filepaths relative to the current file for <a> tags. Read more about that here: https://docs.astro.build/en/core-concepts/astro-pages/
Anyway. I put npm run dev in Visual Studio Code's command line in order to run the dev server and thus test the site.
When I load index.astro and click on the link to the portfolioPieceOne.astro, the site that loads displays the code pertaining to the portfolioPieceOne astro file, rather than the actual site. It starts with:
---
import Layout from "/src/layouts/Layout.astro";
import Cursor from "/src/layouts/components/cursor/cursor.astro";
---
<Layout title="Chronoblast - Alien Insect">
<Cursor />
</Layout>
This is the code in the portfolioPieceOne.astro file.
How do I fix this? How do I display the actual site?
