I’ve just deployed on Pages an Eleventy site from my GitHub repo, but it shows unformatted on .pages.dev, previews links, and custom domain.
I’ve checked the source of .pages.dev, preview links, custom domain, and all paths of links to .css etc are correct as they are in my local building of the same output folder (_site) which locally builds correctly with all pages properly formatted.
Sorry, I can’t understand why this problem is happening when I deploy to Pages. My local build works fine, all pages are formatted there.
Please, can someone give me some indication?
Your issue stems from the content-security-policy header you’re applying. Check your browser dev console and you’ll see a tonne of warnings about JS/CSS not executing. For example:
Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-ppTQAD09+uNeED36PKLUCm56BJFycfhnFKlKNvlHpl8='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.