PAGENODE

About Documentation Github

Configuration

Pagenode is configured by defining some constants before loading the pagenode.php.

E.g.:

// Disable Pagenode's syntax highlighting
define('PN_SYNTAX_HIGHLIGHT_LANGS', null);

// Load Pagenode
require_once('pagenode.php');

PN_DATE_FORMAT

The date format to use when echoing $node->date analogous to PHPs date function.

The default is M d, Y - H:i:s.

PN_SYNTAX_HIGHLIGHT_LANGS

A | separated list of languages that should be syntax-highlighted in the Markdown content. Pagenode's syntax highlighter is extremely simple but works well for many c-style languages. To disable syntax highlighting completely define null.

The default is php|js|sql|c.

PN_TIMEZONE

The timezone to use. The default is PHPs default timezone or if none is specified, UTC.

PN_JSON_API_PATH

The path at which to serve the JSON API. See the JSON Interface documentation for the details.

The default is undefined which disables the JSON API.

PN_JSON_API_FULL_DEBUG_INFO

Whether to add the full getDebugInfo() to the JSON API responses.

The default is false which just adds the totalRuntime.

PN_CACHE_INDEX_PATH

The path at which Pagenode will cache its working index. Pagenode will create one index file for each directory from which Nodes are selected.

The default is null which denotes the sys_get_temp_dir() directory.

PN_CACHE_USE_INDICATOR_FILE

Whether to use an indicator file to determine if the cached index is stale. If true and the indicator file time is newer than the cached index file time, Pagenode will rebuild the index. Using an indicator file can speed up Pagenode when it has very many nodes (> 1000).

The default is false which instructs Pagenode to check all file times in the current selector directory to determine if the cache is stale.

PN_CACHE_INDICATOR_FILE

The path of the indicator file to use when PN_CACHE_USE_INDICATOR_FILE is true.

The default is .git/FETCH_HEAD which works nicely when you publish your site via git. Git will update this file whenever you pull changes in your repository, so the file modified time can be used as an indicator for any content changes.

© 2024 Dominic Szablewski – rendered in (2.5ms)