Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stylesheet not loading correctly? #91

Open
icsy7867 opened this issue Jul 28, 2021 · 1 comment
Open

Stylesheet not loading correctly? #91

icsy7867 opened this issue Jul 28, 2021 · 1 comment

Comments

@icsy7867
Copy link

icsy7867 commented Jul 28, 2021

I am trying out sleeky. The admin page looks pretty slick, but I can't get the index.php to load correctly.

It appears this way in chrome and firefox. However in Firefox I get an error in the console that says:

The stylesheet https://my.url.org/ was loaded as CSS even though its MIME type, “text/html”, is not “text/css”. my.url.org

Also if I try to hit the stylesheet
https://my.url.org/frontend/dist/style.css YOURLS redirects back to https://my.url.org which perhaps that is what is going on here?

I am behind a reverse proxy and using docker. So something could be going on there, but other files seem to load alright. The admin panel seems to load its CSS sheets okay.
My other guess could potentially be the docker .htaccess but I am not too familiar with that.

Was hoping to get some other suggestions. Thank you.

EDIT

Loading the header file in header.php I saw an error saying that "YOURLS_SITE" is undefined when trying to load the CSS. This is confusing because if I do an
echo YOURLS_SITE;
on the main index.php I get the correct output. I hardcoded this to my website and now the blue is gone, but the formatting is cleaner?

EDIT 2

I removed the second reference to the same stylesheet I added into the index.php. It seems that undefined variable was not loading correctly.

From the best that I can tell.. yourls defines YOURLS_SITE.

This works:
echo YOURLS_SITE;

This does not:
echo $YOURLS_SITE;

So this code in header.php fails:
<link rel="stylesheet" href="<?php echo $YOURLS_SITE ?>/frontend/dist/styles.css">

@joshuabeny1999
Copy link

joshuabeny1999 commented Oct 21, 2021

I solved it by removing the echo part att all. In the Header.php i added only the relative path and that worked:

<link rel="stylesheet" href="/frontend/dist/styles.css">

There is also a pull request from another user with the same fix: #88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants