#Linking to SSG routes appears to be broken in dev mode (for me).

11 messages · Page 1 of 1 (latest)

crisp ivy
#

So, I have not been able to track down similar issues, but I will say upfront that this code works (as expected) in production mode when deployed from netlify. However, dev mode and preview mode do not.

I used content collections (yaml data files w/ images) and SSG routing (for the individual photos) to make a photo gallery. However, after mapping out the collections in each category .astro file as thumbnails, the URL to the actual photo per thumbnail in dev mode do not include the category sub-directory it is in (e.g. bw/ or urban/) after photos/. Instead it links as photos/image-slug-name. Meaning, while in photos/category-name/, I get the thumbnail URL photos/image-slug instead of the expected URL photos/category-name/image-slug. Now if I included the sub-directory by typing it in the URL, i can manually pull up the generate route for single photo.

Now on the single photo page (generated by the [...slug].astro files), I have each photo linking back via '../', but it goes back to photos/ instead of photos/category-name. Once again, the category sub-directory is being ignored or skipped-over.

None of this happens in production. Production includes the sub-directory where appropriate and is fully functional, which you can see here: https://v9x.net/photos

My src/ folder structure distilled to relevance in case there is a folder structure issue.

  • content
    • bw/ (photos and .yaml files)
    • urban/ (photos and .yaml files)
    • config.ts
  • pages
    • photos/
      • bw/
        • [...slug].astro
    • urban/
      - [...slug].astro
    • bw.astro
    • urban.astro
    • photos.astro

To reiterate, if you visit my site, imagine the category thumbnails URL missing the category sub-directory and the link back on the image sends you back to photos/ instead of photos/category-name. That is what I am experiencing in dev mod.

Am I doing something wrong?

blazing reef
#

Does urban/ need to be nested under bw/ ?

#

Ahh I see the Edit now.

crisp ivy
blazing reef
#

All good. Okay. So I can see that I can visit /photos/urban/graffiti-door and its fine in Production. So whats going on in Dev?

crisp ivy
blazing reef
#

Would need to see the code.

#

Is your repo public?

crisp ivy
blazing reef
#

Cool

crisp ivy
#

Sent via DM