Table of contents

Quick Start

PHPoole is a CLI application that merges plain text files (written in Markdown), images and Twig templates to generate a static website.

Installation

Download phpoole.phar from your terminal:

curl -SOL https://phpoole.org/phpoole.phar

You can also download it from the website.

Then, you can install phpoole globally:

mv phpoole.phar /usr/local/bin/phpoole
chmod +x /usr/local/bin/phpoole

PHP 7.1+ is required.

Create a new website

phpoole new <mywebsite>

Configuration

Configuration is stored in a YAML file named phpoole.yml.

<mywebsite>
└─ phpoole.yml

Example

site:
    title: PHPoole
    baseline: An easy and lightweight static website generator.
    baseurl: https://phpoole.org/
    description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
    language: en

Pages and sections

Pages are Markdown files organized in sections.

<mywebsite>
└─ content
   ├─ blog             <- A Section named "Blog"
   |  ├─ post-1.md     <- A Page in the "Blog" section
   |  └─ post-2.md     <- Another Page in the "Blog" Section
   ├─ project          <- A Section named "Project"
   |  └─ project-1.md  <- A Page in the "Project" Section
   └─ about.md         <- A Page in the root

Templates and theming

Layouts are Twig templates.

<mywebsite>
├─ content
├─ layouts
|  ├─ _default           <- Contains default templates
|  |  ├─ list.html.twig  <- Used by a "list" node type
|  |  └─ page.html.twig  <- Used by the "page" node type
|  └─ index.html.twig    <- Used by the "homepage" node type
└─ themes
   └─ <theme>            <- Custom theme
      ├─ layouts
      └─ ...

Static (public) files

Static files must be stored in the static directory: they are copied as is at the root of the built website.

<mywebsite>
├─ content
├─ layouts
└─ static
   ├─ robots.txt
   └─ style
      └─ main.css

Serve

To build and serve the website, just run the following command from the root of your project:

phpoole serve

serve command run a local HTTP server and a watcher: if a file (page, layout or config) is modified, the browser current page is reloaded.

Build

To build only, run:

phpoole build

Publish

By default, the static website is built in the _site directory and can be published as is.

Example

<mywebsite>/_site
├─ blog
|  ├─ post-1
|  |  └─ index.html
|  ├─ post-2
|  |  └─ index.html
|  └─ index.html
├─ project
|  ├─ project-1
|  |  └─ index.html
|  └─ index.html
├─ about
|  └─ index.hml
├─ index.html
└─ robots.txt
Suggest a modification Next