Closed nicolaswunderle closed 8 months ago
Hi @nicolaswunderle, I have created an update, can you try again?
Hi @preetamslot, I downloaded the new version and tried the npm run dev and npm run build commands again but I still get the same errors as in my previous message.
Ah, sorry I did no look into the base: '/portfolio
I have not used this before.
in the docs it tells us:
When using this option, all of your static asset imports and URLs should add the base as a prefix. You can access this value via import.meta.env.BASE_URL
So to make this work you will have to:
So for snipcart:
find: /snipcart.js
and replace with /portfolio/snipcart.js
The error on the image path error is maybe related becouse the images are in a sub-dir?
''' [{ params: { slug: 'about-us' }, props: { image: '/src/assets//portfolioabout-us.jpeg' } }....] ''' try removing the slash from the imageSrc in the getStaticPath function in pages/images/[slug].astro .
const imageSrc = `/src/assets/${imgParts[0]}.${imgParts.pop()}`;
TO:
const imageSrc = `/src/assets${imgParts[0]}.${imgParts.pop()}`;
I followed the Astro tutorial to deploy the site on GitHub Pages (https://docs.astro.build/en/guides/deploy/github/). Here are the problems I encountered locally by adding "base: '/portfolio'" to the config: