I am trying to host a static site created by Franklin.jl using GitHub Pages of my job’s GitHub Enterprise Server. The hosting part seems working fine because I can access the website through my job’s private network.
However, the template is not applied to the website. The website shows index.html as
I don’t know much about web programing, so I’m not sure if this is a CSS issue or JavaScript issue or something else. Any suggestions on trouble-shooting this issue?
A few things that might be relevant:
My job’s GitHub Enterprise Server is not offering GitHub Actions, so the publishing process cannot be automatized.
I created a repository named pages in my job’s GitHub, and pushed the contents of the __site directory locally created by Franklin.serve().
Then in GitHub > pages repository > Settings > Code and automation > Pages, I indicated the main branch as the source of the GitHub pages. Then the link to the website was displayed. Going to the link showed the first screenshot above where the template was not applied.
To me that looks like the css file is not found on sever
Can you check with inspection tools (of your browser) which URL the html page is looking for the css file and where it actually is? Also for deployment the css file is usually copied by Franklin if I remember correctly so this copying should happen on the deployed folder as well.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/libs/katex/katex.min.css">
<link rel="stylesheet" href="/libs/highlight/styles/github.min.css">
The name of the GitHub repository for the GitHub Pages is `pages`
<link href="/css/franklin.css" rel="stylesheet">
<link href="/css/vela.css" rel="stylesheet">
I think the location of the CSS file indicated in the last line, href="/css/vela.css", is correct, if it is a relative path w.r.t. the directory of index.html. Specifically, the name of the GitHub repository for the GitHub Pages is pages as mentioned in OP. The link to the website displayed in “GitHub > pages repository > Settings > Code and automation > Pages” is
Thank @tlienart for the insightful answer! The issue is resolved now.
Both of your suggestions were crucial. Specifically,
I included prepath = "<my ID>/pages" in config.md.
Previously I had tried prepath = "pages" thinking that prepath would need to be the repository name, but it seems that it needs to be the entire part that comes after the first / in the URL.
I performed optimize() before pushing the website contents to GitHub.
Implementing only one of the above two steps didn’t solve the issue.