how css files get ref-erenced in the generated html-files? #4095
MartinSteffen
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a probably very simplistic question or remark (and I am not sure if
it's the right forum here anyway, apologies in advance if not...)
Now, I am using Minimal Mistakes/Jekyll, and it's all fine. Recently, I
started to set-up a new page, and it's no longer fine. Resp. it's no longer
fine, if I have it hosted at a specific github server. May setup is that I
simply do a "bundle exec jekyll build ...." copying the generated files to the
repos and the commit them.
More precisely: If I commit the generated pages at github.com (the gitpages
there), it's fine. If instead I used an enterprise github server, it's not.
Unfortunately, I have no choice in the issue, I need to use the local
github enterprise server, and I have no influence on the configuration
there (and limited assistence with issues I have).
So, I poked into the problem myself. First I suspected that perhaps
Jekyll's generated setup uses advanced features, not covered by the
enterprise github server. Seems that this is not the root course.
I was able to pinpoint it to something quite simple. It's the way cascading
style sheets are referenced.
The generated index.html at the root of the directory structure
contains a line
<link rel="stylesheet" href="/assets/css/main.css">
(***)and sure enough, there's a file ./assets/css/main.ccs that contains some
style sheet specifications. It turns out that this works fine on
github.com. It also works fine when I want to check the result of my page
design locally under http://127.0.0.1:4000/, after doing
The very same thing does NOT work on the github.-server. The
index.html itself is accessible and surfable after committing, the content
is there, but the style file is not used or referenced. If I do instead of
the line (***) from above the line
<link rel="stylesheet" href="assets/css/main.css">
without the leading "/", so to say a relative path, then the css-file is
referenced and the page rendered properly.
While I was able to pinpoint it to that line, where it seems the enterprise
server is less tolerant wrt. the leading "/", I don't know what to make out
of it.
I don't know enough html/css etc to know whether (***) should be allowed
according to some standard. If so, I could come back with that info the
the administrators of that enterprise server hoping that they accept that
as a problem and address it. Or whether the server can be configured
either to tolerate it or not. Or whether I can customize my own github
settings (absolute paths tolerated: yes/no?)
Or if it's something I can tweak or customize in my own minimal mistakes
configuration (or in jekyll?) hopefully without touching any source code
so that the index.html and other files are generated without leading "/".
Anyway, any hint is welcome (also hints like ``that's outside of minimal
mistakes' bailiwick, you need to clear that with jekyll (or the enterprise
setup).
Thanks, Martin
Beta Was this translation helpful? Give feedback.
All reactions