Frequently Asked Questions December 10, 2015

Frequently Asked Questions

About authoring

How do I specify the date of the post?

In the post configuration section, set the timestamp key. It must match the format from config.yaml - timestamp_format.

Example

[[
title: My Post
tags: [stuff, moar stuff]
timestamp: 2013-11-13 21:14
]]

See: Post Data Block for more information.

How do I set a list of posts as my homepage?

To set your home page to posts.html change config.yaml -> home_page to the following:

...
home_page: posts.html
...

About theming

What theme templates are required?

The required templates and files for a theme can be found under theme directory structure on the Creating Themes page.

About configuring

What does a project directory look like?

You should checkout Getting Started, but it basically looks like this:

MyProject/
    links.yaml
    config.yaml
    social.yaml
    source/
    docroot/
    themes/

What webservers work with PyKwiki?

Any webserver that serves static files should work with PyKwiki. Two popular choices include Apache2 and Nginx.

What versions of Python work with PyKwiki?

PyKwiki officially works with the following versions:

  • Python == 2.7
  • Python >= 3.3

Python 3.2 is not supported because the Jinja2 2.6 package does not support Python 3.2. Because PyKwiki requires Jinja2, there is no way around this.

Python 3.2 will not work

...
PyKwiki Command Line December 10, 2015

Basic Usage

usage: pykwiki [-h] [-b BASE_PATH] [-c CONFIG_FILE]
               {new,index,cache,info,theme} ...

positional arguments:
  {new,index,cache,info,theme}
    new                 create a new project
    index               build the search index
    cache               cache and index posts
    info                display PyKwiki information
    theme               control built-in themes

optional arguments:
  -h, --help            show this help message and exit
  -b BASE_PATH, --base-path BASE_PATH
                        the base directory to operate on, defaults to current
                        directory
  -c CONFIG_FILE, --config-file CONFIG_FILE
                        full path to configuration YAML file to load

Cache posts

Quick caching

Quick caching only changes the content of your pages. It does not rebuild the search index, post lists (/posts.html), cache uploads, or build the site menu.

$ pykwiki -c /path/to/my/config.yaml cache -q

Forced caching

Forced caching without the -q flag rebuilds everything. It caches all posts, uploads, menus, and theme templates.

$ pykwiki -c /path/to/my/config.yaml cache -f

Forced caching with the -q flag caches every post, but it skips the search index, uploads, and theme files.

$ pykwiki -c /path/to/my/config.yaml cache -qf

Smart caching

Using the cache command by itself causes PyKwiki to attempt to detect changes and rebuild what is necessary to update your site. It rebuilds menus if links.yaml has been modified, it caches theme files if it detects at least one updated post, and it caches all modified posts.

$ pykwiki -c /path/to/my/config.yaml cache

Install themes

To install any of the Themes included in the PyKwiki distribution, run the following command:

$ pykwiki -c /path/to/my/config.yaml theme install <theme name>
...