Home

Awesome

Franklin Templates

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.

List of templates

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.

NameSourceLicenseNavbarJS
"sandbox"N/AMITN/ANo
"sandbox-extended"N/AMITN/ANo
"basic"N/AMITTopNo
"jemdoc"jemdocN/ASideNo
"hypertext"grav theme hypertextMITTopNo
"pure-sm"pure cssYahoo BSDSideNo
"vela"grav theme velaMITSide (collapsable)Yes
"tufte"Tufte CSS, and a bit of Lawler.io for the menuboth MITSideNo
"hyde"HydeMITSideNo
"lanyon"LanyonMITSide (collapsable)No
"just-the-docs"Just the docsMITSide/TopNo
"minimal-mistakes"Minimal mistakesMITSide/TopNo
"celeste"CelesteMITTopNo
"bootstrap5"Bootstrap5MITTopNo

Modifying or adding a template

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:

  1. in FranklinTemplates/src/FranklinTemplates.jl add the name of your template in the list
  2. in FranklinTemplates/docs/make.jl add the name of your template with a description in the list
  3. in FranklinTemplates/docs/thumb add a screenshot of your template in png format with exactly an 850x850 dimension
  4. in FranklinTemplates/docs/index_head.html add a CSS block following the other examples

To locally see changes quickly, use Changing a single template. To change all templates at the same time, use Changing multiple templates.

Changing a single template

  1. clone a fork of this package wherever you usually do things, typically ~/.julia/dev/
  2. checkout the package in development mode with ] dev FranklinTemplates
  3. cd to a sensible workspace and do one of
    1. using FranklinTemplates; newsite("newTemplate") to start working on newTemplate more or less from scratch,
    2. using FranklinTemplates; newsite("newTemplate", template="jemdoc") to start working on newTemplate using some other template as starting point,
    3. using FranklinTemplates; modify("jemdoc") to quickly start working on an existing template in order to fix it.
  4. change things, fix things, etc.
  5. bring your changes into your fork with addtemplate("path/to/your/work")
    1. if the template doesn't exist, it will just add the folder removing things that are duplicate from templates/common/.
    2. if the template exists, it will just adjust what needs to be adjusted.

Changing multiple templates

  1. clone a fork of this package wherever you usually do things, typically ~/.julia/dev/
  2. checkout the package in development mode with ] dev FranklinTemplates
  3. start serving the preview website with using FranklinTemplates; FranklinTemplates.serve_templates()

Thanks!!

Misc

Notes

This package contains a copy of the relevant KaTeX files and highlight.js files;

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.

Maintenance

{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.)

Testing before release

include("docs/make.jl")
import LiveServer
LiveServer.serve(dir="docs/build")