[ANN] Franklin 0.6 (static site generator)

I’m happy to announce the release of Franklin.jl 0.6 (feu JuDoc.jl), a static site generator (SSG) in Julia. Franklin’s new documentation site is written in itself which should hopefully give you an idea of what you can do with it as well as how to do it.

If you hadn’t heard of Franklin/JuDoc you may want to read the second “Brief intro” point.

News

  • there’s now a slack channel: #franklin please join if you would like to give Franklin a shot,
  • the deployment on GitHub and GitLab is automated using Github action and GitLab CI respectively,
  • each page with Julia code is now effectively considered as a module meaning that code evaluation is (much) more robust and reliable than it used to be
  • the folder structure is now such that URLs don’t contain a pesky /pub/ in them,
  • a ton of minor fixes to make users’ experience more robust, thanks to all those who’ve raised issues and made suggestions (in particular @cormullion and @cserteGT3)

Brief intro

Franklin aims to be a simple SSG geared towards technical blogging. Like any basic SSG it takes some markdown files and converts it into HTML which can then be deployed (e.g. on GitHub or GitLab). Here are four key reasons why you may want to try it out even though there are many well established SSGs out there such as Hugo or Jekyll:

  • Franklin supports KaTeX and highlight.js out of the box, optional automatic pre-rendering for javascript-free deployment, generated pages are automatically minified upon deployment,
  • handles hyper-references like in LaTeX (to equations and bibrefs),
  • you can define “commands” for any repetitive elements in your markdown; the syntax is inspired from LaTeX; this can help you style your website in a simple and maintainable way,
  • you can run Julia code at build-time and either just show the output or further reprocess it using Franklin (for instance you can use that to insert interactive Plotly plots on a page),

With a bit of practice the last two points can be combined in pretty powerful ways, here are some examples. It also works seamlessly with Literate.jl which helps greatly when writing a tutorials website. For instance cormullion’s blog uses Franklin+Literate.

If you want to get a quick idea for how things work, add Franklin and, somewhere appropriate, do:

julia> using Franklin
julia> newsite("test-site", template="basic");
✓ Website folder generated at "test-site" (now the current directory).
→ Use serve() from Franklin to see the website in your browser.

julia> serve()
→ Initial full pass...
→ evaluating code [...] (menu1.md)                                              → Starting the server...
✓ LiveServer listening on http://localhost:8000/ ...
  (use CTRL+C to shut down)

Then head to an editor and modify test-site/index.md while looking at localhost:8000/ for the result :slight_smile:

32 Likes