GetPublii / Publii

The most intuitive Static Site CMS designed for SEO-optimized and privacy-focused websites.
https://getpublii.com
GNU General Public License v3.0
6.31k stars 416 forks source link

[Bug]: Style Sheets not working for any theme. #1677

Open francesmothrock opened 2 months ago

francesmothrock commented 2 months ago

Operating system

Linux Ubuntu 24.04 (Gnome 46.0)

Publii version

0.46.1

Post editor

None

Bug description

When I click Preview your changes, it opens the web site in a browser, but it is just unformatted text, as though the style sheet is not referred to correctly. I tried it with Publii installed via the Appimage and .Deb file, and got the same result. I tried it with the site that I already had in place, and made a new test site, same both ways. I deleted the .config/Publii directory and let it recreate, in case a setting was wrong, and that didn't help either.

Apologies if I'm missing something silly.

Steps to reproduce

No response

Relevant log output

No errors shown.
healBvdb commented 2 months ago

Operating System

Desktop: GNOME v: 46.4 Distro: Fedora Linux 40 (Workstation Edition)

Publii version

v.0.46.1 (build 16918)

Exactly the same effect for me When I try to preview a simple site I get the html with no css

image

dziudek commented 2 months ago

Hi,

It is the same issue for free themes downloaded form marketplace?

Could you also check:

healBvdb commented 2 months ago

Tested with Mono(v.2.0.1.0) it looks different but still not correct image

The sites/test1/preview/assets/css contain main.css and style.css

The developer console show : index.html:3 Access to font at 'file:///home/username/Documents/Publii/sites/test1/preview/assets/dynamic/fonts/publicsans/publicsans.woff2' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: brave, chrome, chrome-extension, chrome-untrusted, data, http, https, isolated-app. publicsans.woff2:1 Failed to load resource: net::ERR_FAILED /home/username/Documents/Publii/sites/test1/preview/assets/css/style.css?v=38aa6f8ee24977b343373b98d92fe3ae:1 Failed to load resource: net::ERR_FILE_NOT_FOUND scripts.min.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND svg-map.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND svg-fix.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND index.html:1 The resource file:///home/usernamealisdecris/Documents/Publii/sites/test1/preview/assets/dynamic/fonts/publicsans/publicsans.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally. index.html:1 The resource file:///home/usernamealisdecris/Documents/Publii/sites/test1/preview/assets/dynamic/fonts/publicsans/publicsans.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.

francesmothrock commented 1 month ago

Yes, I tried installing several different themes, and had the same problem with them all.

I'm a little confused about the preview folder. When I hit preview, it opens a browser window at this address: file:///run/user/1000/doc/87e57a5f/index.html And in that case index.html is the only file in that folder. I also have files in: /home/inkblot/Documents/Publii/sites/test/preview/ and that looks like a complete web site, including assets/css/main.css + style.css. But the site still doesn't show styles when I open the html files in that folder.

I'm not sure how to access the developer console - I can only find the the log viewer under Tools & Plugins, and haven't found reference to developer console in Publii documentation. Should I be showing results from one of those logs? Deployment-errors.log says "the log file is empty..."

dziudek commented 1 month ago

@francesmothrock @healBvdb - most probably it is related to GVFS (Gnome Virtual File System), because Publii should open normal path /home/username/... while it seems that Publii opens temporary path to the index.html file and only this file. I afraid that it will be hard to solve - it seems that index.html file is moved by your system to temporary location and opened from this folder instead of original one.

francesmothrock commented 1 month ago

I think you're right! On the one hand, it may be tough to fix because of Gnome's weird behavior. On the up side, it gives me a workaround, because if I navigate to the proper preview folder and open it in a different web browser, it opens the folder in its proper location, not moving it to the /run/... directory. So I can work with that!

I'll test it out using a different Linux distro when I get a chance to see if that makes a difference.

Thank you!

francesmothrock commented 1 month ago

Follow up - I tested this on my spare machine with Linux Mint Debian Edition, with Cinnamon desktop and it worked fine. So it seems like it's a Gnome specific problem.

AlejandroAkbal commented 1 week ago

Using ZorinOS (Ubuntu 22) with Gnome and Firefox, also having this problem :/

But it does not happen with Chrome? Maybe allow us to select which browser to open?