1. blogc(1)
  2. blogc Manual
  3. blogc(1)


blogc - a blog compiler


blogc [-d] [-D KEY=VALUE ...] -t TEMPLATE [-o OUTPUT] SOURCE
blogc -l [-d] [-D KEY=VALUE ...] -t TEMPLATE [-o OUTPUT] [SOURCE ...]
blogc -l -p KEY [-d] [-D KEY=VALUE ...] [SOURCE ...]
blogc -i [-d] [-D KEY=VALUE ...] -t TEMPLATE [-o OUTPUT] < FILE_LIST
blogc -i -l [-d] [-D KEY=VALUE ...] -t TEMPLATE [-o OUTPUT] < FILE_LIST
blogc -i -l -p KEY [-d] [-D KEY=VALUE ...] < FILE_LIST
echo -e "SOURCE\n..." | blogc -i [-d] [-D KEY=VALUE ...] -t TEMPLATE [-o OUTPUT]
echo -e "SOURCE\n..." | blogc -i -l [-d] [-D KEY=VALUE ...] -t TEMPLATE [-o OUTPUT]
echo -e "SOURCE\n..." | blogc -i -l -p KEY [-d] [-D KEY=VALUE ...]
blogc [-h|-v]


blogc compiles source files and templates into blog/website resources. It gets one (or more) source files and a template, and generates an output file, based on the template and the content read from the source file(s). It was designed to be used with make(1).

blogc works on two modes:


Default mode, first example in SYNOPSIS. Accepts only one source file, and process it as a single entry of the blog/website, like a static page or a post.


Listing mode, second example in SYNOPSIS, activated when calling blogc with -l option. Accepts multiple source files, and allow users to iterate over the content of all the source files to produce listing pages, like indexes and feeds.



Activates debug.


Reads list of source files from standard input. Content of standard input is parsed as a file where each line is a file path. Empty lines and lines starting with # are ignored. If some source files are provided to command line while using this option, they will be parsed before the files read from standard input.


Activates listing mode, allowing user to provide multiple source files. See blogc-source(7) for details.


Set global configuration parameter. KEY must be an ascii uppercase string, with only letters, numbers (after the first letter) and underscores (after the first letter). These parameters are available anywhere in templates, but may be overridden by local configuration parameters set in source files. See blogc-template(7) for details.

-p KEY

Show the value of a global configuration parameter right after the source parsing and exits. This is useful to get parameters for your Makefile, like the last page when using pagination, see blogc-pagination(7) for details.


Template file. It is a required option, if blogc needs to render something. See blogc-template(7) for details.


Output file. If provided this option, save the compiled output to the given file. Otherwise, the compiled output is sent to stdout.


Show program name, version and exit.


Show help message and exit.


The blogc command expects a template file blogc-template(7), one (or more) source files blogc-source(7) and an output file, if wanted. Templates and source files must have valid UTF-8 content.


No environment variables are required by blogc, but global timezone will be used by locale-dependant datetime input field descriptors (like %c), and can be overridden using environment variables. See strftime(3).


Build index from source files:

$ blogc -l -t template.tmpl -o index.html source1.txt source2.txt source3.txt

Build entry page from source file:

$ blogc -t template.tmpl -o entry.html entry.txt


blogc is based in handwritten parsers, that even being well tested, may be subject of parsing bugs. Please report any issues to: https://github.com/blogc/blogc


Rafael G. Martins <rafael@rafaelmartins.eng.br>


blogc-source(7), blogc-template(7), blogc-pagination(7) make(1), strftime(3)

  1. Rafael G. Martins
  2. August 2018
  3. blogc(1)