Skip to content

Latest commit

 

History

History
68 lines (49 loc) · 1.5 KB

readme.md

File metadata and controls

68 lines (49 loc) · 1.5 KB

Kirby Components

Built your site with files bundled as components.

How it works

Folders

Place files in template or snippet components.

site/components/
  --about/
    blueprint.yml
    component.php
    controller.php
  --home/
  --projects/
    menu1/
    menu2/
  header/
  footer/
    autoload.php
    component.php
    image.jpg
    style.scss
  • -- prefixed folders are template components.
  • Non prefixed folders are snippet components.
  • You can place snippet components inside template components like snippet(--my-template/my-snippet)

Files

The supported files will be used by the plugin. Additionally you can add your own files like images, css and js.

Template component files

These files are allowed in a template component.

  • autoload.php - Will be loaded instantly when found.
  • component.php - The template file.
  • controller.php - The template controller file.

Snippet component files

  • autoload.php - Will be loaded instantly when found.
  • component.php - The snippet file.

Options

return [
  'jenstornell.components.roots' => $roots
];

roots

You can send a path to your components, or an array with multiple paths.

By default it will use __DIR__ . '/../components'.