#Astro in Github Pages can not correctly show css, javascript and images.

7 messages · Page 1 of 1 (latest)

heavy cypress
#

Here is info

Astro v4.16.10
Node v22.13.0
System Windows (x64)
Package Manager npm
Output static
Adapter none
Integrations none

Astro Config


// https://astro.build/config
export default defineConfig({
    site: "site",
    base: "/adventure_center"
});```

I have read this guidance.
https://docs.astro.build/en/guides/deploy/github/

I don't know why any files lost connection.
And I have already tried anything I can do
Is this like the bug?
Docs

How to deploy your Astro site to the web using GitHub Pages.

proven meteor
#

Can you try setting your node version to match the one used in your project?

The withastro/action that's used for these defaults to 20 and it looks like your project is using 22

hushed harbor
#

You load your images from the /public directory, so you must account for the base option. When deployed it points to /img/logo.png but supposed to /adventure_center/img/logo.png.

heavy cypress
heavy cypress
#

Maybe I should NOT use Astro the worst ever SSG Generator

proven meteor
#

I mean plenty of people host their Astro projects on GitHub pages so this is most likely something related to your specific setup

I apologize that I am not very experienced with GitHub pages and couldn't be of more assistance

However you are more than welcome to use a different framework if that works better for you but in the mean time I will call in some backup to see if we can help you get this resolved

cc <@&1129102257422610512>
Any experienced GitHub pages users providing input here would be appreciated 🙂

shrewd remnant
#

First thing I noticed.

import { defineConfig } from 'astro/config';

// https://astro.build/config
export default defineConfig({
    site: "site", // Why is this just Site?
    base: "/adventure_center"
});

The value for site must be one of the following:

The following URL based on your username: https://<username>.github.io
The random URL autogenerated for a GitHub Organization’s private page: https://<random-string>.pages.github.io/

https://docs.astro.build/en/guides/deploy/github/#site

Have you tried to update that?