# Webpage not rendering correctly on GitHub pages

**URL:** <https://discourse.julialang.org/t/webpage-not-rendering-correctly-on-github-pages/87769>\
**Category:** General Usage\
**Tags:** github, website, franklin\
**Created:** [September 25, 2022, 4:42am UTC](https://discourse.julialang.org/t/webpage-not-rendering-correctly-on-github-pages/87769 "2022-09-25T04:42:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![leoflotor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leoflotor/32/35345_2.png) [@leoflotor](https://discourse.julialang.org/u/leoflotor)\
**Post date:** [September 25, 2022, 4:42am UTC](https://discourse.julialang.org/t/webpage-not-rendering-correctly-on-github-pages/87769/1 "2022-09-25T04:42:09Z")

</div>

Hi!

I wanted to start my first personal website using Franklin but with no success on rendering [my site](https://leoflotor.github.io/) as it should. I uploaded the default site that Franklin creates because I first wanted to check that all was running fine on GitHub pages.

What I did was create an [empty public repo](https://github.com/leoflotor/leoflotor.github.io.git), then synced it with my local directory as mentioned in the [docs](https://franklinjl.org/workflow/deploy/#synchronise_your_local_folder).

I saw that a `prepath` is neded [in some cases](https://discourse.julialang.org/t/deploying-a-website-with-franklin/38930/6) but this doesn’t seem to be my case.

Also, I initialized my site as:

```julia
julia> newsite("."; template="lanyon")
✓ Website folder generated at "/home/leo/Documents/projects/leoflotor.github.io" (now the current directory).
→ Use serve() from Franklin to see the website in your browser.

```

When I run `serve()` I can see my local webpage and everything seems to be running fine.

```julia
julia> serve()
  Activating project at `~/Documents/projects/leoflotor.github.io`
→ Full pass (with pre-rendering) [done 739.4ms]                                             
→ Minifying *.[html|css] files... [done 63.0ms]                                              
→ Pushing updates with git... [done 1.6s]   

```

Then I followed the documentation shortcut to publish the changes directly from the currently active `julia` session and the active project:

```julia
julia> publish()
  Activating project at `~/Documents/projects/leoflotor.github.io`
→ Full pass (with pre-rendering) [done 739.4ms]                                             
→ Minifying *.[html|css] files... [done 63.0ms]                                              
→ Pushing updates with git... [done 1.6s]  

```

---

<div class="post-metadata">

**Author:** ![tlienart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlienart/32/7640_2.png) [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Post date:** [September 25, 2022, 7:57am UTC](https://discourse.julialang.org/t/webpage-not-rendering-correctly-on-github-pages/87769/2 "2022-09-25T07:57:39Z")

</div>

Hello @leoflotor when things show fine locally but not remotely, the problem is with what you pushed remotely.

In your case, you properly pushed things to `gh-pages` [1] but the branch that GitHub uses to publish your page is incorrectly set. To set it you should go to the repo settings, click page, and select `gh-pages` as the source branch for the page. Once you’ve done that, wait a couple of minutes and things should deploy properly. What you see now on your page is just GitHub trying to render markdown (from the `main` branch).

If after doing this successfully, you think the docs could/should be improved to reflect this, please consider making a PR to the docs. thanks!

[1] btw you shouldn’t do this push manually, on GitHub it’s much easier to use a GitHub action to do this, see [this demo repo](https://github.com/tlienart2/tlienart2.github.io) and [its workflow](https://github.com/tlienart2/tlienart2.github.io/blob/master/.github/workflows/deploy.yml), you should be able to just copy paste stuff maybe updating a couple of things like Julia version and removing Python if you don’t need it).  
That being said, even with a GA, you would still have had to select the branch in repo settings.

---

<div class="post-metadata">

**Author:** ![leoflotor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leoflotor/32/35345_2.png) [@leoflotor](https://discourse.julialang.org/u/leoflotor)\
**Post date:** [September 25, 2022, 3:44pm UTC](https://discourse.julialang.org/t/webpage-not-rendering-correctly-on-github-pages/87769/3 "2022-09-25T15:44:35Z")

</div>

Thanks! It did work, now it’s up correctly.

The push you refer to is te initial push to the repo? You mean that I can create the repo in GitHub, clone it, and create the site inside my local repo directory with Franklin. And then `publish()` it, right ?

---

<div class="post-metadata">

**Author:** ![tlienart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlienart/32/7640_2.png) [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Post date:** [September 26, 2022, 7:40am UTC](https://discourse.julialang.org/t/webpage-not-rendering-correctly-on-github-pages/87769/4 "2022-09-26T07:40:55Z")

</div>

No I meant that if you’re using GitHub, you should prefer the GitHub action (cf links in my footnote) to the `publish` function when you want to deploy. If you look into the code though you’ll see that the two do the same thing, except that `publish` will be deprecated.

The steps on GitHub are:

- edit stuff locally, check they look good
- git push changes (or merge) on the main branch of the github repo
- github action workflow sees the push, runs the site build, generates the content of `__site`, and puts it on `gh-pages` to deploy it.
