BLOGC(1)
π NAME π
blogc β literally a blog compiler, bestie. that's the whole vibe. π«Ά
β¨ SYNOPSIS β¨
blogc [-d] [-D KEY=VALUE ...] -t TEMPLATE [-o OUTPUT] SOURCE
blogc -l [-e SOURCE] [-d] [-D KEY=VALUE ...] -t TEMPLATE [-o OUTPUT]
[SOURCE ...]
blogc -l [-e SOURCE] [-d] [-D KEY=VALUE ...] -t TEMPLATE [-o OUTPUT]
[SOURCE ...]
blogc -l [-e SOURCE] -p KEY [-d] [-D KEY=VALUE ...] [SOURCE ...]
blogc -i [-d] [-D KEY=VALUE ...] -t TEMPLATE [-o OUTPUT] < FILE_LIST
blogc -i -l [-e SOURCE] [-d] [-D KEY=VALUE ...] -t TEMPLATE [-o OUTPUT]
< FILE_LIST
blogc -i -l [-e SOURCE] -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 [-e SOURCE] [-d] [-D KEY=VALUE ...]
-t TEMPLATE [-o OUTPUT]
echo -e "SOURCE\n..." | blogc -i -l [-e SOURCE] -p KEY [-d] [-D
KEY=VALUE ...]
blogc [-h|-v]
okay so that's a LOT of shapes this command can take, and honestly? iconic of it. π
πΈ DESCRIPTION πΈ
So blogc compiles source files and templates into blog/website resources. It grabs one (or more) source files plus 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:
entryβ the default mode, first example in SYNOPSIS. Accepts only one source file, and processes it as a single entry of the blog/website, like a static page or a post. πlistingβ listing mode, second example in SYNOPSIS, activated when callingblogcwith the-loption. Accepts multiple source files, and allows users to iterate over the content of all the source files to produce listing pages, like indexes and feeds. By providing another source file toblogcwith the-eoption β third example in SYNOPSIS β its content will be available for usage during listing, similar to the default entry mode. This is useful for users that want to have an index page with content and posts listing together. Seeblogc-template(7)for details. π¦
π OPTIONS π
-dβ Activates debug. π (not me debugging, never me debugging, okay maybe sometimes me debugging)-iβ 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. π-lβ Activates listing mode, allowing user to provide multiple source files. Seeblogc-source(7)for details. π-e SOURCEβ When used together with-lthe source file will be parsed and its content will be made available for usage in the templates in listing mode vialisting_entryblocks. This option can be used more than once, so users can have more than onelisting_entryblock in the same template. Passing an empty string will skip thelisting_entryblock. Seeblogc-template(7)for details. π-D KEY=VALUEβ Set global configuration parameter.KEYmust 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. Seeblogc-template(7)for details. ποΈ-p KEYβ Show the value of a variable right after the source parsing and exits. This is useful to get parameters for yourMakefile, like the last page when implementing pagination, seeblogc-pagination(7)for details. This option can also dump variables defined in a source file, if called without-l. π-t TEMPLATEβ Template file. It is a required option, ifblogcneeds to render something. Seeblogc-template(7)for details. π-o OUTPUTβ Output file. If provided this option, save the compiled output to the given file. Otherwise, the compiled output is sent to stdout. π€-vβ Show program name, version and exit. π·οΈ-hβ Show help message and exit. π
π FILES π
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 exceptions bestie, UTF-8 or nothing π
π§ ENVIRONMENT π§
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). π
π₯ EXAMPLES π₯
Build index from source files:
$ blogc -l -t template.tmpl -o index.html source1.txt source2.txt source3.txt
Build index from source files, with additional content from index.txt:
$ blogc -l -e index.txt -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
ate. no crumbs. π
π BUGS π
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
not me personally attacking the parsers, i would never, they're doing their best, but fr fr if something breaks, tell the devs π
π AUTHOR π
Rafael G. Martins <rafael@rafaelmartins.eng.br> β the main character, honestly π
π SEE ALSO π
blogc-source(7), blogc-template(7), blogc-pagination(7) make(1), strftime(3)
and that's the whole page, bestie!! this one's from the blogc Manual, written by Rafael G. Martins, dated January 2025. go build something gorgeous with it, you got this πβ¨π
π¦ where this page comes from
- fedora 43: blogc 0.20.1^20240602.b1ae9c9-1.fc42 Β· BSD-3-Clause AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms