Once you have installed Serum locally in your project, you now have the access to Serum’s functionalities through Mix tasks. Use these Mix tasks to build, test, and manage your Serum project.
All Mix tasks described below may output texts with colors, using ANSI escape sequences, when the standard output is directly connected to a terminal. Use the
--coloroption to let Serum always print colored texts. If you don’t want colored outputs, use the
serum - Prints all Serum Tasks
$ mix serum
This Mix task simply prints a list of all Serum-related Mix tasks currently available. This task does not take any command line argument.
If you want to read the help text for a specific task,
for example, run
mix help serum.build.
serum.new - Creates a New Serum Project
$ mix serum.new [--force] <PATH>
A new Serum project will be created at the given
PATH cannot be
omitted and it must start with a lowercase ASCII letter, followed by zero
or more lowercase ASCII letters, digits, or underscores.
This task will fail if
PATH already exists and is not empty. This behavior
will be overridden if the task is executed with a
This Mix task is not part of Serum; it’s provided by
serum_new package, which
is usually installed in your home directory, to make the task accessible from
Read Project Structure document to see which files and directories are created during the initialization process.
A path where the new Serum project will be created.
Forces the initialization of new project on a non-empty directory. Any existing files may be overwritten without any warning.
serum.new.theme - Creates a New Serum Theme Project
$ mix serum.new.theme [--force] <PATH>
A new Serum theme project will be created at the given
PATH. The required
argument and option are the same as those of
serum.build - Builds the Current Serum Project
$ mix serum.build [(-o|--output) PATH]
The website will be built into
-o(--output) PATH option is given,
If the output directory exists and is not empty, all files and directories
under that directory will be deleted before the build process begins.
However, any files or directories which names start with a dot (
preserved, as they may contain important information such as version
Specifies the output directory. Defaults to
serum.server - Starts the Development Server
$ mix serum.server [(-p|--port) PORT]
This task builds the current Serum project at a temporary directory, and
starts the development server. The server uses the port
8080 by default.
Use a specific port instead of
8080. This is useful when the default port is not available for use.
Once the development server has successfully started, you can interact with the server by typing commands. Available commands are:
build- Rebuilds current project.
open- Opens the website in the default web browser of your desktop environment. This command may not work properly on some rare systems.
quit- Stops the development server and quit.
You can also send EOF to stop the server, by pressing Ctrl + D on UNIX-based systems.
Please make sure you type the
quitcommand to stop the development server. Pressing Ctrl + C causes unclean exit, leaving the temporary directory not removed.
serum.gen.page - Adds a New Page
$ mix serum.gen.page (-t|--title) TITLE (-o|--output) OUTPUT [Options]
Title of the new page.
The path where the new page will be saved, relative to
pages/directory. It must end with one of
Label of the new page. Defaults to the page title.
Name of a group the new page belongs to.
The order of the new page in a group. Defaults to
serum.gen.post - Adds a New Blog Post
$ mix serum.gen.post (-t|--title) TITLE (-o|--output) OUTPUT [Options]
Post date will be automatically set to the moment this task is executed.
Title of the new blog post.
Name of the generated post file. The actual path to the generated file will be in the form of
Tag(s) of the new post. You can provide this option zero or more times to give multiple tags to the post.