# Franklin.jl and Github

**URL:** <https://discourse.julialang.org/t/franklin-jl-and-github/117008>\
**Category:** General Usage\
**Tags:** question, package, franklin\
**Created:** [July 13, 2024, 5:47pm UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008 "2024-07-13T17:47:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [July 13, 2024, 5:47pm UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/1 "2024-07-13T17:47:56Z")

</div>

I installed Franklin.jl and created a website, which is in a subfolder. I know I can deploy the generated website to Github. But does this deploy just the generated code, or also the source code?

---

<div class="post-metadata">

**Author:** ![Alseidon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alseidon/32/207775_2.png) [@Alseidon](https://discourse.julialang.org/u/Alseidon)\
**Post date:** [July 13, 2024, 6:05pm UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/2 "2024-07-13T18:05:26Z")

</div>

If you push your code to a well-named repo, Franklin has setup a GitHub action for you that will deploy the website. You put all your code on the repo, but the action manages a separate branch with only the website.

I wrote this quick [tutorial](https://alseidon.github.io/walkthrough/website_with_franklin/) when I did it; it’s not great but it’s a start.

(you can also go to my [website’s repo](https://github.com/Alseidon/alseidon.github.io) if you want to check the structure.)

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [July 13, 2024, 6:11pm UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/3 "2024-07-13T18:11:40Z")

</div>

Thanks!

I have the following folder structure:

```julia
ufechner@framework:~/repos/websites$ tree -L 2
.
├── climatejusticesolidarity
│ ├── 404.md
│ ├── _assets
│ ├── config.md
│ ├── _css
│ ├── floods.md
│ ├── index.md
│ ├── _layout
│ ├── _libs
│ ├── menu2.md
│ ├── menu3.md
│ ├── Project.toml
│ ├── README.md
│ ├── _rss
│ ├── _sass
│ ├── __site
│ └── utils.jl
├── Manifest.toml
└── Project.toml

9 directories, 11 files

```

Shall I push the folder `websites` to git, or the folder `climatejusticesolidarity` ?

---

<div class="post-metadata">

**Author:** ![Alseidon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alseidon/32/207775_2.png) [@Alseidon](https://discourse.julialang.org/u/Alseidon)\
**Post date:** [July 13, 2024, 6:20pm UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/4 "2024-07-13T18:20:43Z")

</div>

I’d say you can put only climatejusticesolidarity, I don’t think `Project.toml` is actually used by Franklin.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [July 13, 2024, 6:27pm UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/5 "2024-07-13T18:27:44Z")

</div>

And if I deploy it on github for testing, is there a way to delete it?

Well, Project.toml can freeze the version of Franklin.jl that is used, which might be relevant.

---

<div class="post-metadata">

**Author:** ![Alseidon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alseidon/32/207775_2.png) [@Alseidon](https://discourse.julialang.org/u/Alseidon)\
**Post date:** [July 13, 2024, 6:44pm UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/6 "2024-07-13T18:44:19Z")

</div>

> And if I deploy it on github for testing, is there a way to delete it?

For sure !

> **[Deleting a GitHub Pages site - GitHub Docs](https://docs.github.com/en/pages/getting-started-with-github-pages/deleting-a-github-pages-site)**
>
> You can delete a GitHub Pages site.

> Well, Project.toml can freeze the version of [Franklin.jl](https://juliahub.com/ui/Packages/General/Franklin) that is used, which might be relevant.

Indeed, my bad! Just took a look at `.github/workflows/Deploy.yml`, where there is:

```yaml
    - run: julia -e '
            using Pkg; Pkg.activate("."); Pkg.instantiate();
            using NodeJS; run(`$(npm_cmd()) install highlight.js`);
            using Franklin;
            optimize()'

```

So it uses the `Project.toml` indeed.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [July 13, 2024, 7:22pm UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/7 "2024-07-13T19:22:17Z")

</div>

OK, I tried to deploy to github, something happened, no error message, but it does not look the way it looks when I test it locally: [https://aenarete.github.io/](https://aenarete.github.io/)

Any idea what is going wrong?

This is how it should look:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/c/b/cbfe6bf086f704ae24811aac36a7d59aa3413353.png)

Build log: [initial files · aenarete/aenarete.github.io@0b8182f · GitHub](https://github.com/aenarete/aenarete.github.io/actions/runs/9922257566/job/27411116493)

---

<div class="post-metadata">

**Author:** ![Alseidon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alseidon/32/207775_2.png) [@Alseidon](https://discourse.julialang.org/u/Alseidon)\
**Post date:** [July 13, 2024, 7:41pm UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/8 "2024-07-13T19:41:33Z")

</div>

(I’m no expert, so take everything I say with a grain of salt)

I see that you have two deprecation warnings on the action. Not sure why though, I don’t get these and my `Deploy.yml`, `Project.toml` and `Manifest.toml` are identical to yours…

Could you make a `Franklin.serve()` locally, and compare the files you have in your `__site` directory locally with the files on the remote `ghè-pages` branch?  
(take just one odd-looking page as comparison point)

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [July 13, 2024, 7:59pm UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/9 "2024-07-13T19:59:22Z")

</div>

Check the path to your CSS, that might currently still be wrong, since you work in a subfolder. I can check that more closely somewhen tomorrow, but it seems the path to your css in the main html theme is not correct (probably either due to the subfolder or due to the subdomain).

I think Frankling setup even has a section about it, but I will check tomorrow more closely if you have not solved it by that (was a long day with travels and such).

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [July 13, 2024, 8:21pm UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/10 "2024-07-13T20:21:43Z")

</div>

Is it suggested to install Franklin in the global Julia environment?

Normally I never install packages there apart from TestEnv and Revise…

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [July 14, 2024, 5:29am UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/11 "2024-07-14T05:29:14Z")

</div>

Indeed you don’t want it in the global environment, you can just launch Franklin from the repo’s project (since it has to be installed there)

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [July 14, 2024, 6:40am UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/12 "2024-07-14T06:40:19Z")

</div>

I am sometimes lazy and install Franklin globally, but I would recommend setting up an environment for that.

I checked your code and why the CSS is not found. Your rendered HTML has a code line

```julia
/assets/css/style.css?v=9999407b91cb53fb3aee8b1f3afede4e6257aab8

```

so that is an existing file and seems to work, so could you check the same for the other CSS you load? I would assume that the subdomain might be the problem, because on localhost you do not have that.

The next thing that I find surprising is the `@def title` on the GitHub page – are you sure Frankling runs correctly on CI? Ah it seems Franklin runs according to [Update · aenarete/aenarete.github.io@9999407 · GitHub](https://github.com/aenarete/aenarete.github.io/actions/runs/9922491228/job/27411611896) – so then I am surprised.  
So final thing I see, maybe the last line here [aenarete.github.io/.github/workflows/Deploy.yml at main · aenarete/aenarete.github.io · GitHub](https://github.com/aenarete/aenarete.github.io/blob/main/.github/workflows/Deploy.yml) might need adaption? Do you locally get a `__site` folder when rendering Franklin? (it seems the CI script is a bit newer than the one I use).

or in short: We mainly have to find out which fancy CSS you get locally but not in CI 🙂

_edit_: For the first point with the path, see also [Template not applied to site generated by Franklin.jl - #5 by kellertuer](https://discourse.julialang.org/t/template-not-applied-to-site-generated-by-franklin-jl/87279/5)

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [July 14, 2024, 10:04am UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/13 "2024-07-14T10:04:06Z")

</div>

> [@kellertuer](#):
>
> Do you locally get a `__site` folder when rendering Franklin?

Yes, I do.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [July 14, 2024, 10:07am UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/14 "2024-07-14T10:07:45Z")

</div>

> [@kellertuer](#):
>
> For the first point with the path, see also

I checked that, but it should not apply in my case. The webpage is deployed to

```julia-auto
https://aenarete.github.io/

```

so an empty prepath should be fine. And optimize() is called by [https://github.com/aenarete/aenarete.github.io/actions/runs/9922491228/job/27411611896](https://github.com/aenarete/aenarete.github.io/actions/runs/9922491228/job/27411611896)

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [July 14, 2024, 10:16am UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/15 "2024-07-14T10:16:25Z")

</div>

Then we have to find out why the rendered version on CI still has this line

```julia
@def title = “Climate Justice and Solidarity Kenya/NL” @def tags = [“syntax”, “code”]

```

in its HTML and your local version does not. For me that nearly looks like Franklin not running correctly – and might also be the cause for the missing CSS (which seems to be your custom part?).

Could you maybe compare the locally rendered and the published HTML code and look for more differences?

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [July 14, 2024, 10:20am UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/16 "2024-07-14T10:20:53Z")

</div>

Locally rendered head section:

```julia
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  
   <link rel="stylesheet" href="/libs/highlight/styles/github.min.css">
   
  <link rel="stylesheet" href="/css/franklin.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,400italic|Source+Code+Pro:400,700" type="text/css">
<link rel="stylesheet" href="/css/font-awesome.min.css">
<link rel="stylesheet" href="/css/celeste.min.css">

<link rel="icon" type="image/png" sizes="192x192" href="/assets/favicon.png">
<link rel="shortcut icon" href="/assets/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="/assets/apple-touch-icon.png">

   <title>Climate Justice and Solidarity Kenya/NL</title>  
</head>

```

Head section of published code:

```julia
  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>aenarete - Smart Wind | website</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="aenarete - Smart Wind" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="website" />
<meta property="og:description" content="website" />
<link rel="canonical" href="https://aenarete.github.io/" />
<meta property="og:url" content="https://aenarete.github.io/" />
<meta property="og:site_name" content="aenarete - Smart Wind" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="aenarete - Smart Wind" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"WebSite","description":"website","headline":"aenarete - Smart Wind","name":"aenarete - Smart Wind","url":"https://aenarete.github.io/"}</script>
<!-- End Jekyll SEO tag -->

    <link rel="stylesheet" href="/assets/css/style.css?v=63b187bf429ba8910cd84b1cc3f3447a4d9d91f2">
    <!-- start custom head snippets, customize with your own _includes/head-custom.html file -->

<!-- Setup Google Analytics -->

<!-- You can set your favicon here -->
<!-- link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" -->

<!-- end custom head snippets -->

  </head>

```

What is Jekyll? Is it supposed to be used?  
see: [Setting up a GitHub Pages site with Jekyll - GitHub Docs](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll)

Github is running four jobs:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/6/a/6aee46d48d62ec1ee215ff84351d5a9596135a54.png)

Is this to be expected?

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [July 14, 2024, 10:30am UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/17 "2024-07-14T10:30:50Z")

</div>

To me that looks like GitHub (basically internally with Jekyll) rendering your index.md and not Franklin, as if the gh-pages/deploy from GitHub dies not take the `__site` folder but the markdown files from the main folder. Can you check which branch GitHub publishes?

So one settings → Pages should look something like this (from my Franklin page [GitHub - kellertuer/kellertuer.github.io: My science profile page. Written in Franklin.jl](https://github.com/kellertuer/kellertuer.github.io))

 ![Screenshot 2024-07-14 at 12.32.41](https://global.discourse-cdn.com/julialang/original/3X/f/9/f95fe47718c5d5c2aee25f1e4ff15b317b7f6f0e.png)

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [July 14, 2024, 10:35am UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/18 "2024-07-14T10:35:01Z")

</div>

So no Jekyll would be an alternative to Franklin, so you do not want to follow any Jekyll tutorial here.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [July 14, 2024, 10:37am UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/19 "2024-07-14T10:37:59Z")

</div>

![image](https://global.discourse-cdn.com/julialang/original/3X/b/9/b99555c0225f93235bcf44ea90af721c5c30ada7.png)

OK, I changed that to use the gh-pages branch instead.

UPDATE: This fixed the issue. Thanks a lot for your help!

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [July 14, 2024, 10:45am UTC](https://discourse.julialang.org/t/franklin-jl-and-github/117008/20 "2024-07-14T10:45:49Z")

</div>

As far as I can tell that should help, you might have to retriever it (pushing a commit to master for example). But the default is to render all md-files on master with Jekyll (and what you want is to basically copy gh-pages to deploy instead)

[Next page](https://discourse.julialang.org/t/franklin-jl-and-github/117008.md?page=2)
