PageFactory (Kirby Plugin)

Configuration

Usually there isn't much you need to configure. A PageFactory app works quite well out of the box.

site/config/config.php

Options can be placed in Kirby's config file, like such:

return [
    'smartypants' => true,
    'languages' => true,
    ...
    'pgfactory.pagefactory.options' => [  // → options regarding PageFactory
    ],
];

PageFactory's Config Options

These are the default options you can override:

'pgfactory.pagefactory.options' => [
    'defaultLanguage'               => 'de',   // multilang → configure in panel instead! 
                                               // (Opt. use 'Code: de2' and 'PHP locale string: de_DE')
    'robots'                        => true,   // inject "robots" elem in HTML header
    'excludeFilesRegex'             => '\.old.md$',// regex pattern to exclude certain .md files from rendering
    'locale'                        => 'fr_FR',// if not defined, locale is derived from agent request
    'default-nav'                   => false,  // omit automatic loading of NAV resources
            // Note: normally, nav() is used in Twig template, but that's too late for loading assets.
            // Thus, Pfy loads NAV assets, unless option 'default-nav' is false
    'externalLinksToNewWindow'      => false,  // → used by Link() → whether to open external links in new window
    'imageAutoQuickview'            => false,  // → default for Img() macro
    'imageAutoSrcset'               => false,  // → default for Img() macro
    'includeMetaFileContent'        => false,  // → option for website using '(include: .md)' in metafile
                                                //   e.g. when converting from MdP site to Pfy
    'screenSizeBreakpoint'          => 480,    // Value used by JS to switch body classes 
                                               // ('pfy-large-screen' and 'pfy-small-screen')
    'sourceWrapperTag'              => 'section', // tag used to wrap .md content
    'sourceWrapperClass'            => ”,     // class applied to sourceWrapperTag
    'webmaster_email'               => ”,     // email address of webmaster (→ reset cache if modified!)
    'maxCacheAge'                   => 86400,  // [s] max time after which Kirby's file cache is automatically flushed
    'supportExportAsIframe'         => '',    // Enables Access-Control-Allow-Origin support, to activate use ?iframe
],

PageFactory