clojure icon indicating copy to clipboard operation
clojure copied to clipboard

Static websites in Clojure

Open practicalli-johnny opened this issue 5 years ago • 0 comments

Clojure tools for generating static websites, such as blogs but also multi-page workhops, tutorials and books such as Practicalli Clojure.

Review available projects in Clojure
Do any projects meet the requirements, especially as a replacement for GitBook which is used to generate the Practicalli series of books.

Requirements:

  • simple way to define navigation, perhaps edn (bonus: using or reading in summary.md files)
  • high quality code syntax highlighting (as good as a Clojure editor)
  • live code option (e.g. klipse but with a choice between Clojure and ClojureScript backend so that examples are not limited by the host environment, something more responsive than repl.it)
  • placeholders and template support
  • stylised layout, grid or flex support for multiple components
  • responsive design, works across devices with no special customization for each type of device

Useful articles https://www.mxmmz.nl/blog/building-a-website-with-babashka.html https://cjohansen.no/building-static-sites-in-clojure-with-stasis/ https://hackeryarn.com/post/why-i-built-a-static-site-in-clojure/ https://juxt.pro/blog/babashka https://github.com/theiceshelf/firn https://firn.theiceshelf.com/getting-started https://www.reddit.com/r/Clojure/comments/hp6swk/firn_a_static_site_generator_for_org_mode_in/ Promising although org mode files rather than .md files (would be good for new books, need some converting for existing books.

https://cryogenweb.org/ (currently used for Practicalli blog website) https://github.com/hashobject/perun https://nakkaya.com/static.html https://cjohansen.no/building-static-sites-in-clojure-with-stasis https://github.com/magnars/stasis https://groups.google.com/d/msg/clojure/orjvY1N_HSA/tNBAMHrQBgAJ http://nickgeorge.net/programming/building-my-static-clojure-website/

Data science stuff https://www.reddit.com/r/Clojure/comments/bwnrfi/oz_static_site_generation_with_live_code_reloading/

Using Babashka

https://cljdoc.org/d/borkdude/babashka Using a script is a feasible and possibly lightweight approach to generating static websites. Babashka has recently added a webserver, so might also be used to spin up a local live preview of the site with live reload on changes

Example of babashka as a script https://www.mxmmz.nl/blog/building-a-website-with-babashka.html https://github.com/retrogradeorbit/bootleg - a command line tool for generating static sites. Can this be used as a library too?

Going beyond a static site generator

Given a fixed set of options, generate a custom version of that content. For example, specifying operating system would show only those parts relevant to the specific OS. Specifying which Clojure tool or editor would show content specific to that and remove irrelevant content.

Discussions https://www.reddit.com/r/Clojure/comments/9g68n4/here_is_why_i_built_a_static_site_in_clojure/

practicalli-johnny avatar Jul 10 '20 18:07 practicalli-johnny