All Projects → cryogen-project → Cryogen

cryogen-project / Cryogen

Licence: epl-1.0
A simple static site generator written in Clojure

Programming Languages

clojure
4091 projects

Projects that are alternatives of or similar to Cryogen

Microsite
Do more with less JavaScript. Microsite is a smarter, performance-obsessed static site generator powered by Preact and Snowpack.
Stars: ✭ 632 (-30.85%)
Mutual labels:  static-site-generator
Prerender Spa Plugin
Prerenders static HTML in a single-page application.
Stars: ✭ 7,018 (+667.83%)
Mutual labels:  static-site-generator
Middleman
Hand-crafted frontend development
Stars: ✭ 6,812 (+645.3%)
Mutual labels:  static-site-generator
Forty Jekyll Theme
A Jekyll version of the "Forty" theme by HTML5 UP.
Stars: ✭ 695 (-23.96%)
Mutual labels:  static-site-generator
Zola
A fast static site generator in a single binary with everything built-in. https://www.getzola.org
Stars: ✭ 7,823 (+755.91%)
Mutual labels:  static-site-generator
Jbake
Java based open source static site/blog generator for developers & designers.
Stars: ✭ 904 (-1.09%)
Mutual labels:  static-site-generator
Headlesscms.org
Source for headlesscms.org
Stars: ✭ 628 (-31.29%)
Mutual labels:  static-site-generator
Jekyll Scholar
jekyll extensions for the blogging scholar
Stars: ✭ 872 (-4.6%)
Mutual labels:  static-site-generator
Couscous
Couscous is good.
Stars: ✭ 807 (-11.71%)
Mutual labels:  static-site-generator
Cobalt.rs
Static site generator written in Rust
Stars: ✭ 940 (+2.84%)
Mutual labels:  static-site-generator
Portray
Your Project with Great Documentation.
Stars: ✭ 726 (-20.57%)
Mutual labels:  static-site-generator
Solo
🎸 B3log 分布式社区的 Java 博客端节点系统,欢迎加入下一代社区网络。B3log distributed community blog-end node system, welcome to join the next generation community network.
Stars: ✭ 780 (-14.66%)
Mutual labels:  static-site-generator
Awesome Gatsby
⚛️ 📄 🚀 Awesome list for the mighty Gatsby.js, a blazing fast React static site generator.
Stars: ✭ 928 (+1.53%)
Mutual labels:  static-site-generator
Sigal
yet another simple static gallery generator
Stars: ✭ 682 (-25.38%)
Mutual labels:  static-site-generator
Drfrederson
static website generator powered by PHP, YAML, Markdown and mustache
Stars: ✭ 9 (-99.02%)
Mutual labels:  static-site-generator
Wowchemy Hugo Modules
🔥 Hugo website builder, Hugo themes & Hugo CMS. No code, build with widgets! 创建在线课程,学术简历或初创网站。
Stars: ✭ 6,093 (+566.63%)
Mutual labels:  static-site-generator
Nextein
A static site generator with markdown + react for Next.js
Stars: ✭ 825 (-9.74%)
Mutual labels:  static-site-generator
Jmmasw
Just make me a static website
Stars: ✭ 13 (-98.58%)
Mutual labels:  static-site-generator
Generator Infinitely Static
💫 Static page generator with routes support thats infinitely awesome
Stars: ✭ 11 (-98.8%)
Mutual labels:  static-site-generator
Thenewdynamic.org
Resources for Designers and Developers using the JAMstack
Stars: ✭ 24 (-97.37%)
Mutual labels:  static-site-generator

 

This ReadMe only documents a subset of Cryogen's features. For additional documentation please see the cryogen site.

 

Features

  • Blog posts and pages with Markdown (default) or AsciiDoc
  • Tags
  • Table of contents generation
  • Plain HTML page templates
  • Code syntax highlighting
  • Disqus support
  • Sitemap generation
  • RSS feed generation
  • Sass/SCSS compilation
  • Klipse Integration

Prerequisites

You will need Leiningen 2.5.0 or above installed.

Usage

Creating a New Site

A new site can be created using the Cryogen template as follows:

lein new cryogen my-blog

or, alternatively, using clj-new (and having defined the new profile, as it suggests):

clojure -X:new create :template cryogen :name me.my-blog

Running the Server

The web server can be started from the my-blog directory using either Leiningen:

lein serve # or lein serve-fast

or tools-deps:

clojure -X:serve # or clojure -X:serve-fast

The server will watch for changes in the content and themes folders and recompile the content automatically. The *-fast variants perform fast but partial compilation of only the changed page/post.

