NAME
pft - Hacker friendly static blog generator
SYNOPSYS
pft <command> [options]
DESCRIPTION
PFT It is a static website generator written in Perl. PFT stands for Plain F. Text, where the meaning of F is up to personal interpretation. Like Fancy or Fantastic.
Static means that your content is compiled once and the result can be served by a simple HTTP server, without need of server-side dynamic content generation. Actually it doesn't need a server either: you can use it as note-taking application and browse trough your local files.
PFT is designed to be Hacker Friendly: it's a command-line application with unicode support, which handles your website's boilerplate, but stays out of the way. It comes with number of subcommands:
init: Initialize a pft site in the current directory;
edit: Create a content text (e.g. page or blog entry);
make: Build the website;
pub: Publish the website;
clean: Clear built tree;
grab: Grab a file as attachment or picture;
ls: List content and properties;
show: Show the compiled site in a web browser;
help: Show this manual.
The manual of each sub-command is available in form of manpages or by invoking it with the --help
flag.
FILESYSTEM LAYOUT
A new site can be initialized by running the pft init
command inside a directory. In this document such directory will be called ROOT.
The initialization command produces the following filesystem structure:
ROOT
├── pft.yaml - Configuration file
├── content
│ ├── attachments - Location for attachments
│ ├── blog - Root location for blog entries source files
│ ├── pages - Location for pages source files
│ ├── pics - Location for pictures lookup
│ └── tags - Location for tag pages source files
├── build - Location of the built website
├── inject - Content to bulk inject the online site root
└── templates - Location for templates
pft.yaml
: configuration file
The configuration file is created automatically by the pft init
command, and populated with sensible defaults. It is expected to be in YAML format. For more information consult the manual of pft init
.
content
: files generated by the user
This is where your content is stored. The pft edit
and pft grab
commands will add text and binary files respectively in the appropriate subdirectories. The pft make
command will scan the content
directory while building the website.
build
: where the built website is placed
The pft make
command will place the HTML pages resulting from the compilation in this directory. The pft pub
command will publish what here is contained. The pft clean
command will erase it.
inject
: a place for auxiliary files
It's common practice to add files in the root directory of your online website. The pft make
command will add any arbitrary file which is found in the inject
directory to the build
directory after compilation.
A good use case for this feature is the .htaccess
file used by the Apache webserver. Another one is the picture you want to share on the fly with your friend.
templates
: HTML templates for compilation
Each text entry in your content
directory will be mapped by pft make
to an HTML file. The output is created by expanding the content into the structure defined by a template file.
Multiple template files can be stored in the template
directory. Some default files installed by pft init
.
Among other things, the pft.yaml
configuration defines which default template page should be used for the site. Single content entries can override this setting by declaring a different template name in their header. More details about the header can be found in the pft edit
manual page. Templates are documented in the pft make
manual page.