Pretext CSS not loading in html web build

128 views
Skip to first unread message

Sam Macdonald

unread,
Feb 28, 2024, 3:58:52 PM2/28/24
to PreTeXt support
Hello,

For some reason when I deploy my pretext projects from VS Code to GitHub the web html is not being formatted correctly (see here). The local html files I have work fine, its when I deploy them that something goes awry. I tried making a new project from scratch but the html didn't work either (see here).

How would I go about remedying this / troubleshooting further? Any help would be greatly appreciated!

-Sam

Oscar Levin

unread,
Feb 28, 2024, 11:33:14 PM2/28/24
to pretext...@googlegroups.com
Hi Sam,

Which version of the cli are you using?

One thing that would likely help is to delete the .ptx folder that should be in your home folder.  The cli will automatically add it back in and hopefully install the missing files.

Oscar.

--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/27d554cd-881a-4418-844d-d7206402d0d3n%40googlegroups.com.

Sam Macdonald

unread,
Feb 29, 2024, 10:58:29 AM2/29/24
to pretext...@googlegroups.com
Hi Oscar,

I should be using the most recent version of the cli, I ran "install pretext --upgrade" this morning and everything was up to date.
I tried deleting the pretext folder but that did not resolve the issue. When I build the html and view the output everything works fine, its just when I push it to GitHub pages that the formatting doesn't show up anymore.

You received this message because you are subscribed to a topic in the Google Groups "PreTeXt support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-support/z9S714ukStE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/CAOU9BaUgvbvD8E%3DPAGzxzwH4ESU-27WqvghbQUk0hR8BeqhYKQ%40mail.gmail.com.

Oscar Levin

unread,
Feb 29, 2024, 1:08:10 PM2/29/24
to PreTeXt support
I think what is happening here is that your github pages are set up to interpret what you upload as a jekyll site, which is ignoring the _static folder that has the CSS and javascript.  CLI 2.3.6+ should have the deploy command set to add a .nojekyll file in the root of your project, which will tell github pages to not do this.

I'm not sure why that isn't happening for you.  Just to make sure, run `pretext --version` in your terminal, as well as `python -m pretext --version`.  Please report back what you get.

Are you using the command `pretext deploy` or are you using the VS-code pretext-tools extension and clicking on the button and using the pop-up menu?

Sam Macdonald

unread,
Feb 29, 2024, 2:10:50 PM2/29/24
to pretext...@googlegroups.com
Both the `pretext --version` and `python -m pretext --version' commands return 2.3.8. I deleted and created a new book and published it and then ran the 'pretext deploy' commands, but still no luck. Usually I use the VS-code pretext-tools extension.

Oscar Levin

unread,
Mar 1, 2024, 9:49:31 AM3/1/24
to PreTeXt support
Okay, I'm stumped.  Any chance you are available between 1 and 3 MST today for the pretext zoom drop-in?  I'll be there and we can troubleshoot this together.  The url is https://prose.runestone.academy/dropin/

A sure fix would be to downgrade the CLI to 2.3.4: `pip install pretext==2.3.4`.  But long term, it would be good if we figured this out, and it would help me if I knew what was going on to make the CLI more robust.

Two other things to try: 
1. In the github repository, switch to the gh-pages branch.  Do you see a _static folder?
2. If you haven't tried it already, try building with `pretext build --clean`.  I can't imagine this is the issue, but you never know.

Sam Macdonald

unread,
Mar 1, 2024, 10:56:19 AM3/1/24
to pretext...@googlegroups.com
I should be able to stop by, hopefully around 2. However, now on GitHub none of the 'pages build and deployment' are going through, they remain queued and aren't building. Any idea as to why this would happen?

esc...@gmail.com

unread,
May 16, 2024, 9:04:03 AM5/16/24
to PreTeXt support
Hi Oscar, was this resolved? I also had the same type of problem, the local copy worked great, and when i pushed into my school‘s server, the formatting failed. Thanks
ES

Oscar Levin

unread,
May 17, 2024, 12:58:16 AM5/17/24
to pretext...@googlegroups.com
If I remember correctly, this was an issue with the _static folder being ignored by github pages because that uses Jekyll which ignores folders starting with an underscore.  We fixed that by including a .nojekyll file when deploying.  I'm not sure why anything like that would be an issue with a different hosting setup though.  When you upload your output files, does that include the _static folder?

Oscar.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages