Tclssg

screenshot of Tclssg

Tclssg

A static site generator

Overview

Tclssg is a full-featured extensible static site generator written in Tcl. Its main purpose is to simplify the management of static websites, including optional blogs. The tool is primarily designed for Tcl programmers and is best suited for websites with a page count under 1000. Tclssg utilizes Markdown for content formatting, Bootstrap 3 for layout (with Bootstrap theme support), and Tcl code embedded in HTML for templating. It offers features like footnotes, blog post feeds in various formats (RSS, JSON Feed, and twtxt), SEO and usability enhancements, valid HTML5 and CSS level 3 output, support for external comment engines (e.g., Disqus), relative links in HTML output, and legacy deployment over FTP. Tclssg is reasonably fast and has minimal dependencies. Experimental self-contained binaries are available for Linux, Windows, and Mac.

Features

  • Markdown, Bootstrap themes, and Tcl code for templates: Tclssg supports formatting content using Markdown syntax along with customizable Bootstrap themes. The inclusion of Tcl code in HTML templates allows for flexible customization.
  • Regular pages and blog posts: Tclssg enables the creation of both regular pages and blog posts. Blog posts have a sidebar with tags and links to other blog posts, sorted by recency. The latest blog posts are featured on the blog index, and tag pages are generated to collect blog posts with the same tag.
  • Footnotes: Tclssg provides support for footnotes, allowing users to add additional information or references within their content.
  • New blog post feeds: Tclssg generates feeds for new blog posts in various formats such as RSS, JSON Feed, and twtxt, making it easy for readers to stay updated.
  • SEO and usability features: Tclssg includes built-in features that enhance Search Engine Optimization (SEO) and usability of the generated websites. This includes generating site maps, canonical links, previous/next page links, and noindex tags on collection pages.
  • Valid HTML5 and CSS level 3 output: The output generated by Tclssg adheres to standards-compliant HTML5 and CSS level 3.
  • Legacy deployment over FTP: Tclssg provides support for legacy deployment over FTP, allowing users to easily publish their websites to FTP servers.
  • Deployment over SCP or other protocols: Users can deploy their websites using SCP or other protocols by setting up a custom deployment command.
  • Support for external comment engines: Tclssg integrates with external comment engines, with Disqus being the supported option at present.
  • Relative links in HTML output: The HTML output generated by Tclssg includes relative links, making it suitable for viewing locally over the file:// protocol.
  • Reasonably fast: Tclssg is designed to be reasonably fast and can build websites with a few hundred pages in under a minute on modest hardware.
  • Few dependencies: Tclssg has minimal dependencies, making it easy to set up and use. Experimental self-contained binaries are available for Linux, Windows, and Mac.

Installation

To use Tclssg, you need to have Tcl 8.5 or newer, Tcllib, and SQLite version 3 bindings for Tcl installed. Tidy-html5 is an optional dependency for making the generated HTML prettier. Here are the installation steps for different platforms:

Linux/Debian/Ubuntu:

sudo apt-get install tcl tcllib libsqlite3-tcl
sudo apt-get install tidy-html5  # Optional dependency

Fedora/RHEL/CentOS:

sudo dnf install tcl tcllib sqlite-tcl
sudo dnf install tidy-html5  # Optional dependency

Windows:

The recommended way to run Tclssg on Windows 7 and later is to install Magicsplat Tcl/Tk for Windows. Note that the Tcl distribution that comes with Git for Windows does not include Tcllib or SQLite 3 module.

macOS:

On macOS, you can use MacPorts or install ActiveTcl for Mac. To install using MacPorts:

sudo port install tcl tcllib sqlite3
sudo port install tidy-html5  # Optional dependency

Once you have the necessary dependencies installed, you can proceed with the following steps:

  1. Clone the Tclssg repository.
  2. Navigate into the cloned directory.
  3. Run the following command:
make init
  1. On Windows, use the following command instead:
tclsh scripts/build.tcl

This will create a new website project in the website/ directory based on the default project skeleton, build the website in website/output/, and open the result in your web browser.

Summary

Tclssg is a versatile static site generator built for Tcl programmers. It offers a range of features such as Markdown content formatting, Bootstrap theme support, and embedded Tcl code for templates. Tclssg simplifies the management of static websites, including the option to add a blog with features like footnotes, blog post feeds, SEO enhancements, customizable themes, and more. It produces valid HTML5 and CSS level 3 output and can be deployed using various protocols. Tclssg is reasonably fast, has minimal dependencies, and provides experimental self-contained binaries for different operating systems. With its ease of installation and powerful features, Tclssg is a valuable tool for developers looking to create and maintain static websites efficiently.