PHPackages                             matthiasjg/kirby3-static-site-composer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. matthiasjg/kirby3-static-site-composer

ActiveKirby-plugin

matthiasjg/kirby3-static-site-composer
======================================

Kirby 3 Static Site Composer

033[1 issues](https://github.com/matthiasjg/kirby3-static-site-composer/issues)PHP

Since Oct 29Pushed 3y ago1 watchersCompare

[ Source](https://github.com/matthiasjg/kirby3-static-site-composer)[ Packagist](https://packagist.org/packages/matthiasjg/kirby3-static-site-composer)[ RSS](/packages/matthiasjg-kirby3-static-site-composer/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Kirby 3 Static Site Composer
============================

[](#kirby-3-static-site-composer)

A Kirby 3 plugin for building composing a static site.

Essentially a wrapper to integrate and trigger suitable community plugins:

1. [Static Site Generator](https://getkirby.com/plugins/d4l/static-site-generator)
2. [Feed](https://getkirby.com/plugins/bnomei/feed)

**Screenshot of field's initial state in Kirby 3 Panel**

[![](screenshot_kirby3_panel_field.png)](screenshot_kirby3_panel_field.png)

**Screenshot of field with results from successfull run**

[![](screenshot_kirby3_panel_field_success.png)](screenshot_kirby3_panel_field_success.png)

Installation
------------

[](#installation)

### Download

[](#download)

Download and copy this repository to `/site/plugins/static-site-composer`.

### Git submodule

[](#git-submodule)

```
git submodule add https://github.com/matthiasjg/kirby3-static-site-composer.git site/plugins/static-site-composer

```

### Composer

[](#composer)

```
composer require matthiasjg/kirby3-static-site-composer
```

Setup
-----

[](#setup)

Instructions on how to configure the plugin, i.e. blueprint setup and config options.

### Blueprint Field

[](#blueprint-field)

```
# site/blueprints/site.yml
fields:
  staticSiteComposer:
    label: Compose
    # help: Click here to compose a static version of the website of pages and feeds.
    # progress: Please wait, composing site...
    # success: Static site successfully composed.
    # error: An error occurred
```

### Config Options

[](#config-options)

This plugin is confgured with the following options:

```
# site/config/config.php
return [
  'matthiasjg' => [
    'static_site_composer' => [
      'endpoint'                  => 'compose-static-site', # set to any string like 'compose-static-site' to use the built-in endpoint (mandatory when using the blueprint field)
      'output_folder'             => './static', # you can specify an absolute or relative path
      'preserve'                  => [], # preserve individual files / folders in the root level of the output folder (anything starting with "." is always preserved)
      'base_url'                  => '/', # if the static site is not mounted to the root folder of your domain, change accordingly here
      'skip_media'                => false, # set to true to skip copying media files, e.g. when they are already on a CDN; combinable with 'preserve' => ['media']
      'skip_templates'            => [], # ignore pages with given templates (home is always rendered)
      'pages_parent_home_root'    => false, # copy pages w/ parent=site.homePage from home/* to root /*
      'preview_url_slug'               => 'preview' # the blueprint option.preview: for site (e.g. "/preview/home"), page (e.g. "/preview{{ page.parent.url }}/{{ page.slug }}") or post (e.g. "/preview/{{ page.parent.slug }}/{{ page.slug }}")
      'feed_formats'              => ['rss', 'json'], # format of feeds
      'feed_description'          => 'Latest posts from the blog', # description for feed
      'feed_collection'           => 'posts', # collection for feed items
      'feed_collection_limit'     => 10, # number of collection items in feed
      'feed_collection_datefield' => 'date', # date field from collection
      'feed_collection_textfield' => 'text' # text field from collection
    ]
  ]
];
```

### HTML Template

[](#html-template)

```
