Templates for Franklin, the static-site generator in Julia.
Most of these templates are adapted from existing, popular templates with minor modifications to accommodate Franklin's content.
NOTE: these templates should be seen as starting points, they are far from perfect. PRs to help improve them will be very welcome, thanks! Most importantly they are designed to be simple to adjust to your needs.
Get an idea for which template you like using this preview. The grid below keeps track of their name, license, the kind of navbar they have and whether they require Javascript.
Name | Source | License | Navbar | JS |
---|---|---|---|---|
"sandbox" |
N/A | MIT | N/A | No |
"sandbox-extended" |
N/A | MIT | N/A | No |
"basic" |
N/A | MIT | Top | No |
"jemdoc" |
jemdoc | N/A | Side | No |
"hypertext" |
grav theme hypertext | MIT | Top | No |
"pure-sm" |
pure css | Yahoo BSD | Side | No |
"vela" |
grav theme vela | MIT | Side (collapsable) | Yes |
"tufte" |
Tufte CSS, and a bit of Lawler.io for the menu | both MIT | Side | No |
"hyde" |
Hyde | MIT | Side | No |
"lanyon" |
Lanyon | MIT | Side (collapsable) | No |
"just-the-docs" |
Just the docs | MIT | Side/Top | No |
"minimal-mistakes" |
Minimal mistakes | MIT | Side/Top | No |
"celeste" |
Celeste | MIT | Top | No |
"bootstrap5" |
Bootstrap5 | MIT | Top | No |
The package contains a few utils to make it easier to modify or add templates. Now if it was just a bunch of fixes to an existing template, you can just push those changes to your fork and open a PR. If it's a new template that you're working on, you can also do that but there's a few extra things you need to do:
FranklinTemplates/src/FranklinTemplates.jl
add the name of your template in the listFranklinTemplates/docs/make.jl
add the name of your template with a description in the listFranklinTemplates/docs/thumb
add a screenshot of your template in png
format with exactly an 850x850 dimensionFranklinTemplates/docs/index_head.html
add a CSS block following the other examplesTo locally see changes quickly, use Changing a single template. To change all templates at the same time, use Changing multiple templates.
~/.julia/dev/
] dev FranklinTemplates
cd
to a sensible workspace and do one of
using FranklinTemplates; newsite("newTemplate")
to start working on newTemplate
more or less from scratch,using FranklinTemplates; newsite("newTemplate", template="jemdoc")
to start working on newTemplate
using some other template as starting point,using FranklinTemplates; modify("jemdoc")
to quickly start working on an existing template in order to fix it.addtemplate("path/to/your/work")
templates/common/
.~/.julia/dev/
] dev FranklinTemplates
using FranklinTemplates; FranklinTemplates.serve_templates()
Thanks!!
css
, C
, C++
, yaml
, bash
, ini,TOML
, markdown
, html,xml
, r
, julia
, julia-repl
, plaintext
, python
and the minified github
theme).sandbox-extended
): 1.58.4This package contains a copy of the relevant KaTeX files and highlight.js files;
_libs/katex
,highlight.pack.js
file to highlight julia shell and pkg prompt (see next section). You can also download your own version of files from the original source where you might want to
Note: in Franklin's optimize
pass, by default the full library highlight.js
is called to pre-render highlighting; this bypasses the highlight.pack.js
file and, in particular, supports highlighting for all languages. In other words, the highlight.pack.js
file is relevant only when you preview your site locally with serve()
or if you don't intend to apply the prerendering step.
highlight.min.js
, look for julia>
, and replace with something like{name:"Julia REPL",contains:[{className:"meta.prompt",begin:/^julia>/,relevance:10,starts:{end:/^(?![ ]{6})/,
subLanguage:"julia"}},{className:"meta.pkg",begin:/^\(.*\) pkg>/,relevance:10,starts:{end:/^(?![ ]{6})/,
subLanguage:"julia"}},{className:"meta.shell",begin:/^shell>/,relevance:10,starts:{end:/^(?![ ]{6})/,
subLanguage:"julia"}}],aliases:["jldoctest"]}
(copying the case for julia
and adding a case for pkg and for shell, see also the CSS for .hljs-meta.pkg_
etc.)
PlotlyJS
and Hyperscript
installed)include("docs/make.jl")
import LiveServer
LiveServer.serve(dir="docs/build")