Serum

A simple static website generator


Serum v1.2.0 Released

Monday, 5 Aug 2019 Tags: newsrelease

Let me announce the minor update of Serum, Serum v1.2.0!

This update contains several usability and stability improvements, and new features that can add more flexibility to your websites. The notable changes are:

Copying Extra Files to the Website Root

See files directory.

Custom Templates

See Custom Templates.

Custom Page/Post Metadata

Now you can add any key-value metadata to your pages or posts. Suppose that a page has the following header:

---
title: Hello, world!
label: Sample
summary: This is an example page.
magic-number: 42
---

The "summary" and "magic-number" are custom metadata, and they will be exposed through the :extras key, so that you can freely use them anywhere in EEx templates:

%Serum.Page{
  type: :page
  title: "Hello, world!",
  label: "Sample",
  extras: %{
    "summary" => "This is an example page.",
    "magic-number" => "42" # Note that values are always strings.
  },
  ...
}

Here’s the full changelog for Serum v1.2.0. Please enjoy!

Fixed

  • Fixed an issue where the Serum development server crashes if the file system watcher backend is not available on the user’s system. The server will work now, but features related to automatic reloading will be disabled.

  • Now the prompt text (8080>) in the Serum development server CLI will catch up the console output, instead of lagging behind.

  • Updated one of Serum’s dependencies. Users will no longer see strange errors from “Tzdata” once a day.

Improved

  • Serum.File.read/1 now checks if the value of src key in the input struct is nil. An error will be returned if so. Likewise, Serum.File.write/1 checks the value of dest key.

  • Now you can add any user-defined metadata to your pages and posts. Just put some lines like key: value in the header, and these metadata will be available at @page.extras (or @post.extras) in your templates.

Added

  • If you put any extra files and directories in files/ directory, they will be copied to the root of your website. files/ directory is a good place for your favicons, robots.txt, and so on.

  • Added support for custom templates. Pages and blog posts now recognize the template key in their headers.

Changed

  • Docs: Marked some docs for internal modules as hidden, and organized moduledocs by categories. Hidden docs are still accessible via source codes.

  • Overhauled codes which start and stop the Serum development server. The temporary output directory created by the server will now be cleaned up in most exit situations. Additionally, users will be able to see less horrifying error output when the server failed to start.

    For developers: The Serum development server and its command line interface have been decoupled. Starting the server with Serum.DevServer.run/2 does not take you to the command line interface. Instead, you can call Serum.DevServer.Prompt.start/1 to enter the server CLI.

    There are now two ways to get out of the CLI: The quit command stops the development server and returns. If you want to keep the server running, use the detach command. You can later enter the CLI again using the same Serum.DevServer.Prompt.start/1 function.

  • Changed format of the message output, with a new internal module which controls the console output.

  • If there are more than one identical errors, only one of them will be displayed. Usually these errors are from one source and they will be gone all together if one error in the project source gets fixed.