Overview

PHPoole is a CLI application that merge plain text files, images and templates to generate a static website.

Create a new website requires:

  1. PHP 5.6 or 7.1
  2. PHPoole CLI
  3. Plain text documents written in Markdown
  4. A configuration file
  5. Twig templates

Organize files

Files tree must be organized like the following:

.
├─ content               <- Contains text (Mardown) files
|  ├─ 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
├─ layouts               <- Contains Twig templates
|  ├─ _default             <- Contains default templates
|  |  ├─ list.html.twig    <- Used by a "list" node type (ie: a Section)
|  |  └─ page.html.twig    <- Used by the "page" node type
|  └─ index.html.twig      <- Used by the "homepage" node type
├─ static                <- Contains static files
|  └─ robots.txt           <- A static file
└─ phpoole.yml           <- Configuration file

Configure

The configuration is stored in a YAML file named phpoole.yml:

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

Layouts

At least, PHPoole need a index.html.twig layout with {{ page.content }} to build.

Build

Just run the following command at the root of the website:

phpoole build

Preview

To see the result in a web browser, just run:

phpoole serve --browser

Publish

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

./_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