• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

tlienart/Franklin.jl: (yet another) static site generator. Simple, customisable, ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

tlienart/Franklin.jl

开源软件地址:

https://github.com/tlienart/Franklin.jl

开源编程语言:

Julia 100.0%

开源软件介绍:

Franklin: a Static Site Generator in Julia.

Lifecycle Build Status Coverage

Franklin is a simple static site generator (SSG) oriented towards technical blogging (code, maths, ...), flexibility and extensibility. The base syntax is plain markdown with a few extensions such as the ability to define and use LaTeX-like commands in or outside of maths environments and the possibility to evaluate code blocks on the fly.

Franklin has a channel #franklin on the Julia slack, this is the best place to ask usage question.

Note: I'm looking for people with web-dev chops who would be keen to help improve and enrich the base themes available at FranklinTemplates.jl, even if you're not super confident in Julia. More generally, if you would like to work on something or fix something in either Franklin or FranklinTemplates, please reach out on Slack, I will gladly help you get started.

Docs

Go to Franklin's main website. For users already familiar with Franklin you might also find these demos useful. Ifihan Olusheye also wrote this blog on building a blog with Franklin.

Important notes

  • if, upon deployment, your website doesn't seem to apply CSS, you likely forgot a step, please see here.
  • it is currently recommended to switch off pre-rendering and minification (you can do this by passing prerender=false, minify=false to the optimize(...) call in your deploy script), the corresponding logic will be removed in future version of Franklin as it's tricky to maintain and caused too many issues.
  • if you're getting warning messages about some JS library not being found on your computer, you can safely ignore this.

Key features

  • Use standard markdown with the possibility to use LaTeX-style commands and generating functions written in Julia
  • Simple way to introduce div blocks allowing easy styling on a page (e.g. "Theorem" boxes etc.),
  • Can execute and show the output of Julia code blocks,
  • Easy HTML templating to define or adapt a given layout,
  • Custom RSS generation,
  • Simple website optimisation step:
    • compression of HTML and CSS of the generated pages,
    • optional pre-rendering of KaTeX and highlighted code blocks to remove javascript dependency,
  • Extremely flexible and extensible.

See the docs for more information and examples.

Examples

Some examples of websites using Franklin (if you're using Franklin with a public repo, consider adding the "franklin" tag to the repo to help others find examples, thanks!)

Adapted templates (i.e. starting from one of the available themes)

Custom templates (i.e. migrating an existing design)

Getting started

With Julia ≥ 1.3:

pkg> add Franklin

you can then get started with

julia> using Franklin

julia> newsite("MyNewSite")
✔ Website folder generated at "MyNewSite" (now the current directory).
→ Use serve() from Franklin to see the website in your browser.

julia> serve()
→ Initial full pass...
→ Starting the server...
✔ LiveServer listening on http://localhost:8000/ ...
  (use CTRL+C to shut down)

Modify the files in MyNewSite/src and see the changes being live-rendered in your browser. Head to the docs for more information.

You can also start from one of the templates by doing something like:

julia> newsite("MyNewSite", template="vela")

You might want to put the following command in your .bash_profile or .bashrc as a way to quickly launch the server from your terminal:

alias franklin=julia -O0 -e 'using Franklin; serve()'

Heads up!

While Franklin broadly supports standard Markdown there are a few things that may trip you which are either due to Franklin or due to Julia's Markdown library, here are key ones you should keep in mind:

  • when writing a list, the content of the list item must be on a single line (no line break)
  • you can write comments with <!-- comments --> the comment markers <!-- and --> must be separated by a character that is not a - to work properly so <!--A--> is ok but <!---A---> is not, best is to just systematically use a whitespace: <!-- A -->.
  • be careful writing double braces, {{...}} has a meaning (html functions) this can cause issues in latex commands, if you have double braces in a latex command, make sure to add whitespaces for instance write \dfrac{1}{ {101}_{2} } instead of \dfrac{1}{{101}_{2}}. In general use whitespaces liberally to help the parser in math and latex commands.
  • (as of v0.7) code blocks should be delimited with backticks ` you can also use indented blocks to delimit code blocks but you now have to opt in explicitly on pages that would use them by using @def indented_code = true, if you want to use that everywhere, write that in the config.md. Note that indented blocks are ambiguous with some of the other things that Franklin provides (div blocks, latex commands) and so if you use them, you are responsible for avoiding ambiguities (effectively that means not using indentation for anything else than code)

Associated repositories

Licenses

Core:

  • Franklin, FranklinTemplates and LiveServer are all MIT licensed.

External:




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap