edapm / jekyll-statuspage

A Statuspage template for Jekyll
https://rubygems.org/gems/jekyll-statuspage
MIT License
0 stars 1 forks source link

[Bug] Theme has issues on Windows #3

Open edapm opened 4 years ago

edapm commented 4 years ago

Does not take baseurl into account, serves from url (i.e. localhost rather than localhost/page)


Probably Windows Issue

MichaelCurrin commented 4 years ago

Here's a solution in case you need help.

Update your includes head.html file. I haven't checked all URLs but these definitely need fixes. If site.baseurl is set it will be prepended to the URLs.

<link rel="icon" href="{{site.brand.logo}}" type="image">
<link rel="stylesheet" href="assets/css/index.css">
<link rel="icon" href="{{ site.brand.logo | relative_url }}" type="image">
<link rel="stylesheet" href="{% 'assets/css/index.css' | relative_url %}">

Note the first is a variable so has no quotes and the second is a string so needs quotes.

MichaelCurrin commented 4 years ago

You should also consider a flow for the logo. Is it required? Is there a fallback value?

Maybe rather than setting it in your sample config you can have a fallback.

{{ site.brand.logo | defaults: 'assets/logo.png' | relative_url }}

edapm commented 4 years ago

Hi @MichaelCurrin, I've done what you said and it still doesn't work. It's not to do with relative_url , because I've added them in, and it's a single page theme. For some reason Jekyll isn't serving it from the baseurl, even though it says it is in the terminal output: Server address: http://127.0.0.1:4000/jekyll-statuspage/.

MichaelCurrin commented 4 years ago

Your theme's config says /jekyll - that should be updated to be consistent with the above

baseurl: /jekyll-statuspage

I don't know what you mean it is not serving. Do you get 404 page or white page or just bad CSS?

I can try running tomorrow.

Make sure to go to http://127.0.0.1:4000/jekyll-statuspage/ in your browser as http://127.0.0.1:4000/jekyll-statuspage no forwardslash will not work. I frequently forget about that.

That value I suggested above also means you can have a demo GH Pages site using the theme repo itself and not the other repo. Currently using "/jekyll" would not work nicely on GH Pages.

MichaelCurrin commented 4 years ago

I downloaded and ran the theme alone and it works.

Check your terminal output again as the path is /jekyll not /jekyll-statuspage/ as you said above.

Screen Shot 2020-09-17 at 1 08 21 pm

I ran the theme itself.

http://127.0.0.1:4000/jekyll/

Screen Shot 2020-09-17 at 1 07 30 pm
MichaelCurrin commented 4 years ago

I noticed you used bad values in your head.html - I made a PR #5

This doesn't make sense as it applies one filter to the other:

{{ site.baseurl | 'some/string' }}

What make more sense is something like this, which puts the two strings next to each other.

{{ site.baseurl }}{{ 'some/string' }}

And if you use _relativeurl, it does that for you so you can drop the baseurl code.

{{ 'some/string' | relative_url }}

Becomes:

/jekyll-statuspage/some/string

Or with fallback

{{ site.foo | default: 'some/string' | relative_url }}
edapm commented 4 years ago

I wonder whether it's an environmental issue - if you can run it, but I can't for some reason. I'm running Jekyll on Windows 10.

MichaelCurrin commented 4 years ago

Yes I got it to work. This was in my HTML source and I could view the file in the browser.

http://127.0.0.1:4000/jekyll/assets/css/index.css

MichaelCurrin commented 4 years ago

Update your main branch to get the PR changes and then try again.

edapm commented 4 years ago

@MichaelCurrin, I ran it on Gitpod and it worked okay, I'll try it on Windows again at some point. I've merged the pull requests.