Package: pyblog
A lightweight python static blog generator - 0.6.3InstallationThe simplest way to install PyBlog is through one of the Python package
managers,pipandeasy_install:$[sudo]pipinstallpyblog$[sudo]easy_installpyblogAlternatively, you can download or clone this repository, and install
the tool manually:$gitclonehttps://github.com/cesarparent/pyblog.git$pythonsetup.pyinstallCreating a BlogThe first step in setting up a PyBlog blog is to create the directory
structure. You can do this by callingpyblog new:$mkdirnew-blog&&cdnew-blog$pyblognew.# or...$pyblognewnew-blog&&cdnew-blogThe tool will create the following directory structure, along with the
PyBlog configuration file:|_  _pages/
|_  _posts/
|_  _static/
|_  _templates/
|_  config.txt_pagescontains any file that you’d like PyBlog to process and
potentially run through templates. It will keep the same filename and
be placed at the root of the generated blog (for example, the index &
about pages, or an RSS feed)._postscontains your posts. They should be.txtfiles, and
can contain any kind of content (at the moment, the only content
filter available to templates ismarkdown)._staticcontains any file you want to be copied without any
tampering to the output directory (images, CSS and the likes)_templatescontains your Jinja2 template files. Any file present
in the directory is available for posts and pages to use.Once the blog is set up and you’ve written some post, the blog is
generated by calling:$pyblogbuild[-s/source][-d/destination]...If you want PyBlog to re-generate your blog every time a file changes in
the source directory, you can add the--watchflag. You can also
spawn a local development server with:$pyblogserve[-s/source][-d/destination][-Hhost][-Pport]By default, your blog is available athttp://localhost:4000. When
running the development server,--watchis enabled.Writing PostsPosts are simple, static plain-text files with a HTTP headers-based
metadata section:title: Some great post
date: 2016-09-07 14:00:00
template: post.html

Hey! This is a post written for the PyBlog demo.titleandtemplateare required. Title is used to generate the
post’s final URL/filename, and template indicates which template file
should be used for rendering. Ifdateis not specified, the file’s
last-modified date is used.Writing PagesPages follow exactly the same model. If thetemplatefield is
omitted, the contents of the file will just be output “as is”. If a page
has no metadata section, it will be rendered without a template. Pages
can contain any Jinja2 template code.Template ObjectsEvery template gets passed ablogobject on rendering, which
contains the following fields:fielddescriptionnameThe blog’s name, as specified inconfig.txttaglineThe blog’s tagline, as specified inconfig.txtroot_urlThe blog’s root url, as specified inconfig.txtget_posts()The blog’s posts, in reverse-chronological orderget_pages()The blog’s pages, in reverse-chronological orderWhen rendering a post or a page, apostobject is also available:fielddescriptiontitleThe post’s titleslugFor post’s, a url-safe title, for pages the filenameurlThe post’s url relative to the blog’s rootdateThe post’s publication datecontentThe post’s content