Download the PHP package jreisdorf/kirby-static-site-generator without Composer

On this page you can find all versions of the php package jreisdorf/kirby-static-site-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kirby-static-site-generator

Kirby 3 / 4 - Static Site Generator

License Kirby 3 Kirby 4

With this plugin you can create a directory with assets, media and static html files generated from your pages. You can simply upload the generated files to any CDN and everything (with small exceptions, see below) will still work. The result is an even faster site containing only static files (no PHP).

Example

What is Kirby?

Kirby is a highly customizable and file-based CMS (content management system). Before using this plugin make sure you have installed the latest version of Kirby CMS and are familiar with the plugin basics.

How to install the plugin

If you use composer, you can install the plugin with: composer require jreisdorf/kirby-static-site-generator

Alternatively, create a static-site-generator folder in site/plugins, download this repository and extract its contents into the new folder.

What works

What doesn't work

How to use it

1) Directly (e.g. from a kirby hook)

2) By triggering an endpoint

To use this, adapt config option jr.static_site_generator.endpoint to your needs (should be a string)

3) By using a static-site-generator field

Do the same as for option 2) and then add a staticSiteGenerator type field to one of your blueprints:

Available configuration options

All of these options are only relevant if you use implementation options 2) or 3). When directly using the JR\StaticSiteGenerator class, no config options are required. In that case, options like skip_media can be achieved by calling $staticSiteGenerator->skipMedia(true).

Field options

Custom routes

You can also use this plugin to render custom routes. This way, e.g. paginations can be created programmatically.

Custom routes are passed as an array. Each item must contain at least a path property and if the path does not match a route, either the page or route property must be set.

Here is an example array, showing the different configuration options:

Only GET routes without language scope are supported (you can of course add multiple custom routes for multiple languages). Patterns and action arguments are supported.

page is provided as a string containing the page ID, or as a page object.

If languageCode is not provided, the given page is rendered in the default language.

If baseUrl is not provided, the default base url is taken.

path may also end with a file name, in which case the given file is created instead of using the <path>/index.html schema.

To pass custom data to the controller or template, use data. Click here for more information how to use it.

⚠️ Have a look here in case you want to dynamically generate the custom routes based on a specific page or point to pages in the config. Kirby comes with a ready option for this purpose.

There are two ways to define custom routes:

1) Directly, when using this plugin directly

2) Via configuration, when using the endpoint or static-site-generator field

Custom filters

When using the endpoint or static-site-generator field, this plugin will by default render all pages and subpages (using pages()->index()). You can filter the pages to be rendered by providing an array of custom filters in config option custom_filters.

Each element of this array must be an array of arguments accepted by $pages->filterBy() method. Here is an example array, showing some filters you could use (not exhaustive):

⚠️ Here again, you can use Kirby's ready option to dynamically generate the custom filters.

Warnings

Be careful when specifying the output folder, as the given path (except files starting with .) will be erased before the generation! There is a safety check in place to avoid accidental erasure when specifying existing, non-empty folders.

Contribute

Feedback and contributions are welcome!

Please post all bug reports in our issue tracker. We have prepared a template which will make it easier to describe the bug.


All versions of kirby-static-site-generator with dependencies

PHP Build Version
Package Version
Requires getkirby/composer-installer Version ^1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jreisdorf/kirby-static-site-generator contains the following files

Loading the files please wait ....