You can also generate the content without bringing up a server either via:

lein run

or via:

clojure -M:build

Site Configuration

The site configuration file is found at content/config.edn, this file looks as follows:

{:site-title                   "My Awesome Blog"
 :author                       "Bob Bobbert"
 :description                  "This blog is awesome"
 :site-url                     "http://blogawesome.com/"
 :post-root                    "posts"
 :page-root                    "pages"
 :post-root-uri                "posts-output"
 :page-root-uri                "pages-output"
 :tag-root-uri                 "tags-output"
 :author-root-uri              "authors-output"
 :public-dest                  "public"
 :blog-prefix                  "/blog"
 :rss-name                     "feed.xml"
 :rss-filters                  ["cryogen"]
 :recent-posts                 3
 :post-date-format             "yyyy-MM-dd"
 :archive-group-format         "yyyy MMMM"
 :sass-src                     []
 :sass-path                    "sass"
 :theme                        "blue"
 :resources                    ["img"]
 :keep-files                   [".git"]
 :disqus?                      false
 :disqus-shortname             ""
 :ignored-files                [#"\.#.*" #".*\.swp$"]
 :previews?                    false
 :posts-per-page               5
 :blocks-per-preview           2
 :clean-urls                   :trailing-slash
 :collapse-subdirs?            false
 :hide-future-posts?           true
 :klipse                       {}
 :description-include-elements #{:p :h1 :h2 :h3 :h4 :h5 :h6}
 :debug?                       false}

For information about each key please see the "Configuration" portion of the Cryogen documentation site.

Switching between Markdown and AsciiDoc

Cryogen comes with Markdown support as default. If you want to use AsciiDoc instead, open the project.clj in your created blog (e.g. my-blog), and change the line in :dependencies that says cryogen-flexmark to cryogen-asciidoc (and ensure the right version). Instead of looking for files ending in .md in the content/md directory, the compiler will now look for files ending in .asc in the content/asc directory.

Selecting a Theme

The Cryogen template comes with three themes in the themes folder. To change your blog's theme, change the value of the :theme key in config.edn. Note that the Nucleus theme is obtained from downloadwebsitetemplates.co.uk that requires you to keep the footer, unless you make a donation on their website.

Customizing Layouts

Cryogen uses Selmer templating engine for layouts. Please refer to its documentation to see the supported tags and filters for the layouts.

The layouts are contained in the themes/{theme}/html folder of the project. By default, the base.html layout is used to provide the general layout for the site. This is where you would add static resources such as CSS and JavaScript assets as well as define headers and footers for your site.

Each page layout should have a name that matches the :layout key in the page metadata and end with .html. Page layouts extend the base layout and should only contain the content relaveant to the page inside the content block. For example, the tag layout is located in tag.html and looks as follows:

{% extends "/html/base.html" %}
{% block content %}
<div id="posts-by-tag">
    <h2>Posts tagged {{name}}</h2>
    <ul>
    {% for post in posts %}
        <li>
            <a href="{{post.uri}}">{{post.title}}</a>
        </li>
    {% endfor %}
    </ul>
</div>
{% endblock %}

Code Syntax Highlighting

Cryogen uses Highlight.js for code syntax highlighting. You can add more languages by replacing themes/{theme}/js/highlight.pack.js with a customized package from here.

The initHighlightingOnLoad function is called in themes/{theme}/html/base.html.

<script>hljs.initHighlightingOnLoad();</script>

Deploying Your Site

The generated static content will be found under the public folder. Simply copy the content to a static folder for a server such as Nginx or Apache and your site is now ready for service.

A sample Nginx configuration that's placed in /etc/nginx/sites-available/default can be seen below:

server {
  listen 80 default_server;
  listen [::]:80 default_server ipv6only=on;
  server_name localhost <yoursite.com> <www.yoursite.com>;

  access_log  /var/log/blog_access.log;
  error_log   /var/log/blog_error.log;

  location / {
    alias       /var/blog/;
    error_page  404 = /404.html;
  }
}

Simply set yoursite.com to the domain of your site in the above configuration and ensure the static content is available at /var/blog/. Finally, place your custom error page in the /var/blog/404.html file.

More information on deployment can be found here.

Third Party Libraries

https://github.com/greywolve/cryogen-markdown-external

A Clojure library to provide Markdown rendering to the cryogen-core compiler by using an external command/program, such as pandoc.

Some Sites Made With Cryogen

License

Copyright © 2014-2020 Carmen La

Distributed under the Eclipse Public License, the same as Clojure.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].